diff options
author | dcheng <dcheng@chromium.org> | 2014-12-22 15:11:30 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-22 23:12:34 +0000 |
commit | a4ebdc4840d05c49bfe406a10f755c5374aa1339 (patch) | |
tree | 2ee5932aeaefdca7c3c2cbecf3248c1c1d59efb8 /jingle | |
parent | 40b4fa47b9288a0c262ecd3730e70bd4bb44576b (diff) | |
download | chromium_src-a4ebdc4840d05c49bfe406a10f755c5374aa1339.zip chromium_src-a4ebdc4840d05c49bfe406a10f755c5374aa1339.tar.gz chromium_src-a4ebdc4840d05c49bfe406a10f755c5374aa1339.tar.bz2 |
Standardize usage of virtual/override/final specifiers in jingle/.
The Google C++ style guide states:
Explicitly annotate overrides of virtual functions or virtual
destructors with an override or (less frequently) final specifier.
Older (pre-C++11) code will use the virtual keyword as an inferior
alternative annotation. For clarity, use exactly one of override,
final, or virtual when declaring an override.
To better conform to these guidelines, the following constructs have
been rewritten:
- if a base class has a virtual destructor, then:
virtual ~Foo(); -> ~Foo() override;
- virtual void Foo() override; -> void Foo() override;
- virtual void Foo() override final; -> void Foo() final;
This patch was automatically generated. The clang plugin can generate
fixit hints, which are suggested edits when it is 100% sure it knows how
to fix a problem. The hints from the clang plugin were applied to the
source tree using the tool in https://codereview.chromium.org/598073004.
Several formatting edits by clang-format were manually reverted, due to
mangling of some of the more complicate IPC macros.
BUG=417463
Review URL: https://codereview.chromium.org/822833002
Cr-Commit-Position: refs/heads/master@{#309482}
Diffstat (limited to 'jingle')
11 files changed, 18 insertions, 20 deletions
diff --git a/jingle/glue/channel_socket_adapter_unittest.cc b/jingle/glue/channel_socket_adapter_unittest.cc index 7c12f0d..e080449 100644 --- a/jingle/glue/channel_socket_adapter_unittest.cc +++ b/jingle/glue/channel_socket_adapter_unittest.cc @@ -66,7 +66,7 @@ class TransportChannelSocketAdapterTest : public testing::Test { } protected: - virtual void SetUp() { + void SetUp() override { target_.reset(new TransportChannelSocketAdapter(&channel_)); } diff --git a/jingle/glue/chrome_async_socket_unittest.cc b/jingle/glue/chrome_async_socket_unittest.cc index 4449d38..4742712 100644 --- a/jingle/glue/chrome_async_socket_unittest.cc +++ b/jingle/glue/chrome_async_socket_unittest.cc @@ -154,9 +154,9 @@ class ChromeAsyncSocketTest message_loop_.reset(new base::MessageLoop(pump.Pass())); } - virtual ~ChromeAsyncSocketTest() {} + ~ChromeAsyncSocketTest() override {} - virtual void SetUp() { + void SetUp() override { scoped_ptr<net::MockClientSocketFactory> mock_client_socket_factory( new net::MockClientSocketFactory()); mock_client_socket_factory->AddSocketDataProvider( @@ -189,7 +189,7 @@ class ChromeAsyncSocketTest this, &ChromeAsyncSocketTest::OnError); } - virtual void TearDown() { + void TearDown() override { // Run any tasks that we forgot to pump. message_loop_->RunUntilIdle(); ExpectClosed(); diff --git a/jingle/glue/fake_ssl_client_socket_unittest.cc b/jingle/glue/fake_ssl_client_socket_unittest.cc index 3a9a5cf..3099f8e 100644 --- a/jingle/glue/fake_ssl_client_socket_unittest.cc +++ b/jingle/glue/fake_ssl_client_socket_unittest.cc @@ -89,7 +89,7 @@ class FakeSSLClientSocketTest : public testing::Test { protected: FakeSSLClientSocketTest() {} - virtual ~FakeSSLClientSocketTest() {} + ~FakeSSLClientSocketTest() override {} scoped_ptr<net::StreamSocket> MakeClientSocket() { return mock_client_socket_factory_.CreateTransportClientSocket( diff --git a/jingle/glue/proxy_resolving_client_socket_unittest.cc b/jingle/glue/proxy_resolving_client_socket_unittest.cc index 0fda0ff..2ba81b2 100644 --- a/jingle/glue/proxy_resolving_client_socket_unittest.cc +++ b/jingle/glue/proxy_resolving_client_socket_unittest.cc @@ -40,9 +40,9 @@ class ProxyResolvingClientSocketTest : public testing::Test { scoped_ptr<net::TestURLRequestContext>( new MyTestURLRequestContext))) {} - virtual ~ProxyResolvingClientSocketTest() {} + ~ProxyResolvingClientSocketTest() override {} - virtual void TearDown() { + void TearDown() override { // Clear out any messages posted by ProxyResolvingClientSocket's // destructor. message_loop_.RunUntilIdle(); diff --git a/jingle/glue/pseudotcp_adapter_unittest.cc b/jingle/glue/pseudotcp_adapter_unittest.cc index 1b2674f..ef031a9 100644 --- a/jingle/glue/pseudotcp_adapter_unittest.cc +++ b/jingle/glue/pseudotcp_adapter_unittest.cc @@ -300,7 +300,7 @@ class TCPChannelTester : public base::RefCountedThreadSafe<TCPChannelTester> { class PseudoTcpAdapterTest : public testing::Test { protected: - virtual void SetUp() override { + void SetUp() override { JingleThreadWrapper::EnsureForCurrentMessageLoop(); host_socket_ = new FakeSocket(); diff --git a/jingle/glue/thread_wrapper_unittest.cc b/jingle/glue/thread_wrapper_unittest.cc index bca6c64..2aa7aca 100644 --- a/jingle/glue/thread_wrapper_unittest.cc +++ b/jingle/glue/thread_wrapper_unittest.cc @@ -80,7 +80,7 @@ class ThreadWrapperTest : public testing::Test { : thread_(NULL) { } - virtual void SetUp() override { + void SetUp() override { JingleThreadWrapper::EnsureForCurrentMessageLoop(); thread_ = rtc::Thread::Current(); } diff --git a/jingle/notifier/base/weak_xmpp_client_unittest.cc b/jingle/notifier/base/weak_xmpp_client_unittest.cc index a4c9c7b..a9bfd35 100644 --- a/jingle/notifier/base/weak_xmpp_client_unittest.cc +++ b/jingle/notifier/base/weak_xmpp_client_unittest.cc @@ -34,7 +34,7 @@ class WeakXmppClientTest : public testing::Test { protected: WeakXmppClientTest() : task_pump_(new jingle_glue::TaskPump()) {} - virtual ~WeakXmppClientTest() {} + ~WeakXmppClientTest() override {} void ConnectSignals(buzz::XmppClient* xmpp_client) { xmpp_client->SignalStateChange.connect( diff --git a/jingle/notifier/base/xmpp_connection_unittest.cc b/jingle/notifier/base/xmpp_connection_unittest.cc index 2e62092..147edac 100644 --- a/jingle/notifier/base/xmpp_connection_unittest.cc +++ b/jingle/notifier/base/xmpp_connection_unittest.cc @@ -83,9 +83,9 @@ class XmppConnectionTest : public testing::Test { message_loop_->message_loop_proxy()); } - virtual ~XmppConnectionTest() {} + ~XmppConnectionTest() override {} - virtual void TearDown() { + void TearDown() override { // Clear out any messages posted by XmppConnection's destructor. message_loop_->RunUntilIdle(); } diff --git a/jingle/notifier/communicator/single_login_attempt_unittest.cc b/jingle/notifier/communicator/single_login_attempt_unittest.cc index d5b7418..d791f4a 100644 --- a/jingle/notifier/communicator/single_login_attempt_unittest.cc +++ b/jingle/notifier/communicator/single_login_attempt_unittest.cc @@ -93,15 +93,13 @@ class SingleLoginAttemptTest : public ::testing::Test { "auth_mechanism"), attempt_(new SingleLoginAttempt(login_settings_, &fake_delegate_)) {} - virtual void TearDown() override { - message_loop_.RunUntilIdle(); - } + void TearDown() override { message_loop_.RunUntilIdle(); } void FireRedirect(buzz::XmlElement* redirect_error) { attempt_->OnError(buzz::XmppEngine::ERROR_STREAM, 0, redirect_error); } - virtual ~SingleLoginAttemptTest() { + ~SingleLoginAttemptTest() override { attempt_.reset(); message_loop_.RunUntilIdle(); } diff --git a/jingle/notifier/listener/non_blocking_push_client_unittest.cc b/jingle/notifier/listener/non_blocking_push_client_unittest.cc index 0066aa9..8b7dac52 100644 --- a/jingle/notifier/listener/non_blocking_push_client_unittest.cc +++ b/jingle/notifier/listener/non_blocking_push_client_unittest.cc @@ -24,9 +24,9 @@ class NonBlockingPushClientTest : public testing::Test { protected: NonBlockingPushClientTest() : fake_push_client_(NULL) {} - virtual ~NonBlockingPushClientTest() {} + ~NonBlockingPushClientTest() override {} - virtual void SetUp() override { + void SetUp() override { push_client_.reset( new NonBlockingPushClient( base::MessageLoopProxy::current(), @@ -37,7 +37,7 @@ class NonBlockingPushClientTest : public testing::Test { message_loop_.RunUntilIdle(); } - virtual void TearDown() override { + void TearDown() override { // Clear out any pending notifications before removing observers. message_loop_.RunUntilIdle(); push_client_->RemoveObserver(&fake_observer_); diff --git a/jingle/notifier/listener/push_client_unittest.cc b/jingle/notifier/listener/push_client_unittest.cc index 0357cf2..5296663 100644 --- a/jingle/notifier/listener/push_client_unittest.cc +++ b/jingle/notifier/listener/push_client_unittest.cc @@ -26,7 +26,7 @@ class PushClientTest : public testing::Test { message_loop_.message_loop_proxy()); } - virtual ~PushClientTest() {} + ~PushClientTest() override {} // The sockets created by the XMPP code expect an IO loop. base::MessageLoopForIO message_loop_; |