OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2017 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_PACKETTRANSPORTINTERNAL_H_ | 11 #ifndef WEBRTC_P2P_BASE_PACKETTRANSPORTINTERNAL_H_ |
12 #define WEBRTC_P2P_BASE_PACKETTRANSPORTINTERNAL_H_ | 12 #define WEBRTC_P2P_BASE_PACKETTRANSPORTINTERNAL_H_ |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 // This is included for PacketOptions. | 17 // This is included for PacketOptions. |
| 18 #include "webrtc/api/ortc/packettransportinterface.h" |
18 #include "webrtc/base/asyncpacketsocket.h" | 19 #include "webrtc/base/asyncpacketsocket.h" |
19 #include "webrtc/base/sigslot.h" | 20 #include "webrtc/base/sigslot.h" |
20 #include "webrtc/base/socket.h" | 21 #include "webrtc/base/socket.h" |
21 | 22 |
22 namespace cricket { | 23 namespace cricket { |
23 class TransportChannel; | 24 class TransportChannel; |
24 } | 25 } |
25 | 26 |
26 namespace rtc { | 27 namespace rtc { |
27 struct PacketOptions; | 28 struct PacketOptions; |
28 struct PacketTime; | 29 struct PacketTime; |
29 struct SentPacket; | 30 struct SentPacket; |
30 | 31 |
31 class PacketTransportInternal : public sigslot::has_slots<> { | 32 class PacketTransportInternal : public virtual webrtc::PacketTransportInterface, |
| 33 public sigslot::has_slots<> { |
32 public: | 34 public: |
33 // Identify the object for logging and debug purpose. | 35 // Identify the object for logging and debug purpose. |
34 virtual std::string debug_name() const = 0; | 36 virtual std::string debug_name() const = 0; |
35 | 37 |
36 // The transport has been established. | 38 // The transport has been established. |
37 virtual bool writable() const = 0; | 39 virtual bool writable() const = 0; |
38 | 40 |
39 // The transport has received a packet in the last X milliseconds, here X is | 41 // The transport has received a packet in the last X milliseconds, here X is |
40 // configured by each implementation. | 42 // configured by each implementation. |
41 virtual bool receiving() const = 0; | 43 virtual bool receiving() const = 0; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 sigslot::signal5<PacketTransportInternal*, | 83 sigslot::signal5<PacketTransportInternal*, |
82 const char*, | 84 const char*, |
83 size_t, | 85 size_t, |
84 const rtc::PacketTime&, | 86 const rtc::PacketTime&, |
85 int> | 87 int> |
86 SignalReadPacket; | 88 SignalReadPacket; |
87 | 89 |
88 // Signalled each time a packet is sent on this channel. | 90 // Signalled each time a packet is sent on this channel. |
89 sigslot::signal2<PacketTransportInternal*, const rtc::SentPacket&> | 91 sigslot::signal2<PacketTransportInternal*, const rtc::SentPacket&> |
90 SignalSentPacket; | 92 SignalSentPacket; |
| 93 |
| 94 protected: |
| 95 PacketTransportInternal* GetInternal() override { return this; } |
91 }; | 96 }; |
92 | 97 |
93 } // namespace rtc | 98 } // namespace rtc |
94 | 99 |
95 #endif // WEBRTC_P2P_BASE_PACKETTRANSPORTINTERNAL_H_ | 100 #endif // WEBRTC_P2P_BASE_PACKETTRANSPORTINTERNAL_H_ |
OLD | NEW |