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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 void ResetChannels(); | 230 void ResetChannels(); |
| 231 | 231 |
| 232 // Destroys every channel created so far. | 232 // Destroys every channel created so far. |
| 233 void DestroyAllChannels(); | 233 void DestroyAllChannels(); |
| 234 | 234 |
| 235 bool GetStats(TransportStats* stats); | 235 bool GetStats(TransportStats* stats); |
| 236 | 236 |
| 237 // Called when one or more candidates are ready from the remote peer. | 237 // Called when one or more candidates are ready from the remote peer. |
| 238 bool AddRemoteCandidates(const std::vector<Candidate>& candidates, | 238 bool AddRemoteCandidates(const std::vector<Candidate>& candidates, |
| 239 std::string* error); | 239 std::string* error); |
| 240 | 240 bool RemoveRemoteCandidates(const std::vector<Candidate>& candidates, |
| 241 // If candidate is not acceptable, returns false and sets error. | 241 std::string* error); |
| 242 // Call this before calling OnRemoteCandidates. | |
| 243 virtual bool VerifyCandidate(const Candidate& candidate, | |
| 244 std::string* error); | |
| 245 | 242 |
| 246 virtual bool GetSslRole(rtc::SSLRole* ssl_role) const { return false; } | 243 virtual bool GetSslRole(rtc::SSLRole* ssl_role) const { return false; } |
| 247 | 244 |
| 248 // Must be called before channel is starting to connect. | 245 // Must be called before channel is starting to connect. |
| 249 virtual bool SetSslMaxProtocolVersion(rtc::SSLProtocolVersion version) { | 246 virtual bool SetSslMaxProtocolVersion(rtc::SSLProtocolVersion version) { |
| 250 return false; | 247 return false; |
| 251 } | 248 } |
| 252 | 249 |
| 253 protected: | 250 protected: |
| 254 // These are called by Create/DestroyChannel above in order to create or | 251 // These are called by Create/DestroyChannel above in order to create or |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 288 std::string* error_desc); | 285 std::string* error_desc); |
| 289 | 286 |
| 290 // Pushes down the transport parameters obtained via negotiation. | 287 // Pushes down the transport parameters obtained via negotiation. |
| 291 // Derived classes can set their specific parameters here, but must call the | 288 // Derived classes can set their specific parameters here, but must call the |
| 292 // base as well. | 289 // base as well. |
| 293 virtual bool ApplyNegotiatedTransportDescription( | 290 virtual bool ApplyNegotiatedTransportDescription( |
| 294 TransportChannelImpl* channel, | 291 TransportChannelImpl* channel, |
| 295 std::string* error_desc); | 292 std::string* error_desc); |
| 296 | 293 |
| 297 private: | 294 private: |
| 295 // If candidate is not acceptable, returns false and sets error. | |
|
pthatcher1
2016/02/10 00:01:41
candidate => a candidate
honghaiz3
2016/02/10 19:22:44
Done.
| |
| 296 // Call this before calling OnRemoteCandidates. | |
| 297 bool VerifyCandidate(const Candidate& candidate, std::string* error); | |
| 298 bool VerifyCandidates(const Candidates& candidates, std::string* error); | |
| 299 | |
| 298 // Candidate component => TransportChannelImpl* | 300 // Candidate component => TransportChannelImpl* |
| 299 typedef std::map<int, TransportChannelImpl*> ChannelMap; | 301 typedef std::map<int, TransportChannelImpl*> ChannelMap; |
| 300 | 302 |
| 301 // Helper function that invokes the given function on every channel. | 303 // Helper function that invokes the given function on every channel. |
| 302 typedef void (TransportChannelImpl::* TransportChannelFunc)(); | 304 typedef void (TransportChannelImpl::* TransportChannelFunc)(); |
| 303 void CallChannels(TransportChannelFunc func); | 305 void CallChannels(TransportChannelFunc func); |
| 304 | 306 |
| 305 const std::string name_; | 307 const std::string name_; |
| 306 PortAllocator* const allocator_; | 308 PortAllocator* const allocator_; |
| 307 bool channels_destroyed_ = false; | 309 bool channels_destroyed_ = false; |
| 308 bool connect_requested_ = false; | 310 bool connect_requested_ = false; |
| 309 IceRole ice_role_ = ICEROLE_UNKNOWN; | 311 IceRole ice_role_ = ICEROLE_UNKNOWN; |
| 310 uint64_t tiebreaker_ = 0; | 312 uint64_t tiebreaker_ = 0; |
| 311 IceMode remote_ice_mode_ = ICEMODE_FULL; | 313 IceMode remote_ice_mode_ = ICEMODE_FULL; |
| 312 IceConfig ice_config_; | 314 IceConfig ice_config_; |
| 313 rtc::scoped_ptr<TransportDescription> local_description_; | 315 rtc::scoped_ptr<TransportDescription> local_description_; |
| 314 rtc::scoped_ptr<TransportDescription> remote_description_; | 316 rtc::scoped_ptr<TransportDescription> remote_description_; |
| 315 bool local_description_set_ = false; | 317 bool local_description_set_ = false; |
| 316 bool remote_description_set_ = false; | 318 bool remote_description_set_ = false; |
| 317 | 319 |
| 318 ChannelMap channels_; | 320 ChannelMap channels_; |
| 319 | 321 |
| 320 RTC_DISALLOW_COPY_AND_ASSIGN(Transport); | 322 RTC_DISALLOW_COPY_AND_ASSIGN(Transport); |
| 321 }; | 323 }; |
| 322 | 324 |
| 323 | 325 |
| 324 } // namespace cricket | 326 } // namespace cricket |
| 325 | 327 |
| 326 #endif // WEBRTC_P2P_BASE_TRANSPORT_H_ | 328 #endif // WEBRTC_P2P_BASE_TRANSPORT_H_ |
| OLD | NEW |