From 225bfc0971e2986bd42af5c0a6f5c70fa07b6dd3 Mon Sep 17 00:00:00 2001 From: deadbeef Date: Thu, 6 Apr 2017 21:47:33 -0700 Subject: [PATCH] Make PacketTransportInternal inherit from PacketTransportInterface. Was just overlooked in an earlier CL. BUG=webrtc:7013 TBR=pthatcher@webrtc.org Review-Url: https://codereview.webrtc.org/2806463003 Cr-Commit-Position: refs/heads/master@{#17579} --- webrtc/api/ortc/udptransportinterface.h | 2 +- webrtc/p2p/base/fakepackettransport.h | 6 +----- webrtc/p2p/base/packettransportinternal.h | 7 ++++++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/webrtc/api/ortc/udptransportinterface.h b/webrtc/api/ortc/udptransportinterface.h index 278107671b..9d6866ff62 100644 --- a/webrtc/api/ortc/udptransportinterface.h +++ b/webrtc/api/ortc/udptransportinterface.h @@ -27,7 +27,7 @@ namespace webrtc { // // Calling SetRemoteAddress sets the destination of outgoing packets; without a // destination, packets can't be sent, but they can be received. -class UdpTransportInterface : virtual public PacketTransportInterface { +class UdpTransportInterface : public virtual PacketTransportInterface { public: // Get the address of the socket allocated for this transport. virtual rtc::SocketAddress GetLocalAddress() const = 0; diff --git a/webrtc/p2p/base/fakepackettransport.h b/webrtc/p2p/base/fakepackettransport.h index 7e2f08437e..64e0f7d5a8 100644 --- a/webrtc/p2p/base/fakepackettransport.h +++ b/webrtc/p2p/base/fakepackettransport.h @@ -21,8 +21,7 @@ namespace rtc { // Used to simulate a packet-based transport. -class FakePacketTransport : public PacketTransportInternal, - public webrtc::PacketTransportInterface { +class FakePacketTransport : public PacketTransportInternal { public: explicit FakePacketTransport(const std::string& debug_name) : debug_name_(debug_name) {} @@ -87,9 +86,6 @@ class FakePacketTransport : public PacketTransportInternal, bool GetOption(Socket::Option opt, int* value) override { return true; } int GetError() override { return 0; } - protected: - PacketTransportInternal* GetInternal() override { return this; } - private: void set_writable(bool writable) { if (writable_ == writable) { diff --git a/webrtc/p2p/base/packettransportinternal.h b/webrtc/p2p/base/packettransportinternal.h index 325c00e65c..8e32f72480 100644 --- a/webrtc/p2p/base/packettransportinternal.h +++ b/webrtc/p2p/base/packettransportinternal.h @@ -15,6 +15,7 @@ #include // This is included for PacketOptions. +#include "webrtc/api/ortc/packettransportinterface.h" #include "webrtc/base/asyncpacketsocket.h" #include "webrtc/base/sigslot.h" #include "webrtc/base/socket.h" @@ -28,7 +29,8 @@ struct PacketOptions; struct PacketTime; struct SentPacket; -class PacketTransportInternal : public sigslot::has_slots<> { +class PacketTransportInternal : public virtual webrtc::PacketTransportInterface, + public sigslot::has_slots<> { public: // Identify the object for logging and debug purpose. virtual std::string debug_name() const = 0; @@ -88,6 +90,9 @@ class PacketTransportInternal : public sigslot::has_slots<> { // Signalled each time a packet is sent on this channel. sigslot::signal2 SignalSentPacket; + + protected: + PacketTransportInternal* GetInternal() override { return this; } }; } // namespace rtc