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

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

Issue 1312643004: Replaces SSLIdentity* with scoped_refptr<RTCCertificate> in cricket::Transport layer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 3 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 20 matching lines...) Expand all
31 31
32 #include <map> 32 #include <map>
33 #include <string> 33 #include <string>
34 #include <vector> 34 #include <vector>
35 #include "webrtc/p2p/base/candidate.h" 35 #include "webrtc/p2p/base/candidate.h"
36 #include "webrtc/p2p/base/constants.h" 36 #include "webrtc/p2p/base/constants.h"
37 #include "webrtc/p2p/base/sessiondescription.h" 37 #include "webrtc/p2p/base/sessiondescription.h"
38 #include "webrtc/p2p/base/transportinfo.h" 38 #include "webrtc/p2p/base/transportinfo.h"
39 #include "webrtc/base/criticalsection.h" 39 #include "webrtc/base/criticalsection.h"
40 #include "webrtc/base/messagequeue.h" 40 #include "webrtc/base/messagequeue.h"
41 #include "webrtc/base/rtccertificate.h"
41 #include "webrtc/base/sigslot.h" 42 #include "webrtc/base/sigslot.h"
42 #include "webrtc/base/sslstreamadapter.h" 43 #include "webrtc/base/sslstreamadapter.h"
43 44
44 namespace rtc { 45 namespace rtc {
45 class Thread; 46 class Thread;
46 } 47 }
47 48
48 namespace cricket { 49 namespace cricket {
49 50
50 class PortAllocator; 51 class PortAllocator;
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 194
194 void SetIceRole(IceRole role); 195 void SetIceRole(IceRole role);
195 IceRole ice_role() const { return ice_role_; } 196 IceRole ice_role() const { return ice_role_; }
196 197
197 void SetIceTiebreaker(uint64 IceTiebreaker) { tiebreaker_ = IceTiebreaker; } 198 void SetIceTiebreaker(uint64 IceTiebreaker) { tiebreaker_ = IceTiebreaker; }
198 uint64 IceTiebreaker() { return tiebreaker_; } 199 uint64 IceTiebreaker() { return tiebreaker_; }
199 200
200 void SetChannelReceivingTimeout(int timeout_ms); 201 void SetChannelReceivingTimeout(int timeout_ms);
201 202
202 // Must be called before applying local session description. 203 // Must be called before applying local session description.
203 void SetIdentity(rtc::SSLIdentity* identity); 204 void SetCertificate(
205 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate);
204 206
205 // Get a copy of the local identity provided by SetIdentity. 207 // Get a copy of the local identity provided by SetIdentity.
206 bool GetIdentity(rtc::SSLIdentity** identity); 208 bool GetCertificate(rtc::scoped_refptr<rtc::RTCCertificate>* certificate);
207 209
208 // Get a copy of the remote certificate in use by the specified channel. 210 // Get a copy of the remote certificate in use by the specified channel.
209 bool GetRemoteCertificate(rtc::SSLCertificate** cert); 211 bool GetRemoteCertificate(rtc::SSLCertificate** cert);
210 212
211 // Create, destroy, and lookup the channels of this type by their components. 213 // Create, destroy, and lookup the channels of this type by their components.
212 TransportChannelImpl* CreateChannel(int component); 214 TransportChannelImpl* CreateChannel(int component);
213 // Note: GetChannel may lead to race conditions, since the mutex is not held 215 // Note: GetChannel may lead to race conditions, since the mutex is not held
214 // after the pointer is returned. 216 // after the pointer is returned.
215 TransportChannelImpl* GetChannel(int component); 217 TransportChannelImpl* GetChannel(int component);
216 // Note: HasChannel does not lead to race conditions, unlike GetChannel. 218 // Note: HasChannel does not lead to race conditions, unlike GetChannel.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 const TransportDescription* local_description() const { 294 const TransportDescription* local_description() const {
293 return local_description_.get(); 295 return local_description_.get();
294 } 296 }
295 297
296 // The current remote transport description, for use by derived classes 298 // The current remote transport description, for use by derived classes
297 // when performing transport description negotiation. 299 // when performing transport description negotiation.
298 const TransportDescription* remote_description() const { 300 const TransportDescription* remote_description() const {
299 return remote_description_.get(); 301 return remote_description_.get();
300 } 302 }
301 303
302 virtual void SetIdentity_w(rtc::SSLIdentity* identity) {} 304 virtual void SetCertificate_w(
305 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) {}
303 306
304 virtual bool GetIdentity_w(rtc::SSLIdentity** identity) { 307 virtual bool GetCertificate_w(
308 rtc::scoped_refptr<rtc::RTCCertificate>* certificate) {
305 return false; 309 return false;
306 } 310 }
307 311
308 // Pushes down the transport parameters from the local description, such 312 // Pushes down the transport parameters from the local description, such
309 // as the ICE ufrag and pwd. 313 // as the ICE ufrag and pwd.
310 // Derived classes can override, but must call the base as well. 314 // Derived classes can override, but must call the base as well.
311 virtual bool ApplyLocalTransportDescription_w(TransportChannelImpl* channel, 315 virtual bool ApplyLocalTransportDescription_w(TransportChannelImpl* channel,
312 std::string* error_desc); 316 std::string* error_desc);
313 317
314 // Pushes down remote ice credentials from the remote description to the 318 // Pushes down remote ice credentials from the remote description to the
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 // Protects changes to channels and messages 469 // Protects changes to channels and messages
466 rtc::CriticalSection crit_; 470 rtc::CriticalSection crit_;
467 471
468 DISALLOW_COPY_AND_ASSIGN(Transport); 472 DISALLOW_COPY_AND_ASSIGN(Transport);
469 }; 473 };
470 474
471 475
472 } // namespace cricket 476 } // namespace cricket
473 477
474 #endif // WEBRTC_P2P_BASE_TRANSPORT_H_ 478 #endif // WEBRTC_P2P_BASE_TRANSPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698