diff options
author | henrikg@webrtc.org <henrikg@webrtc.org> | 2014-09-16 15:29:02 +0000 |
---|---|---|
committer | henrikg@webrtc.org <henrikg@webrtc.org> | 2014-09-16 15:29:02 +0000 |
commit | 8f32b7902e97cbd04d2606b8a90987342692b5f8 (patch) | |
tree | 89c07dbc46ab52f1ef0ece5809825408c03f0bab /test | |
parent | 34374d1ea3f56216836788b7378c69a540fe9197 (diff) | |
download | webrtc-8f32b7902e97cbd04d2606b8a90987342692b5f8.tar.gz |
Mark all virtual overrides in the hierarchies of UdpTransportData and
UdpSocketWrapper as such.
This will make further changes to these classes safer by ensuring that the
compile breaks if the base class changes and not all overrides are fixed.
This also removes an unused function.
BUG=none
TEST=none
R=henrik.lundin@webrtc.org, henrikg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/23579004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@7195 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'test')
-rw-r--r-- | test/channel_transport/udp_socket2_win.h | 31 | ||||
-rw-r--r-- | test/channel_transport/udp_socket_posix.cc | 11 | ||||
-rw-r--r-- | test/channel_transport/udp_socket_posix.h | 4 | ||||
-rw-r--r-- | test/channel_transport/udp_transport_impl.h | 4 |
4 files changed, 22 insertions, 28 deletions
diff --git a/test/channel_transport/udp_socket2_win.h b/test/channel_transport/udp_socket2_win.h index e4d6b8c2..629c9c36 100644 --- a/test/channel_transport/udp_socket2_win.h +++ b/test/channel_transport/udp_socket2_win.h @@ -42,36 +42,37 @@ public: bool ipV6Enable = false, bool disableGQOS = false); virtual ~UdpSocket2Windows(); - virtual int32_t ChangeUniqueId(const int32_t id); + virtual int32_t ChangeUniqueId(const int32_t id) OVERRIDE; - virtual bool ValidHandle(); + virtual bool ValidHandle() OVERRIDE; - virtual bool SetCallback(CallbackObj, IncomingSocketCallback); + virtual bool SetCallback(CallbackObj, IncomingSocketCallback) OVERRIDE; - virtual bool Bind(const SocketAddress& name); + virtual bool Bind(const SocketAddress& name) OVERRIDE; virtual bool SetSockopt(int32_t level, int32_t optname, - const int8_t* optval, int32_t optlen); + const int8_t* optval, int32_t optlen) OVERRIDE; - virtual bool StartReceiving(const uint32_t receiveBuffers); - virtual inline bool StartReceiving() {return StartReceiving(8);} - virtual bool StopReceiving(); + virtual bool StartReceiving(const uint32_t receiveBuffers) OVERRIDE; + virtual inline bool StartReceiving() OVERRIDE {return StartReceiving(8);} + virtual bool StopReceiving() OVERRIDE; virtual int32_t SendTo(const int8_t* buf, int32_t len, - const SocketAddress& to); + const SocketAddress& to) OVERRIDE; - virtual void CloseBlocking(); + virtual void CloseBlocking() OVERRIDE; + + SOCKET GetFd() { return _socket;} - virtual SOCKET GetFd() { return _socket;} virtual bool SetQos(int32_t serviceType, int32_t tokenRate, int32_t bucketSize, int32_t peekBandwith, int32_t minPolicedSize, int32_t maxSduSize, const SocketAddress &stRemName, - int32_t overrideDSCP = 0); + int32_t overrideDSCP = 0) OVERRIDE; - virtual int32_t SetTOS(const int32_t serviceType); - virtual int32_t SetPCP(const int32_t pcp); + virtual int32_t SetTOS(const int32_t serviceType) OVERRIDE; + virtual int32_t SetPCP(const int32_t pcp) OVERRIDE; - virtual uint32_t ReceiveBuffers(){return _receiveBuffers.Value();} + virtual uint32_t ReceiveBuffers() OVERRIDE {return _receiveBuffers.Value();} protected: void IOCompleted(PerIoContext* pIOContext, uint32_t ioSize, uint32_t error); diff --git a/test/channel_transport/udp_socket_posix.cc b/test/channel_transport/udp_socket_posix.cc index 6fc9441d..355da536 100644 --- a/test/channel_transport/udp_socket_posix.cc +++ b/test/channel_transport/udp_socket_posix.cc @@ -33,7 +33,6 @@ UdpSocketPosix::UdpSocketPosix(const int32_t id, UdpSocketManager* mgr, "UdpSocketPosix::UdpSocketPosix()"); _wantsIncoming = false; - _error = 0; _mgr = mgr; _id = id; @@ -129,9 +128,8 @@ bool UdpSocketPosix::SetSockopt(int32_t level, int32_t optname, return true; } - _error = errno; WEBRTC_TRACE(kTraceError, kTraceTransport, _id, - "UdpSocketPosix::SetSockopt(), error:%d", _error); + "UdpSocketPosix::SetSockopt(), error:%d", errno); return false; } @@ -151,9 +149,8 @@ bool UdpSocketPosix::Bind(const SocketAddress& name) { return true; } - _error = errno; WEBRTC_TRACE(kTraceError, kTraceTransport, _id, - "UdpSocketPosix::Bind() error: %d",_error); + "UdpSocketPosix::Bind() error: %d", errno); return false; } @@ -165,16 +162,14 @@ int32_t UdpSocketPosix::SendTo(const int8_t* buf, int32_t len, reinterpret_cast<const sockaddr*>(&to), size); if(retVal == SOCKET_ERROR) { - _error = errno; WEBRTC_TRACE(kTraceError, kTraceTransport, _id, - "UdpSocketPosix::SendTo() error: %d", _error); + "UdpSocketPosix::SendTo() error: %d", errno); } return retVal; } SOCKET UdpSocketPosix::GetFd() { return _socket; } -int32_t UdpSocketPosix::GetError() { return _error; } bool UdpSocketPosix::ValidHandle() { diff --git a/test/channel_transport/udp_socket_posix.h b/test/channel_transport/udp_socket_posix.h index 9b2c037a..8458ca0d 100644 --- a/test/channel_transport/udp_socket_posix.h +++ b/test/channel_transport/udp_socket_posix.h @@ -52,8 +52,7 @@ public: // TODO (hellner): make destructor protected. virtual void CloseBlocking() OVERRIDE; - virtual SOCKET GetFd(); - virtual int32_t GetError(); + SOCKET GetFd(); virtual bool ValidHandle() OVERRIDE; @@ -76,7 +75,6 @@ private: int32_t _id; IncomingSocketCallback _incomingCb; CallbackObj _obj; - int32_t _error; SOCKET _socket; UdpSocketManager* _mgr; diff --git a/test/channel_transport/udp_transport_impl.h b/test/channel_transport/udp_transport_impl.h index 8c74daf9..2b804c35 100644 --- a/test/channel_transport/udp_transport_impl.h +++ b/test/channel_transport/udp_transport_impl.h @@ -60,8 +60,8 @@ public: virtual int32_t InitializeSourcePorts( const uint16_t rtpPort, const uint16_t rtcpPort = 0) OVERRIDE; - virtual int32_t SourcePorts(uint16_t& rtpPort, uint16_t& rtcpPort) const - OVERRIDE; + virtual int32_t SourcePorts(uint16_t& rtpPort, + uint16_t& rtcpPort) const OVERRIDE; virtual int32_t ReceiveSocketInformation( char ipAddr[kIpAddressVersion6Length], uint16_t& rtpPort, |