Chromium Code Reviews| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 } | 154 } |
| 155 uint16_t network_cost() const { return network_cost_; } | 155 uint16_t network_cost() const { return network_cost_; } |
| 156 | 156 |
| 157 // An ID assigned to the network hosting the candidate. | 157 // An ID assigned to the network hosting the candidate. |
| 158 uint16_t network_id() const { return network_id_; } | 158 uint16_t network_id() const { return network_id_; } |
| 159 void set_network_id(uint16_t network_id) { network_id_ = network_id; } | 159 void set_network_id(uint16_t network_id) { network_id_ = network_id; } |
| 160 | 160 |
| 161 const std::string& foundation() const { | 161 const std::string& foundation() const { |
| 162 return foundation_; | 162 return foundation_; |
| 163 } | 163 } |
| 164 | |
| 165 void set_foundation(const std::string& foundation) { | 164 void set_foundation(const std::string& foundation) { |
| 166 foundation_ = foundation; | 165 foundation_ = foundation; |
| 167 } | 166 } |
| 168 | 167 |
| 169 const rtc::SocketAddress & related_address() const { | 168 const rtc::SocketAddress & related_address() const { |
| 170 return related_address_; | 169 return related_address_; |
| 171 } | 170 } |
| 172 void set_related_address( | 171 void set_related_address( |
| 173 const rtc::SocketAddress & related_address) { | 172 const rtc::SocketAddress & related_address) { |
| 174 related_address_ = related_address; | 173 related_address_ = related_address; |
| 175 } | 174 } |
| 176 const std::string& tcptype() const { return tcptype_; } | 175 const std::string& tcptype() const { return tcptype_; } |
| 177 void set_tcptype(const std::string& tcptype){ | 176 void set_tcptype(const std::string& tcptype){ |
| 178 tcptype_ = tcptype; | 177 tcptype_ = tcptype; |
| 179 } | 178 } |
| 180 | 179 |
| 181 // The name of the transport channel of this candidate. | 180 // The name of the transport channel of this candidate. |
| 182 const std::string& transport_name() const { return transport_name_; } | 181 const std::string& transport_name() const { return transport_name_; } |
| 183 void set_transport_name(const std::string& transport_name) { | 182 void set_transport_name(const std::string& transport_name) { |
| 184 transport_name_ = transport_name; | 183 transport_name_ = transport_name; |
| 185 } | 184 } |
| 186 | 185 |
| 186 // The URL of ICE server which this candidate is gathered from. | |
|
Taylor Brandstetter
2017/02/10 01:58:45
nit: Add "the" before "ICE server"
Zhi Huang
2017/02/10 06:45:50
Done.
| |
| 187 const std::string& url() const { return url_; } | |
| 188 void set_url(const std::string& url) { url_ = url; } | |
| 189 | |
| 187 // Determines whether this candidate is equivalent to the given one. | 190 // Determines whether this candidate is equivalent to the given one. |
| 188 bool IsEquivalent(const Candidate& c) const { | 191 bool IsEquivalent(const Candidate& c) const { |
| 189 // We ignore the network name, since that is just debug information, and | 192 // We ignore the network name, since that is just debug information, and |
| 190 // the priority and the network cost, since they should be the same if the | 193 // the priority and the network cost, since they should be the same if the |
| 191 // rest are. | 194 // rest are. |
| 192 return (component_ == c.component_) && (protocol_ == c.protocol_) && | 195 return (component_ == c.component_) && (protocol_ == c.protocol_) && |
| 193 (address_ == c.address_) && (username_ == c.username_) && | 196 (address_ == c.address_) && (username_ == c.username_) && |
| 194 (password_ == c.password_) && (type_ == c.type_) && | 197 (password_ == c.password_) && (type_ == c.type_) && |
| 195 (generation_ == c.generation_) && (foundation_ == c.foundation_) && | 198 (generation_ == c.generation_) && (foundation_ == c.foundation_) && |
| 196 (related_address_ == c.related_address_) && | 199 (related_address_ == c.related_address_) && |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 277 std::string type_; | 280 std::string type_; |
| 278 std::string network_name_; | 281 std::string network_name_; |
| 279 rtc::AdapterType network_type_; | 282 rtc::AdapterType network_type_; |
| 280 uint32_t generation_; | 283 uint32_t generation_; |
| 281 std::string foundation_; | 284 std::string foundation_; |
| 282 rtc::SocketAddress related_address_; | 285 rtc::SocketAddress related_address_; |
| 283 std::string tcptype_; | 286 std::string tcptype_; |
| 284 std::string transport_name_; | 287 std::string transport_name_; |
| 285 uint16_t network_id_; | 288 uint16_t network_id_; |
| 286 uint16_t network_cost_; | 289 uint16_t network_cost_; |
| 290 std::string url_; | |
| 287 }; | 291 }; |
| 288 | 292 |
| 289 // Used during parsing and writing to map component to channel name | 293 // Used during parsing and writing to map component to channel name |
| 290 // and back. This is primarily for converting old G-ICE candidate | 294 // and back. This is primarily for converting old G-ICE candidate |
| 291 // signalling to new ICE candidate classes. | 295 // signalling to new ICE candidate classes. |
| 292 class CandidateTranslator { | 296 class CandidateTranslator { |
| 293 public: | 297 public: |
| 294 virtual ~CandidateTranslator() {} | 298 virtual ~CandidateTranslator() {} |
| 295 virtual bool GetChannelNameFromComponent( | 299 virtual bool GetChannelNameFromComponent( |
| 296 int component, std::string* channel_name) const = 0; | 300 int component, std::string* channel_name) const = 0; |
| 297 virtual bool GetComponentFromChannelName( | 301 virtual bool GetComponentFromChannelName( |
| 298 const std::string& channel_name, int* component) const = 0; | 302 const std::string& channel_name, int* component) const = 0; |
| 299 }; | 303 }; |
| 300 | 304 |
| 301 } // namespace cricket | 305 } // namespace cricket |
| 302 | 306 |
| 303 #endif // WEBRTC_P2P_BASE_CANDIDATE_H_ | 307 #endif // WEBRTC_P2P_BASE_CANDIDATE_H_ |
| OLD | NEW |