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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 // Start the connection process for any channels, creating impls if needed. | 93 // Start the connection process for any channels, creating impls if needed. |
94 void ConnectChannels(); | 94 void ConnectChannels(); |
95 // Hook up impls to the proxy channels. Doesn't change connect state. | 95 // Hook up impls to the proxy channels. Doesn't change connect state. |
96 void CompleteNegotiation(); | 96 void CompleteNegotiation(); |
97 | 97 |
98 // Mux this proxy onto the specified proxy's transport. | 98 // Mux this proxy onto the specified proxy's transport. |
99 bool SetupMux(TransportProxy* proxy); | 99 bool SetupMux(TransportProxy* proxy); |
100 | 100 |
101 // Simple functions that thunk down to the same functions on Transport. | 101 // Simple functions that thunk down to the same functions on Transport. |
102 void SetIceRole(IceRole role); | 102 void SetIceRole(IceRole role); |
103 void SetIdentity(rtc::SSLIdentity* identity); | 103 void SetCertificate(rtc::scoped_refptr<webrtc::DtlsCertificate> certificate); |
104 bool SetLocalTransportDescription(const TransportDescription& description, | 104 bool SetLocalTransportDescription(const TransportDescription& description, |
105 ContentAction action, | 105 ContentAction action, |
106 std::string* error_desc); | 106 std::string* error_desc); |
107 bool SetRemoteTransportDescription(const TransportDescription& description, | 107 bool SetRemoteTransportDescription(const TransportDescription& description, |
108 ContentAction action, | 108 ContentAction action, |
109 std::string* error_desc); | 109 std::string* error_desc); |
110 void OnSignalingReady(); | 110 void OnSignalingReady(); |
111 bool OnRemoteCandidates(const Candidates& candidates, std::string* error); | 111 bool OnRemoteCandidates(const Candidates& candidates, std::string* error); |
112 | 112 |
113 // Called when a transport signals that it has new candidates. | 113 // Called when a transport signals that it has new candidates. |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
310 virtual TransportChannel* GetChannel(const std::string& content_name, | 310 virtual TransportChannel* GetChannel(const std::string& content_name, |
311 int component); | 311 int component); |
312 | 312 |
313 // Destroys the channel with the given names. | 313 // Destroys the channel with the given names. |
314 // This will usually be called from the worker thread, but that | 314 // This will usually be called from the worker thread, but that |
315 // shouldn't be an issue since the main thread will be blocked in | 315 // shouldn't be an issue since the main thread will be blocked in |
316 // Send when doing so. | 316 // Send when doing so. |
317 virtual void DestroyChannel(const std::string& content_name, | 317 virtual void DestroyChannel(const std::string& content_name, |
318 int component); | 318 int component); |
319 | 319 |
320 rtc::SSLIdentity* identity() { return identity_; } | 320 rtc::scoped_refptr<webrtc::DtlsCertificate> certificate() { |
tommi (sloooow) - chröme
2015/08/10 16:10:54
also return by const ref
hbos
2015/08/12 08:55:15
Acknowledged.
| |
321 return certificate_; | |
322 } | |
321 | 323 |
322 // Set the ice connection receiving timeout. | 324 // Set the ice connection receiving timeout. |
323 void SetIceConnectionReceivingTimeout(int timeout_ms); | 325 void SetIceConnectionReceivingTimeout(int timeout_ms); |
324 | 326 |
325 protected: | 327 protected: |
326 // Specifies the identity to use in this session. | 328 // Specifies the certificate to use in this session. |
327 bool SetIdentity(rtc::SSLIdentity* identity); | 329 bool SetCertificate(rtc::scoped_refptr<webrtc::DtlsCertificate> certificate); |
328 | 330 |
329 bool SetSslMaxProtocolVersion(rtc::SSLProtocolVersion version); | 331 bool SetSslMaxProtocolVersion(rtc::SSLProtocolVersion version); |
330 | 332 |
331 bool PushdownTransportDescription(ContentSource source, | 333 bool PushdownTransportDescription(ContentSource source, |
332 ContentAction action, | 334 ContentAction action, |
333 std::string* error_desc); | 335 std::string* error_desc); |
334 void set_initiator(bool initiator) { initiator_ = initiator; } | 336 void set_initiator(bool initiator) { initiator_ = initiator; } |
335 | 337 |
336 const TransportMap& transport_proxies() const { return transports_; } | 338 const TransportMap& transport_proxies() const { return transports_; } |
337 // Get a TransportProxy by content_name or transport. NULL if not found. | 339 // Get a TransportProxy by content_name or transport. NULL if not found. |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
440 const std::string& content_name, | 442 const std::string& content_name, |
441 TransportDescription* info); | 443 TransportDescription* info); |
442 | 444 |
443 rtc::Thread* const signaling_thread_; | 445 rtc::Thread* const signaling_thread_; |
444 rtc::Thread* const worker_thread_; | 446 rtc::Thread* const worker_thread_; |
445 PortAllocator* const port_allocator_; | 447 PortAllocator* const port_allocator_; |
446 const std::string sid_; | 448 const std::string sid_; |
447 const std::string content_type_; | 449 const std::string content_type_; |
448 const std::string transport_type_; | 450 const std::string transport_type_; |
449 bool initiator_; | 451 bool initiator_; |
450 rtc::SSLIdentity* identity_; | 452 rtc::scoped_refptr<webrtc::DtlsCertificate> certificate_; |
451 rtc::SSLProtocolVersion ssl_max_version_; | 453 rtc::SSLProtocolVersion ssl_max_version_; |
452 rtc::scoped_ptr<const SessionDescription> local_description_; | 454 rtc::scoped_ptr<const SessionDescription> local_description_; |
453 rtc::scoped_ptr<SessionDescription> remote_description_; | 455 rtc::scoped_ptr<SessionDescription> remote_description_; |
454 uint64 ice_tiebreaker_; | 456 uint64 ice_tiebreaker_; |
455 // This flag will be set to true after the first role switch. This flag | 457 // This flag will be set to true after the first role switch. This flag |
456 // will enable us to stop any role switch during the call. | 458 // will enable us to stop any role switch during the call. |
457 bool role_switch_; | 459 bool role_switch_; |
458 TransportMap transports_; | 460 TransportMap transports_; |
459 | 461 |
460 // Timeout value in milliseconds for which no ICE connection receives | 462 // Timeout value in milliseconds for which no ICE connection receives |
461 // any packets. | 463 // any packets. |
462 int ice_receiving_timeout_; | 464 int ice_receiving_timeout_; |
463 }; | 465 }; |
464 | 466 |
465 } // namespace cricket | 467 } // namespace cricket |
466 | 468 |
467 #endif // WEBRTC_P2P_BASE_SESSION_H_ | 469 #endif // WEBRTC_P2P_BASE_SESSION_H_ |
OLD | NEW |