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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // We ignore the network name, since that is just debug information, and | 174 // We ignore the network name, since that is just debug information, and |
175 // the priority, since that should be the same if the rest is (and it's | 175 // the priority, since that should be the same if the rest is (and it's |
176 // a float so equality checking is always worrisome). | 176 // a float so equality checking is always worrisome). |
177 return (component_ == c.component_) && (protocol_ == c.protocol_) && | 177 return (component_ == c.component_) && (protocol_ == c.protocol_) && |
178 (address_ == c.address_) && (username_ == c.username_) && | 178 (address_ == c.address_) && (username_ == c.username_) && |
179 (password_ == c.password_) && (type_ == c.type_) && | 179 (password_ == c.password_) && (type_ == c.type_) && |
180 (generation_ == c.generation_) && (foundation_ == c.foundation_) && | 180 (generation_ == c.generation_) && (foundation_ == c.foundation_) && |
181 (related_address_ == c.related_address_); | 181 (related_address_ == c.related_address_); |
182 } | 182 } |
183 | 183 |
| 184 // Determines whether this candidate can be considered equivalent to the |
| 185 // given one when looking for a matching candidate to remove. |
| 186 bool MatchesForRemoval(const Candidate& c) const { |
| 187 return component_ == c.component_ && protocol_ == c.protocol_ && |
| 188 address_ == c.address_; |
| 189 } |
| 190 |
184 std::string ToString() const { | 191 std::string ToString() const { |
185 return ToStringInternal(false); | 192 return ToStringInternal(false); |
186 } | 193 } |
187 | 194 |
188 std::string ToSensitiveString() const { | 195 std::string ToSensitiveString() const { |
189 return ToStringInternal(true); | 196 return ToStringInternal(true); |
190 } | 197 } |
191 | 198 |
192 uint32_t GetPriority(uint32_t type_preference, | 199 uint32_t GetPriority(uint32_t type_preference, |
193 int network_adapter_preference, | 200 int network_adapter_preference, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 virtual ~CandidateTranslator() {} | 262 virtual ~CandidateTranslator() {} |
256 virtual bool GetChannelNameFromComponent( | 263 virtual bool GetChannelNameFromComponent( |
257 int component, std::string* channel_name) const = 0; | 264 int component, std::string* channel_name) const = 0; |
258 virtual bool GetComponentFromChannelName( | 265 virtual bool GetComponentFromChannelName( |
259 const std::string& channel_name, int* component) const = 0; | 266 const std::string& channel_name, int* component) const = 0; |
260 }; | 267 }; |
261 | 268 |
262 } // namespace cricket | 269 } // namespace cricket |
263 | 270 |
264 #endif // WEBRTC_P2P_BASE_CANDIDATE_H_ | 271 #endif // WEBRTC_P2P_BASE_CANDIDATE_H_ |
OLD | NEW |