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

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

Issue 2679103006: Rename "PacketTransportInterface" to "PacketTransportInternal". (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « webrtc/p2p/base/packettransportinterface.h ('k') | webrtc/p2p/base/transportcontroller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2016 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_PACKETTRANSPORTINTERFACE_H_ 11 #ifndef WEBRTC_P2P_BASE_PACKETTRANSPORTINTERNAL_H_
12 #define WEBRTC_P2P_BASE_PACKETTRANSPORTINTERFACE_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/base/asyncpacketsocket.h" 18 #include "webrtc/base/asyncpacketsocket.h"
19 #include "webrtc/base/sigslot.h" 19 #include "webrtc/base/sigslot.h"
20 #include "webrtc/base/socket.h" 20 #include "webrtc/base/socket.h"
21 21
22 namespace cricket { 22 namespace cricket {
23 class TransportChannel; 23 class TransportChannel;
24 } 24 }
25 25
26 namespace rtc { 26 namespace rtc {
27 struct PacketOptions; 27 struct PacketOptions;
28 struct PacketTime; 28 struct PacketTime;
29 struct SentPacket; 29 struct SentPacket;
30 30
31 class PacketTransportInterface : public sigslot::has_slots<> { 31 class PacketTransportInternal : public sigslot::has_slots<> {
32 public: 32 public:
33 virtual ~PacketTransportInterface() {} 33 virtual ~PacketTransportInternal() {}
34 34
35 // Identify the object for logging and debug purpose. 35 // Identify the object for logging and debug purpose.
36 virtual std::string debug_name() const = 0; 36 virtual std::string debug_name() const = 0;
37 37
38 // The transport has been established. 38 // The transport has been established.
39 virtual bool writable() const = 0; 39 virtual bool writable() const = 0;
40 40
41 // 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
42 // configured by each implementation. 42 // configured by each implementation.
43 virtual bool receiving() const = 0; 43 virtual bool receiving() const = 0;
44 44
45 // Attempts to send the given packet. 45 // Attempts to send the given packet.
46 // The return value is < 0 on failure. The return value in failure case is not 46 // The return value is < 0 on failure. The return value in failure case is not
47 // descriptive. Depending on failure cause and implementation details 47 // descriptive. Depending on failure cause and implementation details
48 // GetError() returns an descriptive errno.h error value. 48 // GetError() returns an descriptive errno.h error value.
49 // This mimics posix socket send() or sendto() behavior. 49 // This mimics posix socket send() or sendto() behavior.
50 // TODO(johan): Reliable, meaningful, consistent error codes for all 50 // TODO(johan): Reliable, meaningful, consistent error codes for all
51 // implementations would be nice. 51 // implementations would be nice.
52 // TODO(johan): Remove the default argument once channel code is updated. 52 // TODO(johan): Remove the default argument once channel code is updated.
53 virtual int SendPacket(const char* data, 53 virtual int SendPacket(const char* data,
54 size_t len, 54 size_t len,
55 const rtc::PacketOptions& options, 55 const rtc::PacketOptions& options,
56 int flags = 0) = 0; 56 int flags = 0) = 0;
57 57
58 // Sets a socket option. Note that not all options are 58 // Sets a socket option. Note that not all options are
59 // supported by all transport types. 59 // supported by all transport types.
60 virtual int SetOption(rtc::Socket::Option opt, int value) = 0; 60 virtual int SetOption(rtc::Socket::Option opt, int value) = 0;
61 61
62 // TODO(pthatcher): Once Chrome's MockPacketTransportInterface implements 62 // TODO(pthatcher): Once Chrome's MockPacketTransportInternal implements
63 // this, remove the default implementation. 63 // this, remove the default implementation.
64 virtual bool GetOption(rtc::Socket::Option opt, int* value) { return false; } 64 virtual bool GetOption(rtc::Socket::Option opt, int* value) { return false; }
65 65
66 // Returns the most recent error that occurred on this channel. 66 // Returns the most recent error that occurred on this channel.
67 virtual int GetError() = 0; 67 virtual int GetError() = 0;
68 68
69 // Emitted when the writable state, represented by |writable()|, changes. 69 // Emitted when the writable state, represented by |writable()|, changes.
70 sigslot::signal1<PacketTransportInterface*> SignalWritableState; 70 sigslot::signal1<PacketTransportInternal*> SignalWritableState;
71 71
72 // Emitted when the PacketTransportInterface is ready to send packets. "Ready 72 // Emitted when the PacketTransportInternal is ready to send packets. "Ready
73 // to send" is more sensitive than the writable state; a transport may be 73 // to send" is more sensitive than the writable state; a transport may be
74 // writable, but temporarily not able to send packets. For example, the 74 // writable, but temporarily not able to send packets. For example, the
75 // underlying transport's socket buffer may be full, as indicated by 75 // underlying transport's socket buffer may be full, as indicated by
76 // SendPacket's return code and/or GetError. 76 // SendPacket's return code and/or GetError.
77 sigslot::signal1<PacketTransportInterface*> SignalReadyToSend; 77 sigslot::signal1<PacketTransportInternal*> SignalReadyToSend;
78 78
79 // Emitted when receiving state changes to true. 79 // Emitted when receiving state changes to true.
80 sigslot::signal1<PacketTransportInterface*> SignalReceivingState; 80 sigslot::signal1<PacketTransportInternal*> SignalReceivingState;
81 81
82 // Signalled each time a packet is received on this channel. 82 // Signalled each time a packet is received on this channel.
83 sigslot::signal5<PacketTransportInterface*, 83 sigslot::signal5<PacketTransportInternal*,
84 const char*, 84 const char*,
85 size_t, 85 size_t,
86 const rtc::PacketTime&, 86 const rtc::PacketTime&,
87 int> 87 int>
88 SignalReadPacket; 88 SignalReadPacket;
89 89
90 // Signalled each time a packet is sent on this channel. 90 // Signalled each time a packet is sent on this channel.
91 sigslot::signal2<PacketTransportInterface*, const rtc::SentPacket&> 91 sigslot::signal2<PacketTransportInternal*, const rtc::SentPacket&>
92 SignalSentPacket; 92 SignalSentPacket;
93 }; 93 };
94 94
95 } // namespace rtc 95 } // namespace rtc
96 96
97 #endif // WEBRTC_P2P_BASE_PACKETTRANSPORTINTERFACE_H_ 97 #endif // WEBRTC_P2P_BASE_PACKETTRANSPORTINTERNAL_H_
OLDNEW
« no previous file with comments | « webrtc/p2p/base/packettransportinterface.h ('k') | webrtc/p2p/base/transportcontroller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698