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 |
11 #ifndef WEBRTC_P2P_BASE_TRANSPORTCHANNELIMPL_H_ | 11 #ifndef WEBRTC_P2P_BASE_TRANSPORTCHANNELIMPL_H_ |
12 #define WEBRTC_P2P_BASE_TRANSPORTCHANNELIMPL_H_ | 12 #define WEBRTC_P2P_BASE_TRANSPORTCHANNELIMPL_H_ |
13 | 13 |
14 #include <string> | 14 #include <string> |
| 15 #include "webrtc/p2p/base/transport.h" |
15 #include "webrtc/p2p/base/transportchannel.h" | 16 #include "webrtc/p2p/base/transportchannel.h" |
16 | 17 |
17 namespace buzz { class XmlElement; } | 18 namespace buzz { class XmlElement; } |
18 | 19 |
19 namespace cricket { | 20 namespace cricket { |
20 | 21 |
21 class Candidate; | 22 class Candidate; |
22 | 23 |
23 // TODO(pthatcher): Remove this once it's no longer used in | 24 // TODO(pthatcher): Remove this once it's no longer used in |
24 // remoting/protocol/libjingle_transport_factory.cc | 25 // remoting/protocol/libjingle_transport_factory.cc |
25 enum IceProtocolType { | 26 enum IceProtocolType { |
26 ICEPROTO_RFC5245 // Standard RFC 5245 version of ICE. | 27 ICEPROTO_RFC5245 // Standard RFC 5245 version of ICE. |
27 }; | 28 }; |
28 | 29 |
29 // Base class for real implementations of TransportChannel. This includes some | 30 // Base class for real implementations of TransportChannel. This includes some |
30 // methods called only by Transport, which do not need to be exposed to the | 31 // methods called only by Transport, which do not need to be exposed to the |
31 // client. | 32 // client. |
32 class TransportChannelImpl : public TransportChannel { | 33 class TransportChannelImpl : public TransportChannel { |
33 public: | 34 public: |
34 explicit TransportChannelImpl(const std::string& transport_name, | 35 explicit TransportChannelImpl(const std::string& transport_name, |
35 int component) | 36 int component) |
36 : TransportChannel(transport_name, component) {} | 37 : TransportChannel(transport_name, component) {} |
37 | 38 |
| 39 // Returns the transport that created this channel. |
| 40 virtual Transport* GetTransport() = 0; |
| 41 |
38 // For ICE channels. | 42 // For ICE channels. |
39 virtual IceRole GetIceRole() const = 0; | 43 virtual IceRole GetIceRole() const = 0; |
40 virtual void SetIceRole(IceRole role) = 0; | 44 virtual void SetIceRole(IceRole role) = 0; |
41 virtual void SetIceTiebreaker(uint64_t tiebreaker) = 0; | 45 virtual void SetIceTiebreaker(uint64_t tiebreaker) = 0; |
42 // TODO(pthatcher): Remove this once it's no longer called in | 46 // TODO(pthatcher): Remove this once it's no longer called in |
43 // remoting/protocol/libjingle_transport_factory.cc | 47 // remoting/protocol/libjingle_transport_factory.cc |
44 virtual void SetIceProtocolType(IceProtocolType type) {} | 48 virtual void SetIceProtocolType(IceProtocolType type) {} |
45 // SetIceCredentials only need to be implemented by the ICE | 49 // SetIceCredentials only need to be implemented by the ICE |
46 // transport channels. Non-ICE transport channels can just ignore. | 50 // transport channels. Non-ICE transport channels can just ignore. |
47 // The ufrag and pwd should be set before the Connect() is called. | 51 // The ufrag and pwd should be set before the Connect() is called. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // channel decreases. | 103 // channel decreases. |
100 sigslot::signal1<TransportChannelImpl*> SignalConnectionRemoved; | 104 sigslot::signal1<TransportChannelImpl*> SignalConnectionRemoved; |
101 | 105 |
102 private: | 106 private: |
103 RTC_DISALLOW_COPY_AND_ASSIGN(TransportChannelImpl); | 107 RTC_DISALLOW_COPY_AND_ASSIGN(TransportChannelImpl); |
104 }; | 108 }; |
105 | 109 |
106 } // namespace cricket | 110 } // namespace cricket |
107 | 111 |
108 #endif // WEBRTC_P2P_BASE_TRANSPORTCHANNELIMPL_H_ | 112 #endif // WEBRTC_P2P_BASE_TRANSPORTCHANNELIMPL_H_ |
OLD | NEW |