diff options
29 files changed, 246 insertions, 252 deletions
diff --git a/jingle/glue/channel_socket_adapter.h b/jingle/glue/channel_socket_adapter.h index 48c4097..d3ba419 100644 --- a/jingle/glue/channel_socket_adapter.h +++ b/jingle/glue/channel_socket_adapter.h @@ -30,7 +30,7 @@ class TransportChannelSocketAdapter : public net::Socket, public: // TransportChannel object is always owned by the corresponding session. explicit TransportChannelSocketAdapter(cricket::TransportChannel* channel); - virtual ~TransportChannelSocketAdapter(); + ~TransportChannelSocketAdapter() override; // Sets callback that should be called when the adapter is being // destroyed. The callback is not allowed to touch the adapter, but @@ -43,13 +43,15 @@ class TransportChannelSocketAdapter : public net::Socket, void Close(int error_code); // Socket implementation. - virtual int Read(net::IOBuffer* buf, int buf_len, - const net::CompletionCallback& callback) override; - virtual int Write(net::IOBuffer* buf, int buf_len, - const net::CompletionCallback& callback) override; - - virtual int SetReceiveBufferSize(int32 size) override; - virtual int SetSendBufferSize(int32 size) override; + int Read(net::IOBuffer* buf, + int buf_len, + const net::CompletionCallback& callback) override; + int Write(net::IOBuffer* buf, + int buf_len, + const net::CompletionCallback& callback) override; + + int SetReceiveBufferSize(int32 size) override; + int SetSendBufferSize(int32 size) override; private: void OnNewPacket(cricket::TransportChannel* channel, diff --git a/jingle/glue/chrome_async_socket.h b/jingle/glue/chrome_async_socket.h index e05f9c6..af6a8fc 100644 --- a/jingle/glue/chrome_async_socket.h +++ b/jingle/glue/chrome_async_socket.h @@ -41,22 +41,22 @@ class ChromeAsyncSocket : public buzz::AsyncSocket { size_t write_buf_size); // Does not raise any signals. - virtual ~ChromeAsyncSocket(); + ~ChromeAsyncSocket() override; // buzz::AsyncSocket implementation. // The current state (see buzz::AsyncSocket::State; all but // STATE_CLOSING is used). - virtual State state() override; + State state() override; // The last generated error. Errors are generated when the main // functions below return false or when SignalClosed is raised due // to an asynchronous error. - virtual Error error() override; + Error error() override; // GetError() (which is of type net::Error) != net::OK only when // error() == ERROR_WINSOCK. - virtual int GetError() override; + int GetError() override; // Tries to connect to the given address. // @@ -72,7 +72,7 @@ class ChromeAsyncSocket : public buzz::AsyncSocket { // Otherwise, starts the connection process and returns true. // SignalConnected will be raised when the connection is successful; // otherwise, SignalClosed will be raised with a net error set. - virtual bool Connect(const rtc::SocketAddress& address) override; + bool Connect(const rtc::SocketAddress& address) override; // Tries to read at most |len| bytes into |data|. // @@ -85,7 +85,7 @@ class ChromeAsyncSocket : public buzz::AsyncSocket { // case because StartTls() is called during a slot connected to // SignalRead after parsing the final non-TLS reply from the server // [see XmppClient::Private::OnSocketRead()].) - virtual bool Read(char* data, size_t len, size_t* len_read) override; + bool Read(char* data, size_t len, size_t* len_read) override; // Queues up |len| bytes of |data| for writing. // @@ -104,11 +104,11 @@ class ChromeAsyncSocket : public buzz::AsyncSocket { // Note that there's no guarantee that the data will actually be // sent; however, it is guaranteed that the any data sent will be // sent in FIFO order. - virtual bool Write(const char* data, size_t len) override; + bool Write(const char* data, size_t len) override; // If the socket is not already closed, closes the socket and raises // SignalClosed. Always returns true. - virtual bool Close() override; + bool Close() override; // Tries to change to a TLS connection with the given domain name. // @@ -121,7 +121,7 @@ class ChromeAsyncSocket : public buzz::AsyncSocket { // SignalSSLConnected will be raised when the connection is // successful; otherwise, SignalClosed will be raised with a net // error set. - virtual bool StartTls(const std::string& domain_name) override; + bool StartTls(const std::string& domain_name) override; // Signal behavior: // diff --git a/jingle/glue/chrome_async_socket_unittest.cc b/jingle/glue/chrome_async_socket_unittest.cc index e04b608..4449d38 100644 --- a/jingle/glue/chrome_async_socket_unittest.cc +++ b/jingle/glue/chrome_async_socket_unittest.cc @@ -36,14 +36,14 @@ class AsyncSocketDataProvider : public net::SocketDataProvider { public: AsyncSocketDataProvider() : has_pending_read_(false) {} - virtual ~AsyncSocketDataProvider() { + ~AsyncSocketDataProvider() override { EXPECT_TRUE(writes_.empty()); EXPECT_TRUE(reads_.empty()); } // If there's no read, sets the "has pending read" flag. Otherwise, // pops the next read. - virtual net::MockRead GetNextRead() override { + net::MockRead GetNextRead() override { if (reads_.empty()) { DCHECK(!has_pending_read_); has_pending_read_ = true; @@ -57,7 +57,7 @@ class AsyncSocketDataProvider : public net::SocketDataProvider { // Simply pops the next write and, if applicable, compares it to // |data|. - virtual net::MockWriteResult OnWrite(const std::string& data) override { + net::MockWriteResult OnWrite(const std::string& data) override { DCHECK(!writes_.empty()); net::MockWrite mock_write = writes_.front(); writes_.pop_front(); @@ -74,7 +74,7 @@ class AsyncSocketDataProvider : public net::SocketDataProvider { // We ignore resets so we can pre-load the socket data provider with // read/write events. - virtual void Reset() override {} + void Reset() override {} // If there is a pending read, completes it with the given read. // Otherwise, queues up the given read. @@ -114,13 +114,13 @@ class MockXmppClientSocketFactory : public ResolvingClientSocketFactory { } // ResolvingClientSocketFactory implementation. - virtual scoped_ptr<net::StreamSocket> CreateTransportClientSocket( + scoped_ptr<net::StreamSocket> CreateTransportClientSocket( const net::HostPortPair& host_and_port) override { return mock_client_socket_factory_->CreateTransportClientSocket( address_list_, NULL, net::NetLog::Source()); } - virtual scoped_ptr<net::SSLClientSocket> CreateSSLClientSocket( + scoped_ptr<net::SSLClientSocket> CreateSSLClientSocket( scoped_ptr<net::ClientSocketHandle> transport_socket, const net::HostPortPair& host_and_port) override { net::SSLClientSocketContext context; diff --git a/jingle/glue/fake_ssl_client_socket.h b/jingle/glue/fake_ssl_client_socket.h index a27caa7..bf951d6 100644 --- a/jingle/glue/fake_ssl_client_socket.h +++ b/jingle/glue/fake_ssl_client_socket.h @@ -38,33 +38,35 @@ class FakeSSLClientSocket : public net::StreamSocket { public: explicit FakeSSLClientSocket(scoped_ptr<net::StreamSocket> transport_socket); - virtual ~FakeSSLClientSocket(); + ~FakeSSLClientSocket() override; // Exposed for testing. static base::StringPiece GetSslClientHello(); static base::StringPiece GetSslServerHello(); // net::StreamSocket implementation. - virtual int Read(net::IOBuffer* buf, int buf_len, - const net::CompletionCallback& callback) override; - virtual int Write(net::IOBuffer* buf, int buf_len, - const net::CompletionCallback& callback) override; - virtual int SetReceiveBufferSize(int32 size) override; - virtual int SetSendBufferSize(int32 size) override; - virtual int Connect(const net::CompletionCallback& callback) override; - virtual void Disconnect() override; - virtual bool IsConnected() const override; - virtual bool IsConnectedAndIdle() const override; - virtual int GetPeerAddress(net::IPEndPoint* address) const override; - virtual int GetLocalAddress(net::IPEndPoint* address) const override; - virtual const net::BoundNetLog& NetLog() const override; - virtual void SetSubresourceSpeculation() override; - virtual void SetOmniboxSpeculation() override; - virtual bool WasEverUsed() const override; - virtual bool UsingTCPFastOpen() const override; - virtual bool WasNpnNegotiated() const override; - virtual net::NextProto GetNegotiatedProtocol() const override; - virtual bool GetSSLInfo(net::SSLInfo* ssl_info) override; + int Read(net::IOBuffer* buf, + int buf_len, + const net::CompletionCallback& callback) override; + int Write(net::IOBuffer* buf, + int buf_len, + const net::CompletionCallback& callback) override; + int SetReceiveBufferSize(int32 size) override; + int SetSendBufferSize(int32 size) override; + int Connect(const net::CompletionCallback& callback) override; + void Disconnect() override; + bool IsConnected() const override; + bool IsConnectedAndIdle() const override; + int GetPeerAddress(net::IPEndPoint* address) const override; + int GetLocalAddress(net::IPEndPoint* address) const override; + const net::BoundNetLog& NetLog() const override; + void SetSubresourceSpeculation() override; + void SetOmniboxSpeculation() override; + bool WasEverUsed() const override; + bool UsingTCPFastOpen() const override; + bool WasNpnNegotiated() const override; + net::NextProto GetNegotiatedProtocol() const override; + bool GetSSLInfo(net::SSLInfo* ssl_info) override; private: enum HandshakeState { diff --git a/jingle/glue/proxy_resolving_client_socket.h b/jingle/glue/proxy_resolving_client_socket.h index 27a01c3..86b21a5 100644 --- a/jingle/glue/proxy_resolving_client_socket.h +++ b/jingle/glue/proxy_resolving_client_socket.h @@ -45,29 +45,31 @@ class ProxyResolvingClientSocket : public net::StreamSocket { const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, const net::SSLConfig& ssl_config, const net::HostPortPair& dest_host_port_pair); - virtual ~ProxyResolvingClientSocket(); + ~ProxyResolvingClientSocket() override; // net::StreamSocket implementation. - virtual int Read(net::IOBuffer* buf, int buf_len, - const net::CompletionCallback& callback) override; - virtual int Write(net::IOBuffer* buf, int buf_len, - const net::CompletionCallback& callback) override; - virtual int SetReceiveBufferSize(int32 size) override; - virtual int SetSendBufferSize(int32 size) override; - virtual int Connect(const net::CompletionCallback& callback) override; - virtual void Disconnect() override; - virtual bool IsConnected() const override; - virtual bool IsConnectedAndIdle() const override; - virtual int GetPeerAddress(net::IPEndPoint* address) const override; - virtual int GetLocalAddress(net::IPEndPoint* address) const override; - virtual const net::BoundNetLog& NetLog() const override; - virtual void SetSubresourceSpeculation() override; - virtual void SetOmniboxSpeculation() override; - virtual bool WasEverUsed() const override; - virtual bool UsingTCPFastOpen() const override; - virtual bool WasNpnNegotiated() const override; - virtual net::NextProto GetNegotiatedProtocol() const override; - virtual bool GetSSLInfo(net::SSLInfo* ssl_info) override; + int Read(net::IOBuffer* buf, + int buf_len, + const net::CompletionCallback& callback) override; + int Write(net::IOBuffer* buf, + int buf_len, + const net::CompletionCallback& callback) override; + int SetReceiveBufferSize(int32 size) override; + int SetSendBufferSize(int32 size) override; + int Connect(const net::CompletionCallback& callback) override; + void Disconnect() override; + bool IsConnected() const override; + bool IsConnectedAndIdle() const override; + int GetPeerAddress(net::IPEndPoint* address) const override; + int GetLocalAddress(net::IPEndPoint* address) const override; + const net::BoundNetLog& NetLog() const override; + void SetSubresourceSpeculation() override; + void SetOmniboxSpeculation() override; + bool WasEverUsed() const override; + bool UsingTCPFastOpen() const override; + bool WasNpnNegotiated() const override; + net::NextProto GetNegotiatedProtocol() const override; + bool GetSSLInfo(net::SSLInfo* ssl_info) override; private: // Proxy resolution and connection functions. diff --git a/jingle/glue/proxy_resolving_client_socket_unittest.cc b/jingle/glue/proxy_resolving_client_socket_unittest.cc index cdcbc56..0fda0ff 100644 --- a/jingle/glue/proxy_resolving_client_socket_unittest.cc +++ b/jingle/glue/proxy_resolving_client_socket_unittest.cc @@ -25,7 +25,7 @@ class MyTestURLRequestContext : public net::TestURLRequestContext { "PROXY bad:99; PROXY maybe:80; DIRECT")); Init(); } - virtual ~MyTestURLRequestContext() {} + ~MyTestURLRequestContext() override {} }; } // namespace diff --git a/jingle/glue/pseudotcp_adapter.cc b/jingle/glue/pseudotcp_adapter.cc index 74f3f18..756dbd5 100644 --- a/jingle/glue/pseudotcp_adapter.cc +++ b/jingle/glue/pseudotcp_adapter.cc @@ -38,14 +38,15 @@ class PseudoTcpAdapter::Core : public cricket::IPseudoTcpNotify, // cricket::IPseudoTcpNotify interface. // These notifications are triggered from NotifyPacket. - virtual void OnTcpOpen(cricket::PseudoTcp* tcp) override; - virtual void OnTcpReadable(cricket::PseudoTcp* tcp) override; - virtual void OnTcpWriteable(cricket::PseudoTcp* tcp) override; + void OnTcpOpen(cricket::PseudoTcp* tcp) override; + void OnTcpReadable(cricket::PseudoTcp* tcp) override; + void OnTcpWriteable(cricket::PseudoTcp* tcp) override; // This is triggered by NotifyClock or NotifyPacket. - virtual void OnTcpClosed(cricket::PseudoTcp* tcp, uint32 error) override; + void OnTcpClosed(cricket::PseudoTcp* tcp, uint32 error) override; // This is triggered by NotifyClock, NotifyPacket, Recv and Send. - virtual WriteResult TcpWritePacket(cricket::PseudoTcp* tcp, - const char* buffer, size_t len) override; + WriteResult TcpWritePacket(cricket::PseudoTcp* tcp, + const char* buffer, + size_t len) override; void SetAckDelay(int delay_ms); void SetNoDelay(bool no_delay); @@ -57,7 +58,7 @@ class PseudoTcpAdapter::Core : public cricket::IPseudoTcpNotify, private: friend class base::RefCounted<Core>; - virtual ~Core(); + ~Core() override; // These are invoked by the underlying Socket, and may trigger callbacks. // They hold a reference to |this| while running, to protect from deletion. diff --git a/jingle/glue/pseudotcp_adapter.h b/jingle/glue/pseudotcp_adapter.h index 88ebfc9..36c3fd0 100644 --- a/jingle/glue/pseudotcp_adapter.h +++ b/jingle/glue/pseudotcp_adapter.h @@ -27,31 +27,33 @@ class PseudoTcpAdapter : public net::StreamSocket, base::NonThreadSafe { // Creates an adapter for the supplied Socket. |socket| should already // be ready for use, and ownership of it will be assumed by the adapter. PseudoTcpAdapter(net::Socket* socket); - virtual ~PseudoTcpAdapter(); + ~PseudoTcpAdapter() override; // net::Socket implementation. - virtual int Read(net::IOBuffer* buffer, int buffer_size, - const net::CompletionCallback& callback) override; - virtual int Write(net::IOBuffer* buffer, int buffer_size, - const net::CompletionCallback& callback) override; - virtual int SetReceiveBufferSize(int32 size) override; - virtual int SetSendBufferSize(int32 size) override; + int Read(net::IOBuffer* buffer, + int buffer_size, + const net::CompletionCallback& callback) override; + int Write(net::IOBuffer* buffer, + int buffer_size, + const net::CompletionCallback& callback) override; + int SetReceiveBufferSize(int32 size) override; + int SetSendBufferSize(int32 size) override; // net::StreamSocket implementation. - virtual int Connect(const net::CompletionCallback& callback) override; - virtual void Disconnect() override; - virtual bool IsConnected() const override; - virtual bool IsConnectedAndIdle() const override; - virtual int GetPeerAddress(net::IPEndPoint* address) const override; - virtual int GetLocalAddress(net::IPEndPoint* address) const override; - virtual const net::BoundNetLog& NetLog() const override; - virtual void SetSubresourceSpeculation() override; - virtual void SetOmniboxSpeculation() override; - virtual bool WasEverUsed() const override; - virtual bool UsingTCPFastOpen() const override; - virtual bool WasNpnNegotiated() const override; - virtual net::NextProto GetNegotiatedProtocol() const override; - virtual bool GetSSLInfo(net::SSLInfo* ssl_info) override; + int Connect(const net::CompletionCallback& callback) override; + void Disconnect() override; + bool IsConnected() const override; + bool IsConnectedAndIdle() const override; + int GetPeerAddress(net::IPEndPoint* address) const override; + int GetLocalAddress(net::IPEndPoint* address) const override; + const net::BoundNetLog& NetLog() const override; + void SetSubresourceSpeculation() override; + void SetOmniboxSpeculation() override; + bool WasEverUsed() const override; + bool UsingTCPFastOpen() const override; + bool WasNpnNegotiated() const override; + net::NextProto GetNegotiatedProtocol() const override; + bool GetSSLInfo(net::SSLInfo* ssl_info) override; // Set the delay for sending ACK. void SetAckDelay(int delay_ms); diff --git a/jingle/glue/pseudotcp_adapter_unittest.cc b/jingle/glue/pseudotcp_adapter_unittest.cc index 00070ef..1b2674f 100644 --- a/jingle/glue/pseudotcp_adapter_unittest.cc +++ b/jingle/glue/pseudotcp_adapter_unittest.cc @@ -49,9 +49,9 @@ class LeakyBucket : public RateLimiter { last_update_(base::TimeTicks::HighResNow()) { } - virtual ~LeakyBucket() { } + ~LeakyBucket() override {} - virtual bool DropNextPacket() override { + bool DropNextPacket() override { base::TimeTicks now = base::TimeTicks::HighResNow(); double interval = (now - last_update_).InSecondsF(); last_update_ = now; @@ -78,7 +78,7 @@ class FakeSocket : public net::Socket { : rate_limiter_(NULL), latency_ms_(0) { } - virtual ~FakeSocket() { } + ~FakeSocket() override {} void AppendInputPacket(const std::vector<char>& data) { if (rate_limiter_ && rate_limiter_->DropNextPacket()) @@ -107,8 +107,9 @@ class FakeSocket : public net::Socket { void set_latency(int latency_ms) { latency_ms_ = latency_ms; }; // net::Socket interface. - virtual int Read(net::IOBuffer* buf, int buf_len, - const net::CompletionCallback& callback) override { + int Read(net::IOBuffer* buf, + int buf_len, + const net::CompletionCallback& callback) override { CHECK(read_callback_.is_null()); CHECK(buf); @@ -127,8 +128,9 @@ class FakeSocket : public net::Socket { } } - virtual int Write(net::IOBuffer* buf, int buf_len, - const net::CompletionCallback& callback) override { + int Write(net::IOBuffer* buf, + int buf_len, + const net::CompletionCallback& callback) override { DCHECK(buf); if (peer_socket_) { base::MessageLoop::current()->PostDelayedTask( @@ -142,11 +144,11 @@ class FakeSocket : public net::Socket { return buf_len; } - virtual int SetReceiveBufferSize(int32 size) override { + int SetReceiveBufferSize(int32 size) override { NOTIMPLEMENTED(); return net::ERR_NOT_IMPLEMENTED; } - virtual int SetSendBufferSize(int32 size) override { + int SetSendBufferSize(int32 size) override { NOTIMPLEMENTED(); return net::ERR_NOT_IMPLEMENTED; } diff --git a/jingle/glue/task_pump.h b/jingle/glue/task_pump.h index 0b86707..b102605 100644 --- a/jingle/glue/task_pump.h +++ b/jingle/glue/task_pump.h @@ -17,11 +17,11 @@ class TaskPump : public rtc::TaskRunner, public base::NonThreadSafe { public: TaskPump(); - virtual ~TaskPump(); + ~TaskPump() override; // rtc::TaskRunner implementation. - virtual void WakeTasks() override; - virtual int64 CurrentTime() override; + void WakeTasks() override; + int64 CurrentTime() override; // No tasks will be processed after this is called, even if // WakeTasks() is called. diff --git a/jingle/glue/thread_wrapper.h b/jingle/glue/thread_wrapper.h index 0313bfb..6a045bf 100644 --- a/jingle/glue/thread_wrapper.h +++ b/jingle/glue/thread_wrapper.h @@ -42,7 +42,7 @@ class JingleThreadWrapper : public base::MessageLoop::DestructionObserver, explicit JingleThreadWrapper( scoped_refptr<base::SingleThreadTaskRunner> task_runner); - virtual ~JingleThreadWrapper(); + ~JingleThreadWrapper() override; // Sets whether the thread can be used to send messages // synchronously to another thread using Send() method. Set to false @@ -52,47 +52,44 @@ class JingleThreadWrapper : public base::MessageLoop::DestructionObserver, void set_send_allowed(bool allowed) { send_allowed_ = allowed; } // MessageLoop::DestructionObserver implementation. - virtual void WillDestroyCurrentMessageLoop() override; + void WillDestroyCurrentMessageLoop() override; // rtc::MessageQueue overrides. - virtual void Post(rtc::MessageHandler *phandler, - uint32 id, - rtc::MessageData *pdata, - bool time_sensitive) override; - virtual void PostDelayed(int delay_ms, - rtc::MessageHandler* handler, - uint32 id, - rtc::MessageData* data) override; - virtual void Clear(rtc::MessageHandler* handler, - uint32 id, - rtc::MessageList* removed) override; - virtual void Send(rtc::MessageHandler *handler, - uint32 id, - rtc::MessageData *data) override; + void Post(rtc::MessageHandler* phandler, + uint32 id, + rtc::MessageData* pdata, + bool time_sensitive) override; + void PostDelayed(int delay_ms, + rtc::MessageHandler* handler, + uint32 id, + rtc::MessageData* data) override; + void Clear(rtc::MessageHandler* handler, + uint32 id, + rtc::MessageList* removed) override; + void Send(rtc::MessageHandler* handler, + uint32 id, + rtc::MessageData* data) override; // Following methods are not supported.They are overriden just to // ensure that they are not called (each of them contain NOTREACHED // in the body). Some of this methods can be implemented if it // becomes neccessary to use libjingle code that calls them. - virtual void Quit() override; - virtual bool IsQuitting() override; - virtual void Restart() override; - virtual bool Get(rtc::Message* message, - int delay_ms, - bool process_io) override; - virtual bool Peek(rtc::Message* message, - int delay_ms) override; - virtual void PostAt(uint32 timestamp, - rtc::MessageHandler* handler, - uint32 id, - rtc::MessageData* data) override; - virtual void Dispatch(rtc::Message* message) override; - virtual void ReceiveSends() override; - virtual int GetDelay() override; + void Quit() override; + bool IsQuitting() override; + void Restart() override; + bool Get(rtc::Message* message, int delay_ms, bool process_io) override; + bool Peek(rtc::Message* message, int delay_ms) override; + void PostAt(uint32 timestamp, + rtc::MessageHandler* handler, + uint32 id, + rtc::MessageData* data) override; + void Dispatch(rtc::Message* message) override; + void ReceiveSends() override; + int GetDelay() override; // rtc::Thread overrides. - virtual void Stop() override; - virtual void Run() override; + void Stop() override; + void Run() override; private: typedef std::map<int, rtc::Message> MessagesQueue; diff --git a/jingle/glue/xmpp_client_socket_factory.h b/jingle/glue/xmpp_client_socket_factory.h index 03b2b14..db46afd 100644 --- a/jingle/glue/xmpp_client_socket_factory.h +++ b/jingle/glue/xmpp_client_socket_factory.h @@ -32,13 +32,13 @@ class XmppClientSocketFactory : public ResolvingClientSocketFactory { const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, bool use_fake_ssl_client_socket); - virtual ~XmppClientSocketFactory(); + ~XmppClientSocketFactory() override; // ResolvingClientSocketFactory implementation. - virtual scoped_ptr<net::StreamSocket> CreateTransportClientSocket( + scoped_ptr<net::StreamSocket> CreateTransportClientSocket( const net::HostPortPair& host_and_port) override; - virtual scoped_ptr<net::SSLClientSocket> CreateSSLClientSocket( + scoped_ptr<net::SSLClientSocket> CreateSSLClientSocket( scoped_ptr<net::ClientSocketHandle> transport_socket, const net::HostPortPair& host_and_port) override; diff --git a/jingle/notifier/base/fake_base_task.cc b/jingle/notifier/base/fake_base_task.cc index 510293c..c1805b4 100644 --- a/jingle/notifier/base/fake_base_task.cc +++ b/jingle/notifier/base/fake_base_task.cc @@ -39,11 +39,9 @@ class FakeWeakXmppClient : public notifier::WeakXmppClient { : notifier::WeakXmppClient(parent), jid_("test@example.com/testresource") {} - virtual ~FakeWeakXmppClient() {} + ~FakeWeakXmppClient() override {} - virtual const buzz::Jid& jid() const override { - return jid_; - } + const buzz::Jid& jid() const override { return jid_; } private: buzz::Jid jid_; diff --git a/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc b/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc index 74ff87d..b213095 100644 --- a/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc +++ b/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc @@ -25,9 +25,9 @@ class GaiaCookieMechanism : public buzz::SaslCookieMechanism { : buzz::SaslCookieMechanism( mechanism, username, cookie, token_service) {} - virtual ~GaiaCookieMechanism() {} + ~GaiaCookieMechanism() override {} - virtual buzz::XmlElement* StartSaslAuth() override { + buzz::XmlElement* StartSaslAuth() override { buzz::XmlElement* auth = buzz::SaslCookieMechanism::StartSaslAuth(); // These attributes are necessary for working with non-gmail gaia // accounts. diff --git a/jingle/notifier/base/gaia_token_pre_xmpp_auth.h b/jingle/notifier/base/gaia_token_pre_xmpp_auth.h index 529b4e0..0ff49ff 100644 --- a/jingle/notifier/base/gaia_token_pre_xmpp_auth.h +++ b/jingle/notifier/base/gaia_token_pre_xmpp_auth.h @@ -22,37 +22,38 @@ class GaiaTokenPreXmppAuth : public buzz::PreXmppAuth { const std::string& token_service, const std::string& auth_mechanism); - virtual ~GaiaTokenPreXmppAuth(); + ~GaiaTokenPreXmppAuth() override; // buzz::PreXmppAuth (-buzz::SaslHandler) implementation. We stub // all the methods out as we don't actually do any authentication at // this point. - virtual void StartPreXmppAuth(const buzz::Jid& jid, - const rtc::SocketAddress& server, - const rtc::CryptString& pass, - const std::string& auth_mechanism, - const std::string& auth_token) override; + void StartPreXmppAuth(const buzz::Jid& jid, + const rtc::SocketAddress& server, + const rtc::CryptString& pass, + const std::string& auth_mechanism, + const std::string& auth_token) override; - virtual bool IsAuthDone() const override; + bool IsAuthDone() const override; - virtual bool IsAuthorized() const override; + bool IsAuthorized() const override; - virtual bool HadError() const override; + bool HadError() const override; - virtual int GetError() const override; + int GetError() const override; - virtual buzz::CaptchaChallenge GetCaptchaChallenge() const override; + buzz::CaptchaChallenge GetCaptchaChallenge() const override; - virtual std::string GetAuthToken() const override; + std::string GetAuthToken() const override; - virtual std::string GetAuthMechanism() const override; + std::string GetAuthMechanism() const override; // buzz::SaslHandler implementation. - virtual std::string ChooseBestSaslMechanism( - const std::vector<std::string>& mechanisms, bool encrypted) override; + std::string ChooseBestSaslMechanism( + const std::vector<std::string>& mechanisms, + bool encrypted) override; - virtual buzz::SaslMechanism* CreateSaslMechanism( + buzz::SaslMechanism* CreateSaslMechanism( const std::string& mechanism) override; private: diff --git a/jingle/notifier/base/weak_xmpp_client.h b/jingle/notifier/base/weak_xmpp_client.h index 47c5587..d77903c6 100644 --- a/jingle/notifier/base/weak_xmpp_client.h +++ b/jingle/notifier/base/weak_xmpp_client.h @@ -28,7 +28,7 @@ class WeakXmppClient : public buzz::XmppClient, public base::NonThreadSafe { public: explicit WeakXmppClient(rtc::TaskParent* parent); - virtual ~WeakXmppClient(); + ~WeakXmppClient() override; // Returns a weak pointer that is invalidated when the XmppClient // becomes invalid to use. @@ -40,7 +40,7 @@ class WeakXmppClient : public buzz::XmppClient, public base::NonThreadSafe { void Invalidate(); protected: - virtual void Stop() override; + void Stop() override; private: // We use our own WeakPtrFactory instead of inheriting from diff --git a/jingle/notifier/base/xmpp_connection.h b/jingle/notifier/base/xmpp_connection.h index 5210234..bc75605 100644 --- a/jingle/notifier/base/xmpp_connection.h +++ b/jingle/notifier/base/xmpp_connection.h @@ -77,7 +77,7 @@ class XmppConnection // Invalidates any weak pointers passed to the delegate by // OnConnect(), but does not trigger a call to the delegate's // OnError() function. - virtual ~XmppConnection(); + ~XmppConnection() override; private: void OnStateChange(buzz::XmppEngine::State state); diff --git a/jingle/notifier/communicator/login.h b/jingle/notifier/communicator/login.h index df02cc0..a8646f6 100644 --- a/jingle/notifier/communicator/login.h +++ b/jingle/notifier/communicator/login.h @@ -72,7 +72,7 @@ class Login : public net::NetworkChangeNotifier::IPAddressObserver, const ServerList& servers, bool try_ssltcp_first, const std::string& auth_mechanism); - virtual ~Login(); + ~Login() override; // Starts connecting (or forces a reconnection if we're backed off). void StartConnection(); @@ -83,21 +83,21 @@ class Login : public net::NetworkChangeNotifier::IPAddressObserver, void UpdateXmppSettings(const buzz::XmppClientSettings& user_settings); // net::NetworkChangeNotifier::IPAddressObserver implementation. - virtual void OnIPAddressChanged() override; + void OnIPAddressChanged() override; // net::NetworkChangeNotifier::ConnectionTypeObserver implementation. - virtual void OnConnectionTypeChanged( + void OnConnectionTypeChanged( net::NetworkChangeNotifier::ConnectionType type) override; // net::NetworkChangeNotifier::DNSObserver implementation. - virtual void OnDNSChanged() override; + void OnDNSChanged() override; // SingleLoginAttempt::Delegate implementation. - virtual void OnConnect( + void OnConnect( base::WeakPtr<buzz::XmppTaskParentInterface> base_task) override; - virtual void OnRedirect(const ServerInformation& redirect_server) override; - virtual void OnCredentialsRejected() override; - virtual void OnSettingsExhausted() override; + void OnRedirect(const ServerInformation& redirect_server) override; + void OnCredentialsRejected() override; + void OnSettingsExhausted() override; private: // Called by the various network notifications. diff --git a/jingle/notifier/communicator/single_login_attempt.h b/jingle/notifier/communicator/single_login_attempt.h index 7c877cb..5480e3c 100644 --- a/jingle/notifier/communicator/single_login_attempt.h +++ b/jingle/notifier/communicator/single_login_attempt.h @@ -57,14 +57,13 @@ class SingleLoginAttempt : public XmppConnection::Delegate { // Does not take ownership of |delegate|, which must not be NULL. SingleLoginAttempt(const LoginSettings& login_settings, Delegate* delegate); - virtual ~SingleLoginAttempt(); + ~SingleLoginAttempt() override; // XmppConnection::Delegate implementation. - virtual void OnConnect( - base::WeakPtr<buzz::XmppTaskParentInterface> parent) override; - virtual void OnError(buzz::XmppEngine::Error error, - int error_subcode, - const buzz::XmlElement* stream_error) override; + void OnConnect(base::WeakPtr<buzz::XmppTaskParentInterface> parent) override; + void OnError(buzz::XmppEngine::Error error, + int error_subcode, + const buzz::XmlElement* stream_error) override; private: void TryConnect(const ConnectionSettings& new_settings); diff --git a/jingle/notifier/communicator/single_login_attempt_unittest.cc b/jingle/notifier/communicator/single_login_attempt_unittest.cc index 281ae0d..2a9b5af 100644 --- a/jingle/notifier/communicator/single_login_attempt_unittest.cc +++ b/jingle/notifier/communicator/single_login_attempt_unittest.cc @@ -35,24 +35,20 @@ class FakeDelegate : public SingleLoginAttempt::Delegate { public: FakeDelegate() : state_(IDLE) {} - virtual void OnConnect( + void OnConnect( base::WeakPtr<buzz::XmppTaskParentInterface> base_task) override { state_ = CONNECTED; base_task_ = base_task; } - virtual void OnRedirect(const ServerInformation& redirect_server) override { + void OnRedirect(const ServerInformation& redirect_server) override { state_ = REDIRECTED; redirect_server_ = redirect_server; } - virtual void OnCredentialsRejected() override { - state_ = CREDENTIALS_REJECTED; - } + void OnCredentialsRejected() override { state_ = CREDENTIALS_REJECTED; } - virtual void OnSettingsExhausted() override { - state_ = SETTINGS_EXHAUSTED; - } + void OnSettingsExhausted() override { state_ = SETTINGS_EXHAUSTED; } DelegateState state() const { return state_; } @@ -77,7 +73,7 @@ class MyTestURLRequestContext : public net::TestURLRequestContext { scoped_ptr<net::HostResolver>(new net::HangingHostResolver())); Init(); } - virtual ~MyTestURLRequestContext() {} + ~MyTestURLRequestContext() override {} }; class SingleLoginAttemptTest : public ::testing::Test { diff --git a/jingle/notifier/listener/fake_push_client.h b/jingle/notifier/listener/fake_push_client.h index c97d397..3c12f51 100644 --- a/jingle/notifier/listener/fake_push_client.h +++ b/jingle/notifier/listener/fake_push_client.h @@ -19,17 +19,16 @@ namespace notifier { class FakePushClient : public PushClient { public: FakePushClient(); - virtual ~FakePushClient(); + ~FakePushClient() override; // PushClient implementation. - virtual void AddObserver(PushClientObserver* observer) override; - virtual void RemoveObserver(PushClientObserver* observer) override; - virtual void UpdateSubscriptions( - const SubscriptionList& subscriptions) override; - virtual void UpdateCredentials( - const std::string& email, const std::string& token) override; - virtual void SendNotification(const Notification& notification) override; - virtual void SendPing() override; + void AddObserver(PushClientObserver* observer) override; + void RemoveObserver(PushClientObserver* observer) override; + void UpdateSubscriptions(const SubscriptionList& subscriptions) override; + void UpdateCredentials(const std::string& email, + const std::string& token) override; + void SendNotification(const Notification& notification) override; + void SendPing() override; // Triggers OnNotificationsEnabled on all observers. void EnableNotifications(); diff --git a/jingle/notifier/listener/fake_push_client_observer.h b/jingle/notifier/listener/fake_push_client_observer.h index 2460e37..eba26117 100644 --- a/jingle/notifier/listener/fake_push_client_observer.h +++ b/jingle/notifier/listener/fake_push_client_observer.h @@ -14,14 +14,12 @@ namespace notifier { class FakePushClientObserver : public PushClientObserver { public: FakePushClientObserver(); - virtual ~FakePushClientObserver(); + ~FakePushClientObserver() override; // PushClientObserver implementation. - virtual void OnNotificationsEnabled() override; - virtual void OnNotificationsDisabled( - NotificationsDisabledReason reason) override; - virtual void OnIncomingNotification( - const Notification& notification) override; + void OnNotificationsEnabled() override; + void OnNotificationsDisabled(NotificationsDisabledReason reason) override; + void OnIncomingNotification(const Notification& notification) override; NotificationsDisabledReason last_notifications_disabled_reason() const; const Notification& last_incoming_notification() const; diff --git a/jingle/notifier/listener/non_blocking_push_client.cc b/jingle/notifier/listener/non_blocking_push_client.cc index e2a10b7..97b0cca 100644 --- a/jingle/notifier/listener/non_blocking_push_client.cc +++ b/jingle/notifier/listener/non_blocking_push_client.cc @@ -40,18 +40,16 @@ class NonBlockingPushClient::Core void SendNotification(const Notification& data); void SendPing(); - virtual void OnNotificationsEnabled() override; - virtual void OnNotificationsDisabled( - NotificationsDisabledReason reason) override; - virtual void OnIncomingNotification( - const Notification& notification) override; - virtual void OnPingResponse() override; + void OnNotificationsEnabled() override; + void OnNotificationsDisabled(NotificationsDisabledReason reason) override; + void OnIncomingNotification(const Notification& notification) override; + void OnPingResponse() override; private: friend class base::RefCountedThreadSafe<NonBlockingPushClient::Core>; // Called on either the parent thread or the delegate thread. - virtual ~Core(); + ~Core() override; const scoped_refptr<base::SingleThreadTaskRunner> parent_task_runner_; const scoped_refptr<base::SingleThreadTaskRunner> delegate_task_runner_; diff --git a/jingle/notifier/listener/non_blocking_push_client.h b/jingle/notifier/listener/non_blocking_push_client.h index 17dba05..27e07fb 100644 --- a/jingle/notifier/listener/non_blocking_push_client.h +++ b/jingle/notifier/listener/non_blocking_push_client.h @@ -39,17 +39,16 @@ class NonBlockingPushClient : public PushClient { const scoped_refptr<base::SingleThreadTaskRunner>& delegate_task_runner, const CreateBlockingPushClientCallback& create_blocking_push_client_callback); - virtual ~NonBlockingPushClient(); + ~NonBlockingPushClient() override; // PushClient implementation. - virtual void AddObserver(PushClientObserver* observer) override; - virtual void RemoveObserver(PushClientObserver* observer) override; - virtual void UpdateSubscriptions( - const SubscriptionList& subscriptions) override; - virtual void UpdateCredentials( - const std::string& email, const std::string& token) override; - virtual void SendNotification(const Notification& notification) override; - virtual void SendPing() override; + void AddObserver(PushClientObserver* observer) override; + void RemoveObserver(PushClientObserver* observer) override; + void UpdateSubscriptions(const SubscriptionList& subscriptions) override; + void UpdateCredentials(const std::string& email, + const std::string& token) override; + void SendNotification(const Notification& notification) override; + void SendPing() override; private: class Core; diff --git a/jingle/notifier/listener/push_notifications_listen_task.h b/jingle/notifier/listener/push_notifications_listen_task.h index 659a946..7efd95c 100644 --- a/jingle/notifier/listener/push_notifications_listen_task.h +++ b/jingle/notifier/listener/push_notifications_listen_task.h @@ -36,12 +36,12 @@ class PushNotificationsListenTask : public buzz::XmppTask { PushNotificationsListenTask(buzz::XmppTaskParentInterface* parent, Delegate* delegate); - virtual ~PushNotificationsListenTask(); + ~PushNotificationsListenTask() override; // Overriden from buzz::XmppTask. - virtual int ProcessStart() override; - virtual int ProcessResponse() override; - virtual bool HandleStanza(const buzz::XmlElement* stanza) override; + int ProcessStart() override; + int ProcessResponse() override; + bool HandleStanza(const buzz::XmlElement* stanza) override; private: bool IsValidNotification(const buzz::XmlElement* stanza); diff --git a/jingle/notifier/listener/push_notifications_send_update_task.h b/jingle/notifier/listener/push_notifications_send_update_task.h index 287705b5..773e2bc 100644 --- a/jingle/notifier/listener/push_notifications_send_update_task.h +++ b/jingle/notifier/listener/push_notifications_send_update_task.h @@ -24,10 +24,10 @@ class PushNotificationsSendUpdateTask : public buzz::XmppTask { public: PushNotificationsSendUpdateTask( buzz::XmppTaskParentInterface* parent, const Notification& notification); - virtual ~PushNotificationsSendUpdateTask(); + ~PushNotificationsSendUpdateTask() override; // Overridden from buzz::XmppTask. - virtual int ProcessStart() override; + int ProcessStart() override; private: // Allocates and constructs an buzz::XmlElement containing the update stanza. diff --git a/jingle/notifier/listener/push_notifications_subscribe_task.h b/jingle/notifier/listener/push_notifications_subscribe_task.h index 7580124..75ee9e1 100644 --- a/jingle/notifier/listener/push_notifications_subscribe_task.h +++ b/jingle/notifier/listener/push_notifications_subscribe_task.h @@ -29,12 +29,12 @@ class PushNotificationsSubscribeTask : public buzz::XmppTask { PushNotificationsSubscribeTask(buzz::XmppTaskParentInterface* parent, const SubscriptionList& subscriptions, Delegate* delegate); - virtual ~PushNotificationsSubscribeTask(); + ~PushNotificationsSubscribeTask() override; // Overridden from XmppTask. - virtual int ProcessStart() override; - virtual int ProcessResponse() override; - virtual bool HandleStanza(const buzz::XmlElement* stanza) override; + int ProcessStart() override; + int ProcessResponse() override; + bool HandleStanza(const buzz::XmlElement* stanza) override; private: // Assembles an Xmpp stanza which can be sent to subscribe to notifications. diff --git a/jingle/notifier/listener/send_ping_task.h b/jingle/notifier/listener/send_ping_task.h index ac4fa20..feccb17 100644 --- a/jingle/notifier/listener/send_ping_task.h +++ b/jingle/notifier/listener/send_ping_task.h @@ -29,12 +29,12 @@ class SendPingTask : public buzz::XmppTask { }; SendPingTask(buzz::XmppTaskParentInterface* parent, Delegate* delegate); - virtual ~SendPingTask(); + ~SendPingTask() override; // Overridden from buzz::XmppTask. - virtual int ProcessStart() override; - virtual int ProcessResponse() override; - virtual bool HandleStanza(const buzz::XmlElement* stanza) override; + int ProcessStart() override; + int ProcessResponse() override; + bool HandleStanza(const buzz::XmlElement* stanza) override; private: static buzz::XmlElement* MakePingStanza(const std::string& task_id); diff --git a/jingle/notifier/listener/xmpp_push_client.h b/jingle/notifier/listener/xmpp_push_client.h index 4c6fea5..dbbd468 100644 --- a/jingle/notifier/listener/xmpp_push_client.h +++ b/jingle/notifier/listener/xmpp_push_client.h @@ -41,34 +41,32 @@ class XmppPushClient : public SendPingTaskDelegate { public: explicit XmppPushClient(const NotifierOptions& notifier_options); - virtual ~XmppPushClient(); + ~XmppPushClient() override; // PushClient implementation. - virtual void AddObserver(PushClientObserver* observer) override; - virtual void RemoveObserver(PushClientObserver* observer) override; - virtual void UpdateSubscriptions( - const SubscriptionList& subscriptions) override; - virtual void UpdateCredentials( - const std::string& email, const std::string& token) override; - virtual void SendNotification(const Notification& notification) override; - virtual void SendPing() override; + void AddObserver(PushClientObserver* observer) override; + void RemoveObserver(PushClientObserver* observer) override; + void UpdateSubscriptions(const SubscriptionList& subscriptions) override; + void UpdateCredentials(const std::string& email, + const std::string& token) override; + void SendNotification(const Notification& notification) override; + void SendPing() override; // Login::Delegate implementation. - virtual void OnConnect( + void OnConnect( base::WeakPtr<buzz::XmppTaskParentInterface> base_task) override; - virtual void OnTransientDisconnection() override; - virtual void OnCredentialsRejected() override; + void OnTransientDisconnection() override; + void OnCredentialsRejected() override; // PushNotificationsListenTaskDelegate implementation. - virtual void OnNotificationReceived( - const Notification& notification) override; + void OnNotificationReceived(const Notification& notification) override; // PushNotificationsSubscribeTaskDelegate implementation. - virtual void OnSubscribed() override; - virtual void OnSubscriptionError() override; + void OnSubscribed() override; + void OnSubscriptionError() override; // SendPingTaskDelegate implementation. - virtual void OnPingResponseReceived() override; + void OnPingResponseReceived() override; private: base::ThreadChecker thread_checker_; |