Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: webrtc/p2p/base/session.h

Issue 1269843005: Added DtlsCertificate, a ref counted object owning an SSLIdentity (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Merge with master Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(
104 const rtc::scoped_refptr<webrtc::DtlsCertificate>& certificate);
104 bool SetLocalTransportDescription(const TransportDescription& description, 105 bool SetLocalTransportDescription(const TransportDescription& description,
105 ContentAction action, 106 ContentAction action,
106 std::string* error_desc); 107 std::string* error_desc);
107 bool SetRemoteTransportDescription(const TransportDescription& description, 108 bool SetRemoteTransportDescription(const TransportDescription& description,
108 ContentAction action, 109 ContentAction action,
109 std::string* error_desc); 110 std::string* error_desc);
110 void OnSignalingReady(); 111 void OnSignalingReady();
111 bool OnRemoteCandidates(const Candidates& candidates, std::string* error); 112 bool OnRemoteCandidates(const Candidates& candidates, std::string* error);
112 113
113 // Called when a transport signals that it has new candidates. 114 // Called when a transport signals that it has new candidates.
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 virtual TransportChannel* GetChannel(const std::string& content_name, 311 virtual TransportChannel* GetChannel(const std::string& content_name,
311 int component); 312 int component);
312 313
313 // Destroys the channel with the given names. 314 // Destroys the channel with the given names.
314 // This will usually be called from the worker thread, but that 315 // 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 316 // shouldn't be an issue since the main thread will be blocked in
316 // Send when doing so. 317 // Send when doing so.
317 virtual void DestroyChannel(const std::string& content_name, 318 virtual void DestroyChannel(const std::string& content_name,
318 int component); 319 int component);
319 320
320 rtc::SSLIdentity* identity() { return identity_; } 321 const rtc::scoped_refptr<webrtc::DtlsCertificate>& certificate() {
322 return certificate_;
323 }
321 324
322 // Set the ice connection receiving timeout. 325 // Set the ice connection receiving timeout.
323 void SetIceConnectionReceivingTimeout(int timeout_ms); 326 void SetIceConnectionReceivingTimeout(int timeout_ms);
324 327
325 protected: 328 protected:
326 // Specifies the identity to use in this session. 329 // Specifies the certificate to use in this session.
327 bool SetIdentity(rtc::SSLIdentity* identity); 330 bool SetCertificate(
331 const rtc::scoped_refptr<webrtc::DtlsCertificate>& certificate);
328 332
329 bool SetSslMaxProtocolVersion(rtc::SSLProtocolVersion version); 333 bool SetSslMaxProtocolVersion(rtc::SSLProtocolVersion version);
330 334
331 bool PushdownTransportDescription(ContentSource source, 335 bool PushdownTransportDescription(ContentSource source,
332 ContentAction action, 336 ContentAction action,
333 std::string* error_desc); 337 std::string* error_desc);
334 void set_initiator(bool initiator) { initiator_ = initiator; } 338 void set_initiator(bool initiator) { initiator_ = initiator; }
335 339
336 const TransportMap& transport_proxies() const { return transports_; } 340 const TransportMap& transport_proxies() const { return transports_; }
337 // Get a TransportProxy by content_name or transport. NULL if not found. 341 // Get a TransportProxy by content_name or transport. NULL if not found.
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 const std::string& content_name, 444 const std::string& content_name,
441 TransportDescription* info); 445 TransportDescription* info);
442 446
443 rtc::Thread* const signaling_thread_; 447 rtc::Thread* const signaling_thread_;
444 rtc::Thread* const worker_thread_; 448 rtc::Thread* const worker_thread_;
445 PortAllocator* const port_allocator_; 449 PortAllocator* const port_allocator_;
446 const std::string sid_; 450 const std::string sid_;
447 const std::string content_type_; 451 const std::string content_type_;
448 const std::string transport_type_; 452 const std::string transport_type_;
449 bool initiator_; 453 bool initiator_;
450 rtc::SSLIdentity* identity_; 454 rtc::scoped_refptr<webrtc::DtlsCertificate> certificate_;
451 rtc::SSLProtocolVersion ssl_max_version_; 455 rtc::SSLProtocolVersion ssl_max_version_;
452 rtc::scoped_ptr<const SessionDescription> local_description_; 456 rtc::scoped_ptr<const SessionDescription> local_description_;
453 rtc::scoped_ptr<SessionDescription> remote_description_; 457 rtc::scoped_ptr<SessionDescription> remote_description_;
454 uint64 ice_tiebreaker_; 458 uint64 ice_tiebreaker_;
455 // This flag will be set to true after the first role switch. This flag 459 // 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. 460 // will enable us to stop any role switch during the call.
457 bool role_switch_; 461 bool role_switch_;
458 TransportMap transports_; 462 TransportMap transports_;
459 463
460 // Timeout value in milliseconds for which no ICE connection receives 464 // Timeout value in milliseconds for which no ICE connection receives
461 // any packets. 465 // any packets.
462 int ice_receiving_timeout_; 466 int ice_receiving_timeout_;
463 }; 467 };
464 468
465 } // namespace cricket 469 } // namespace cricket
466 470
467 #endif // WEBRTC_P2P_BASE_SESSION_H_ 471 #endif // WEBRTC_P2P_BASE_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698