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

Unified Diff: webrtc/p2p/base/transportchannel.h

Issue 2416023002: Introduce rtc::PacketTransportInterface and let cricket::TransportChannel inherit. (Closed)
Patch Set: Let BaseChannel::PacketIsRtcp() use PacketTransportInterface. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/p2p/base/transportchannel.h
diff --git a/webrtc/p2p/base/transportchannel.h b/webrtc/p2p/base/transportchannel.h
index 9b0ac7bd5bcae60bd95d6c1c5c264d363c2e1160..01270a5775fb66f1a840e68808fd3d69d0fe4342 100644
--- a/webrtc/p2p/base/transportchannel.h
+++ b/webrtc/p2p/base/transportchannel.h
@@ -18,6 +18,7 @@
#include "webrtc/base/constructormagic.h"
#include "webrtc/p2p/base/candidate.h"
#include "webrtc/p2p/base/candidatepairinterface.h"
+#include "webrtc/p2p/base/packettransportinterface.h"
#include "webrtc/p2p/base/transport.h"
#include "webrtc/p2p/base/transportdescription.h"
#include "webrtc/base/asyncpacketsocket.h"
@@ -51,7 +52,7 @@ enum TransportChannelState {
// between the two sides of a session.
// TODO(deadbeef): This interface currently represents the unity of an ICE
// transport and a DTLS transport. They need to be separated apart.
-class TransportChannel : public sigslot::has_slots<> {
+class TransportChannel : public rtc::PacketTransportInterface {
public:
TransportChannel(const std::string& transport_name, int component)
: transport_name_(transport_name),
@@ -68,36 +69,20 @@ class TransportChannel : public sigslot::has_slots<> {
const std::string& transport_name() const { return transport_name_; }
int component() const { return component_; }
+ const std::string debug_name() const override {
+ return transport_name() + " " + std::to_string(component());
+ }
// Returns the states of this channel. Each time one of these states changes,
// a signal is raised. These states are aggregated by the TransportManager.
- bool writable() const { return writable_; }
+ bool writable() const override { return writable_; }
bool receiving() const { return receiving_; }
DtlsTransportState dtls_state() const { return dtls_state_; }
- sigslot::signal1<TransportChannel*> SignalWritableState;
- // Emitted when the TransportChannel's ability to send has changed.
- sigslot::signal1<TransportChannel*> SignalReadyToSend;
sigslot::signal1<TransportChannel*> SignalReceivingState;
// Emitted whenever DTLS-SRTP is setup which will require setting up a new
// SRTP context.
sigslot::signal2<TransportChannel*, DtlsTransportState> SignalDtlsState;
- // Attempts to send the given packet. The return value is < 0 on failure.
- // TODO: Remove the default argument once channel code is updated.
- virtual int SendPacket(const char* data, size_t len,
- const rtc::PacketOptions& options,
- int flags = 0) = 0;
-
- // Sets a socket option on this channel. Note that not all options are
- // supported by all transport types.
- virtual int SetOption(rtc::Socket::Option opt, int value) = 0;
- // TODO(pthatcher): Once Chrome's MockTransportChannel implments
- // this, remove the default implementation.
- virtual bool GetOption(rtc::Socket::Option opt, int* value) { return false; }
-
- // Returns the most recent error that occurred on this channel.
- virtual int GetError() = 0;
-
// Returns the current stats for this connection.
virtual bool GetStats(ConnectionInfos* infos) = 0;
@@ -139,13 +124,6 @@ class TransportChannel : public sigslot::has_slots<> {
uint8_t* result,
size_t result_len) = 0;
- // Signalled each time a packet is received on this channel.
- sigslot::signal5<TransportChannel*, const char*,
- size_t, const rtc::PacketTime&, int> SignalReadPacket;
-
- // Signalled each time a packet is sent on this channel.
- sigslot::signal2<TransportChannel*, const rtc::SentPacket&> SignalSentPacket;
-
// Deprecated by SignalSelectedCandidatePairChanged
// This signal occurs when there is a change in the way that packets are
// being routed, i.e. to a different remote location. The candidate

Powered by Google App Engine
This is Rietveld 408576698