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 14 matching lines...) Expand all Loading... |
25 // Note: Subclasses must call DestroyChannels() in their own constructors. | 25 // Note: Subclasses must call DestroyChannels() in their own constructors. |
26 // It is not possible to do so here because the subclass constructor will | 26 // It is not possible to do so here because the subclass constructor will |
27 // already have run. | 27 // already have run. |
28 | 28 |
29 #ifndef WEBRTC_P2P_BASE_TRANSPORT_H_ | 29 #ifndef WEBRTC_P2P_BASE_TRANSPORT_H_ |
30 #define WEBRTC_P2P_BASE_TRANSPORT_H_ | 30 #define WEBRTC_P2P_BASE_TRANSPORT_H_ |
31 | 31 |
32 #include <map> | 32 #include <map> |
33 #include <string> | 33 #include <string> |
34 #include <vector> | 34 #include <vector> |
| 35 |
| 36 #include "talk/app/webrtc/dtlscertificate.h" |
35 #include "webrtc/p2p/base/candidate.h" | 37 #include "webrtc/p2p/base/candidate.h" |
36 #include "webrtc/p2p/base/constants.h" | 38 #include "webrtc/p2p/base/constants.h" |
37 #include "webrtc/p2p/base/sessiondescription.h" | 39 #include "webrtc/p2p/base/sessiondescription.h" |
38 #include "webrtc/p2p/base/transportinfo.h" | 40 #include "webrtc/p2p/base/transportinfo.h" |
39 #include "webrtc/base/criticalsection.h" | 41 #include "webrtc/base/criticalsection.h" |
40 #include "webrtc/base/messagequeue.h" | 42 #include "webrtc/base/messagequeue.h" |
41 #include "webrtc/base/sigslot.h" | 43 #include "webrtc/base/sigslot.h" |
42 #include "webrtc/base/sslstreamadapter.h" | 44 #include "webrtc/base/sslstreamadapter.h" |
43 | 45 |
44 namespace rtc { | 46 namespace rtc { |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 198 |
197 void SetIceRole(IceRole role); | 199 void SetIceRole(IceRole role); |
198 IceRole ice_role() const { return ice_role_; } | 200 IceRole ice_role() const { return ice_role_; } |
199 | 201 |
200 void SetIceTiebreaker(uint64 IceTiebreaker) { tiebreaker_ = IceTiebreaker; } | 202 void SetIceTiebreaker(uint64 IceTiebreaker) { tiebreaker_ = IceTiebreaker; } |
201 uint64 IceTiebreaker() { return tiebreaker_; } | 203 uint64 IceTiebreaker() { return tiebreaker_; } |
202 | 204 |
203 void SetChannelReceivingTimeout(int timeout_ms); | 205 void SetChannelReceivingTimeout(int timeout_ms); |
204 | 206 |
205 // Must be called before applying local session description. | 207 // Must be called before applying local session description. |
206 void SetIdentity(rtc::SSLIdentity* identity); | 208 void SetCertificate( |
| 209 const rtc::scoped_refptr<webrtc::DtlsCertificate>& certificate); |
207 | 210 |
208 // Get a copy of the local identity provided by SetIdentity. | 211 // Get a reference to the local certificate provided by SetCertificate. |
209 bool GetIdentity(rtc::SSLIdentity** identity); | 212 bool GetCertificate(rtc::scoped_refptr<webrtc::DtlsCertificate>* certificate); |
210 | 213 |
211 // Get a copy of the remote certificate in use by the specified channel. | 214 // Get a copy of the remote certificate in use by the specified channel. |
212 bool GetRemoteCertificate(rtc::SSLCertificate** cert); | 215 bool GetRemoteCertificate(rtc::SSLCertificate** cert); |
213 | 216 |
214 TransportProtocol protocol() const { return protocol_; } | 217 TransportProtocol protocol() const { return protocol_; } |
215 | 218 |
216 // Create, destroy, and lookup the channels of this type by their components. | 219 // Create, destroy, and lookup the channels of this type by their components. |
217 TransportChannelImpl* CreateChannel(int component); | 220 TransportChannelImpl* CreateChannel(int component); |
218 // Note: GetChannel may lead to race conditions, since the mutex is not held | 221 // Note: GetChannel may lead to race conditions, since the mutex is not held |
219 // after the pointer is returned. | 222 // after the pointer is returned. |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 const TransportDescription* local_description() const { | 300 const TransportDescription* local_description() const { |
298 return local_description_.get(); | 301 return local_description_.get(); |
299 } | 302 } |
300 | 303 |
301 // The current remote transport description, for use by derived classes | 304 // The current remote transport description, for use by derived classes |
302 // when performing transport description negotiation. | 305 // when performing transport description negotiation. |
303 const TransportDescription* remote_description() const { | 306 const TransportDescription* remote_description() const { |
304 return remote_description_.get(); | 307 return remote_description_.get(); |
305 } | 308 } |
306 | 309 |
307 virtual void SetIdentity_w(rtc::SSLIdentity* identity) {} | 310 virtual void SetCertificate_w( |
| 311 const rtc::scoped_refptr<webrtc::DtlsCertificate>& certificate) {} |
308 | 312 |
309 virtual bool GetIdentity_w(rtc::SSLIdentity** identity) { | 313 virtual bool GetCertificate_w( |
| 314 rtc::scoped_refptr<webrtc::DtlsCertificate>* certificate) { |
310 return false; | 315 return false; |
311 } | 316 } |
312 | 317 |
313 // Pushes down the transport parameters from the local description, such | 318 // Pushes down the transport parameters from the local description, such |
314 // as the ICE ufrag and pwd. | 319 // as the ICE ufrag and pwd. |
315 // Derived classes can override, but must call the base as well. | 320 // Derived classes can override, but must call the base as well. |
316 virtual bool ApplyLocalTransportDescription_w(TransportChannelImpl* channel, | 321 virtual bool ApplyLocalTransportDescription_w(TransportChannelImpl* channel, |
317 std::string* error_desc); | 322 std::string* error_desc); |
318 | 323 |
319 // Pushes down remote ice credentials from the remote description to the | 324 // Pushes down remote ice credentials from the remote description to the |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 DISALLOW_COPY_AND_ASSIGN(Transport); | 480 DISALLOW_COPY_AND_ASSIGN(Transport); |
476 }; | 481 }; |
477 | 482 |
478 // Extract a TransportProtocol from a TransportDescription. | 483 // Extract a TransportProtocol from a TransportDescription. |
479 TransportProtocol TransportProtocolFromDescription( | 484 TransportProtocol TransportProtocolFromDescription( |
480 const TransportDescription* desc); | 485 const TransportDescription* desc); |
481 | 486 |
482 } // namespace cricket | 487 } // namespace cricket |
483 | 488 |
484 #endif // WEBRTC_P2P_BASE_TRANSPORT_H_ | 489 #endif // WEBRTC_P2P_BASE_TRANSPORT_H_ |
OLD | NEW |