OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 // We ignore the network name, since that is just debug information, and | 163 // We ignore the network name, since that is just debug information, and |
164 // the priority, since that should be the same if the rest is (and it's | 164 // the priority, since that should be the same if the rest is (and it's |
165 // a float so equality checking is always worrisome). | 165 // a float so equality checking is always worrisome). |
166 return (component_ == c.component_) && (protocol_ == c.protocol_) && | 166 return (component_ == c.component_) && (protocol_ == c.protocol_) && |
167 (address_ == c.address_) && (username_ == c.username_) && | 167 (address_ == c.address_) && (username_ == c.username_) && |
168 (password_ == c.password_) && (type_ == c.type_) && | 168 (password_ == c.password_) && (type_ == c.type_) && |
169 (generation_ == c.generation_) && (foundation_ == c.foundation_) && | 169 (generation_ == c.generation_) && (foundation_ == c.foundation_) && |
170 (related_address_ == c.related_address_); | 170 (related_address_ == c.related_address_); |
171 } | 171 } |
172 | 172 |
173 // Determines whether this candidate can be considered equivalent to the | |
174 // given one when looking for a matching candidate to remove. | |
175 bool MatchesForRemoval(const Candidate& c) const { | |
176 return component_ == c.component_ && protocol_ == c.protocol_ && | |
177 address_ == c.address_; | |
178 } | |
179 | |
Taylor Brandstetter
2016/02/10 21:58:08
Why can't IsEquivalent be used?
pthatcher1
2016/02/11 20:25:51
Because then we have to signal everything. It wou
Taylor Brandstetter
2016/02/11 20:55:17
Is there a reason why signaling the whole candidat
honghaiz3
2016/02/12 00:56:55
Signaling everything will consume unnecessary band
| |
173 std::string ToString() const { | 180 std::string ToString() const { |
174 return ToStringInternal(false); | 181 return ToStringInternal(false); |
175 } | 182 } |
176 | 183 |
177 std::string ToSensitiveString() const { | 184 std::string ToSensitiveString() const { |
178 return ToStringInternal(true); | 185 return ToStringInternal(true); |
179 } | 186 } |
180 | 187 |
181 uint32_t GetPriority(uint32_t type_preference, | 188 uint32_t GetPriority(uint32_t type_preference, |
182 int network_adapter_preference, | 189 int network_adapter_preference, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
243 virtual ~CandidateTranslator() {} | 250 virtual ~CandidateTranslator() {} |
244 virtual bool GetChannelNameFromComponent( | 251 virtual bool GetChannelNameFromComponent( |
245 int component, std::string* channel_name) const = 0; | 252 int component, std::string* channel_name) const = 0; |
246 virtual bool GetComponentFromChannelName( | 253 virtual bool GetComponentFromChannelName( |
247 const std::string& channel_name, int* component) const = 0; | 254 const std::string& channel_name, int* component) const = 0; |
248 }; | 255 }; |
249 | 256 |
250 } // namespace cricket | 257 } // namespace cricket |
251 | 258 |
252 #endif // WEBRTC_P2P_BASE_CANDIDATE_H_ | 259 #endif // WEBRTC_P2P_BASE_CANDIDATE_H_ |
OLD | NEW |