diff options
author | dcheng <dcheng@chromium.org> | 2014-10-27 14:43:14 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-27 21:43:44 +0000 |
commit | f9afb370f94e325015aa8633135474f87aa5eb76 (patch) | |
tree | 4688f718dc5af753297b11f3e765c08e248a3098 | |
parent | 1d5884e1c15b36604a9c9f9376d18cb91f345f47 (diff) | |
download | chromium_src-f9afb370f94e325015aa8633135474f87aa5eb76.zip chromium_src-f9afb370f94e325015aa8633135474f87aa5eb76.tar.gz chromium_src-f9afb370f94e325015aa8633135474f87aa5eb76.tar.bz2 |
Standardize usage of virtual/override/final specifiers.
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.
BUG=417463
R=jyasskin@chromium.org
Review URL: https://codereview.chromium.org/685503002
Cr-Commit-Position: refs/heads/master@{#301450}
47 files changed, 154 insertions, 167 deletions
diff --git a/extensions/browser/api/bluetooth/bluetooth_event_router_unittest.cc b/extensions/browser/api/bluetooth/bluetooth_event_router_unittest.cc index 7229f1c..7f5a412 100644 --- a/extensions/browser/api/bluetooth/bluetooth_event_router_unittest.cc +++ b/extensions/browser/api/bluetooth/bluetooth_event_router_unittest.cc @@ -43,7 +43,7 @@ class BluetoothEventRouterTest : public ExtensionsTest { router_->SetAdapterForTest(mock_adapter_); } - virtual void TearDown() override { + void TearDown() override { // It's important to destroy the router before the browser context keyed // services so it removes itself as an ExtensionRegistry observer. router_.reset(NULL); diff --git a/extensions/browser/api/bluetooth/bluetooth_private_apitest.cc b/extensions/browser/api/bluetooth/bluetooth_private_apitest.cc index 148715d..1fad1d4 100644 --- a/extensions/browser/api/bluetooth/bluetooth_private_apitest.cc +++ b/extensions/browser/api/bluetooth/bluetooth_private_apitest.cc @@ -44,7 +44,7 @@ class BluetoothPrivateApiTest : public ExtensionApiTest { adapter_powered_(false), adapter_discoverable_(false) {} - virtual ~BluetoothPrivateApiTest() {} + ~BluetoothPrivateApiTest() override {} void SetUpOnMainThread() override { CommandLine::ForCurrentProcess()->AppendSwitchASCII( diff --git a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc index c34399c..d300dfa 100644 --- a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc +++ b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc @@ -93,7 +93,7 @@ class BluetoothLowEnergyApiTest : public ExtensionApiTest { public: BluetoothLowEnergyApiTest() {} - virtual ~BluetoothLowEnergyApiTest() {} + ~BluetoothLowEnergyApiTest() override {} void SetUpOnMainThread() override { ExtensionApiTest::SetUpOnMainThread(); diff --git a/extensions/browser/api/cast_channel/cast_framer_unittest.cc b/extensions/browser/api/cast_channel/cast_framer_unittest.cc index 53ed747..11f07c6f 100644 --- a/extensions/browser/api/cast_channel/cast_framer_unittest.cc +++ b/extensions/browser/api/cast_channel/cast_framer_unittest.cc @@ -15,9 +15,9 @@ namespace cast_channel { class CastFramerTest : public testing::Test { public: CastFramerTest() {} - virtual ~CastFramerTest() {} + ~CastFramerTest() override {} - virtual void SetUp() override { + void SetUp() override { cast_message_.set_protocol_version(CastMessage::CASTV2_1_0); cast_message_.set_source_id("source"); cast_message_.set_destination_id("destination"); diff --git a/extensions/browser/api/cast_channel/cast_socket_unittest.cc b/extensions/browser/api/cast_channel/cast_socket_unittest.cc index f31a98a..ba3a767 100644 --- a/extensions/browser/api/cast_channel/cast_socket_unittest.cc +++ b/extensions/browser/api/cast_channel/cast_socket_unittest.cc @@ -349,9 +349,9 @@ class CastSocketTest : public testing::Test { : logger_(new Logger( scoped_ptr<base::TickClock>(new base::SimpleTestTickClock), base::TimeTicks())) {} - virtual ~CastSocketTest() {} + ~CastSocketTest() override {} - virtual void SetUp() override { + void SetUp() override { // Create a few test messages for (size_t i = 0; i < arraysize(test_messages_); i++) { CreateStringMessage("urn:cast", "1", "2", kTestData[i], @@ -363,7 +363,7 @@ class CastSocketTest : public testing::Test { } } - virtual void TearDown() override { + void TearDown() override { if (socket_.get()) { EXPECT_CALL(handler_, OnCloseComplete(net::OK)); socket_->Close(base::Bind(&CompleteHandler::OnCloseComplete, diff --git a/extensions/browser/api/cast_channel/cast_transport_unittest.cc b/extensions/browser/api/cast_channel/cast_transport_unittest.cc index d66795e..fa2760d 100644 --- a/extensions/browser/api/cast_channel/cast_transport_unittest.cc +++ b/extensions/browser/api/cast_channel/cast_transport_unittest.cc @@ -180,7 +180,7 @@ class CastTransportTest : public testing::Test { base::TimeTicks())) { transport_.reset(new CastTransport(&mock_socket_, &delegate_, logger_)); } - virtual ~CastTransportTest() {} + ~CastTransportTest() override {} protected: MockCastTransportDelegate delegate_; diff --git a/extensions/browser/api/cast_channel/logger_unittest.cc b/extensions/browser/api/cast_channel/logger_unittest.cc index 260c72e..35bb819 100644 --- a/extensions/browser/api/cast_channel/logger_unittest.cc +++ b/extensions/browser/api/cast_channel/logger_unittest.cc @@ -30,7 +30,7 @@ class CastChannelLoggerTest : public testing::Test { : clock_(new base::SimpleTestTickClock), logger_(new Logger(scoped_ptr<base::TickClock>(clock_), base::TimeTicks())) {} - virtual ~CastChannelLoggerTest() {} + ~CastChannelLoggerTest() override {} bool Uncompress(const char* input, int length, std::string* output) { z_stream stream = {0}; diff --git a/extensions/browser/api/device_permissions_manager.h b/extensions/browser/api/device_permissions_manager.h index dea9b13..a64325a 100644 --- a/extensions/browser/api/device_permissions_manager.h +++ b/extensions/browser/api/device_permissions_manager.h @@ -142,7 +142,7 @@ class DevicePermissionsManagerFactory // BrowserContextKeyedServiceFactory KeyedService* BuildServiceInstanceFor( content::BrowserContext* context) const override; - virtual content::BrowserContext* GetBrowserContextToUse( + content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; DISALLOW_COPY_AND_ASSIGN(DevicePermissionsManagerFactory); diff --git a/extensions/browser/api/dns/dns_apitest.cc b/extensions/browser/api/dns/dns_apitest.cc index 5d62017..24586f9 100644 --- a/extensions/browser/api/dns/dns_apitest.cc +++ b/extensions/browser/api/dns/dns_apitest.cc @@ -26,13 +26,13 @@ class DnsApiTest : public ShellApiTest { DnsApiTest() : resolver_creator_(new MockHostResolverCreator()) {} private: - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { ShellApiTest::SetUpOnMainThread(); HostResolverWrapper::GetInstance()->SetHostResolverForTesting( resolver_creator_->CreateMockHostResolver()); } - virtual void TearDownOnMainThread() override { + void TearDownOnMainThread() override { HostResolverWrapper::GetInstance()->SetHostResolverForTesting(NULL); resolver_creator_->DeleteMockHostResolver(); ShellApiTest::TearDownOnMainThread(); diff --git a/extensions/browser/api/power/power_api_unittest.cc b/extensions/browser/api/power/power_api_unittest.cc index af44d30..3e7d8d4 100644 --- a/extensions/browser/api/power/power_api_unittest.cc +++ b/extensions/browser/api/power/power_api_unittest.cc @@ -128,12 +128,12 @@ class PowerSaveBlockerStubManager { class PowerApiTest : public ApiUnitTest { public: - virtual void SetUp() override { + void SetUp() override { ApiUnitTest::SetUp(); manager_.reset(new PowerSaveBlockerStubManager(browser_context())); } - virtual void TearDown() override { + void TearDown() override { manager_.reset(); ApiUnitTest::TearDown(); } diff --git a/extensions/browser/api/sockets_tcp/sockets_tcp_api_unittest.cc b/extensions/browser/api/sockets_tcp/sockets_tcp_api_unittest.cc index ff816dd..de1afc3 100644 --- a/extensions/browser/api/sockets_tcp/sockets_tcp_api_unittest.cc +++ b/extensions/browser/api/sockets_tcp/sockets_tcp_api_unittest.cc @@ -25,7 +25,7 @@ static KeyedService* ApiResourceManagerTestFactory( class SocketsTcpUnitTest : public ApiUnitTest { public: - virtual void SetUp() { + void SetUp() override { ApiUnitTest::SetUp(); ApiResourceManager<ResumableTCPSocket>::GetFactoryInstance() diff --git a/extensions/browser/api/storage/settings_quota_unittest.cc b/extensions/browser/api/storage/settings_quota_unittest.cc index d06df98..391043e 100644 --- a/extensions/browser/api/storage/settings_quota_unittest.cc +++ b/extensions/browser/api/storage/settings_quota_unittest.cc @@ -44,9 +44,7 @@ class ExtensionSettingsQuotaTest : public testing::Test { ASSERT_EQ(256u, validate_sizes.size()); } - virtual void TearDown() override { - ASSERT_TRUE(storage_.get() != NULL); - } + void TearDown() override { ASSERT_TRUE(storage_.get() != NULL); } protected: // Creates |storage_|. Must only be called once. diff --git a/extensions/browser/api/storage/storage_api_unittest.cc b/extensions/browser/api/storage/storage_api_unittest.cc index c902b3c..272396c 100644 --- a/extensions/browser/api/storage/storage_api_unittest.cc +++ b/extensions/browser/api/storage/storage_api_unittest.cc @@ -43,7 +43,7 @@ class StorageApiUnittest : public ApiUnitTest { public: StorageApiUnittest() {} - virtual void SetUp() override { + void SetUp() override { ApiUnitTest::SetUp(); extensions_browser_client()->set_extension_system_factory( &extension_system_factory_); diff --git a/extensions/browser/api/storage/storage_frontend_unittest.cc b/extensions/browser/api/storage/storage_frontend_unittest.cc index 4f5b65e..b292244 100644 --- a/extensions/browser/api/storage/storage_frontend_unittest.cc +++ b/extensions/browser/api/storage/storage_frontend_unittest.cc @@ -44,13 +44,13 @@ class ExtensionSettingsFrontendTest : public ExtensionsTest { ui_thread_(BrowserThread::UI, base::MessageLoop::current()), file_thread_(BrowserThread::FILE, base::MessageLoop::current()) {} - virtual void SetUp() override { + void SetUp() override { ExtensionsTest::SetUp(); ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); ResetFrontend(); } - virtual void TearDown() override { + void TearDown() override { frontend_.reset(); // Execute any pending deletion tasks. message_loop_.RunUntilIdle(); diff --git a/extensions/browser/api_unittest.h b/extensions/browser/api_unittest.h index f5473bf..2b1c468 100644 --- a/extensions/browser/api_unittest.h +++ b/extensions/browser/api_unittest.h @@ -37,7 +37,7 @@ namespace extensions { class ApiUnitTest : public ExtensionsTest { public: ApiUnitTest(); - virtual ~ApiUnitTest(); + ~ApiUnitTest() override; const Extension* extension() const { return extension_.get(); } scoped_refptr<Extension> extension_ref() { return extension_; } @@ -47,7 +47,7 @@ class ApiUnitTest : public ExtensionsTest { protected: // SetUp creates and loads an empty, unpacked Extension. - virtual void SetUp() override; + void SetUp() override; // Various ways of running an API function. These methods take ownership of // |function|. |args| should be in JSON format, wrapped in a list. diff --git a/extensions/browser/app_window/app_window_geometry_cache_unittest.cc b/extensions/browser/app_window/app_window_geometry_cache_unittest.cc index 8400723..e1f4068 100644 --- a/extensions/browser/app_window/app_window_geometry_cache_unittest.cc +++ b/extensions/browser/app_window/app_window_geometry_cache_unittest.cc @@ -48,8 +48,8 @@ class AppWindowGeometryCacheTest : public ExtensionsTest { : ui_thread_(BrowserThread::UI, &ui_message_loop_) {} // testing::Test overrides: - virtual void SetUp() override; - virtual void TearDown() override; + void SetUp() override; + void TearDown() override; void AddGeometryAndLoadExtension(const std::string& extension_id, const std::string& window_id, diff --git a/extensions/browser/error_map_unittest.cc b/extensions/browser/error_map_unittest.cc index 34afbea..d393624 100644 --- a/extensions/browser/error_map_unittest.cc +++ b/extensions/browser/error_map_unittest.cc @@ -20,11 +20,9 @@ using error_test_util::CreateNewRuntimeError; class ErrorMapUnitTest : public testing::Test { public: ErrorMapUnitTest() { } - virtual ~ErrorMapUnitTest() { } + ~ErrorMapUnitTest() override {} - virtual void SetUp() override { - testing::Test::SetUp(); - } + void SetUp() override { testing::Test::SetUp(); } protected: ErrorMap errors_; diff --git a/extensions/browser/extension_icon_image_unittest.cc b/extensions/browser/extension_icon_image_unittest.cc index 4842083..9f89fc2 100644 --- a/extensions/browser/extension_icon_image_unittest.cc +++ b/extensions/browser/extension_icon_image_unittest.cc @@ -125,7 +125,7 @@ class ExtensionIconImageTest : public ExtensionsTest, io_thread_(BrowserThread::IO), notification_service_(content::NotificationService::Create()) {} - virtual ~ExtensionIconImageTest() {} + ~ExtensionIconImageTest() override {} void WaitForImageLoad() { quit_in_image_loaded_ = true; @@ -167,7 +167,7 @@ class ExtensionIconImageTest : public ExtensionsTest, } // testing::Test overrides: - virtual void SetUp() override { + void SetUp() override { file_thread_.Start(); io_thread_.Start(); } diff --git a/extensions/browser/extensions_test.h b/extensions/browser/extensions_test.h index 17cfa01..29a122c 100644 --- a/extensions/browser/extensions_test.h +++ b/extensions/browser/extensions_test.h @@ -30,7 +30,7 @@ class TestExtensionsBrowserClient; class ExtensionsTest : public testing::Test { public: ExtensionsTest(); - virtual ~ExtensionsTest(); + ~ExtensionsTest() override; // Returned as a BrowserContext since most users don't need methods from // TestBrowserContext. @@ -43,8 +43,8 @@ class ExtensionsTest : public testing::Test { } // testing::Test overrides: - virtual void SetUp() override; - virtual void TearDown() override; + void SetUp() override; + void TearDown() override; private: scoped_ptr<content::ContentClient> content_client_; diff --git a/extensions/browser/guest_view/guest_view_manager_unittest.cc b/extensions/browser/guest_view/guest_view_manager_unittest.cc index aef3776..1646e49 100644 --- a/extensions/browser/guest_view/guest_view_manager_unittest.cc +++ b/extensions/browser/guest_view/guest_view_manager_unittest.cc @@ -45,7 +45,7 @@ class GuestViewManagerTest : public extensions::ExtensionsTest { public: GuestViewManagerTest() : notification_service_(content::NotificationService::Create()) {} - virtual ~GuestViewManagerTest() {} + ~GuestViewManagerTest() override {} scoped_ptr<WebContents> CreateWebContents() { return scoped_ptr<WebContents>( diff --git a/extensions/browser/guest_view/web_view/web_view_apitest.cc b/extensions/browser/guest_view/web_view/web_view_apitest.cc index 574e334..76de4d6 100644 --- a/extensions/browser/guest_view/web_view/web_view_apitest.cc +++ b/extensions/browser/guest_view/web_view/web_view_apitest.cc @@ -45,9 +45,7 @@ const char kTestWebSocketPort[] = "testWebSocketPort"; class EmptyHttpResponse : public net::test_server::HttpResponse { public: - virtual std::string ToResponseString() const override { - return std::string(); - } + std::string ToResponseString() const override { return std::string(); } }; // Handles |request| by serving a redirect response if the |User-Agent| is @@ -82,7 +80,7 @@ class WebContentsHiddenObserver : public content::WebContentsObserver { } // WebContentsObserver. - virtual void WasHidden() override { + void WasHidden() override { hidden_observed_ = true; hidden_callback_.Run(); } diff --git a/extensions/browser/guest_view/web_view/web_view_apitest.h b/extensions/browser/guest_view/web_view/web_view_apitest.h index 0c27136..06ed26a 100644 --- a/extensions/browser/guest_view/web_view/web_view_apitest.h +++ b/extensions/browser/guest_view/web_view/web_view_apitest.h @@ -41,10 +41,10 @@ class WebViewAPITest : public AppShellTest { void SendMessageToEmbedder(const std::string& message); // content::BrowserTestBase implementation. - virtual void RunTestOnMainThreadLoop() override; - virtual void SetUpCommandLine(base::CommandLine* command_line) override; - virtual void SetUpOnMainThread() override; - virtual void TearDownOnMainThread() override; + void RunTestOnMainThreadLoop() override; + void SetUpCommandLine(base::CommandLine* command_line) override; + void SetUpOnMainThread() override; + void TearDownOnMainThread() override; content::WebContents* embedder_web_contents_; TestGuestViewManagerFactory factory_; @@ -56,7 +56,7 @@ class WebViewAPITest : public AppShellTest { class WebViewDPIAPITest : public WebViewAPITest { protected: - virtual void SetUp() override; + void SetUp() override; static float scale() { return 2.0f; } }; diff --git a/extensions/browser/guest_view/web_view/web_view_media_access_apitest.cc b/extensions/browser/guest_view/web_view/web_view_media_access_apitest.cc index b2dfbc57..5405aaf 100644 --- a/extensions/browser/guest_view/web_view/web_view_media_access_apitest.cc +++ b/extensions/browser/guest_view/web_view/web_view_media_access_apitest.cc @@ -19,9 +19,9 @@ namespace { class MockWebContentsDelegate : public content::WebContentsDelegate { public: MockWebContentsDelegate() : requested_(false), checked_(false) {} - virtual ~MockWebContentsDelegate() {} + ~MockWebContentsDelegate() override {} - virtual void RequestMediaAccessPermission( + void RequestMediaAccessPermission( content::WebContents* web_contents, const content::MediaStreamRequest& request, const content::MediaResponseCallback& callback) override { @@ -30,10 +30,9 @@ class MockWebContentsDelegate : public content::WebContentsDelegate { request_message_loop_runner_->Quit(); } - virtual bool CheckMediaAccessPermission( - content::WebContents* web_contents, - const GURL& security_origin, - content::MediaStreamType type) override { + bool CheckMediaAccessPermission(content::WebContents* web_contents, + const GURL& security_origin, + content::MediaStreamType type) override { checked_ = true; if (check_message_loop_runner_.get()) check_message_loop_runner_->Quit(); @@ -82,12 +81,12 @@ class WebViewMediaAccessAPITest : public WebViewAPITest { } // content::BrowserTestBase implementation - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { WebViewAPITest::SetUpOnMainThread(); StartTestServer(); } - virtual void TearDownOnMainThread() override { + void TearDownOnMainThread() override { WebViewAPITest::TearDownOnMainThread(); StopTestServer(); } diff --git a/extensions/browser/image_loader_unittest.cc b/extensions/browser/image_loader_unittest.cc index ea40900..7257ddc 100644 --- a/extensions/browser/image_loader_unittest.cc +++ b/extensions/browser/image_loader_unittest.cc @@ -100,7 +100,7 @@ class ImageLoaderTest : public testing::Test { gfx::ImageFamily image_family_; private: - virtual void SetUp() override { + void SetUp() override { testing::Test::SetUp(); file_thread_.Start(); io_thread_.Start(); diff --git a/extensions/browser/lazy_background_task_queue_unittest.cc b/extensions/browser/lazy_background_task_queue_unittest.cc index e522137..9330669 100644 --- a/extensions/browser/lazy_background_task_queue_unittest.cc +++ b/extensions/browser/lazy_background_task_queue_unittest.cc @@ -77,7 +77,7 @@ class LazyBackgroundTaskQueueTest : public ExtensionsTest { extensions_browser_client()->set_extension_system_factory( &extension_system_factory_); } - virtual ~LazyBackgroundTaskQueueTest() {} + ~LazyBackgroundTaskQueueTest() override {} int task_run_count() { return task_run_count_; } diff --git a/extensions/browser/management_policy_unittest.cc b/extensions/browser/management_policy_unittest.cc index bcedc2c..7bf60a9 100644 --- a/extensions/browser/management_policy_unittest.cc +++ b/extensions/browser/management_policy_unittest.cc @@ -12,7 +12,7 @@ using extensions::Extension; class ManagementPolicyTest : public testing::Test { public: - virtual void SetUp() { + void SetUp() override { allow_all_.SetProhibitedActions(TestProvider::ALLOW_ALL); no_modify_status_.SetProhibitedActions( TestProvider::PROHIBIT_MODIFY_STATUS); diff --git a/extensions/browser/mojo/stash_backend_unittest.cc b/extensions/browser/mojo/stash_backend_unittest.cc index 0a0244b..d44ff27 100644 --- a/extensions/browser/mojo/stash_backend_unittest.cc +++ b/extensions/browser/mojo/stash_backend_unittest.cc @@ -19,7 +19,7 @@ class StashServiceTest : public testing::Test, public mojo::ErrorHandler { StashServiceTest() {} - virtual void SetUp() override { + void SetUp() override { expecting_error_ = false; expected_event_ = EVENT_NONE; stash_backend_.reset(new StashBackend); diff --git a/extensions/browser/process_manager_unittest.cc b/extensions/browser/process_manager_unittest.cc index eff5a15..e30c8c1 100644 --- a/extensions/browser/process_manager_unittest.cc +++ b/extensions/browser/process_manager_unittest.cc @@ -69,7 +69,7 @@ class ProcessManagerTest : public ExtensionsTest { &process_manager_delegate_); } - virtual ~ProcessManagerTest() {} + ~ProcessManagerTest() override {} // Use original_context() to make it clear it is a non-incognito context. BrowserContext* original_context() { return browser_context(); } diff --git a/extensions/browser/quota_service_unittest.cc b/extensions/browser/quota_service_unittest.cc index 62ba170..5bd0400 100644 --- a/extensions/browser/quota_service_unittest.cc +++ b/extensions/browser/quota_service_unittest.cc @@ -128,8 +128,8 @@ class QuotaServiceTest : public testing::Test { extension_c_("c"), loop_(), ui_thread_(BrowserThread::UI, &loop_) {} - virtual void SetUp() { service_.reset(new QuotaService()); } - virtual void TearDown() { + void SetUp() override { service_.reset(new QuotaService()); } + void TearDown() override { loop_.RunUntilIdle(); service_.reset(); } diff --git a/extensions/browser/runtime_data_unittest.cc b/extensions/browser/runtime_data_unittest.cc index 6253f80..451308c 100644 --- a/extensions/browser/runtime_data_unittest.cc +++ b/extensions/browser/runtime_data_unittest.cc @@ -32,7 +32,7 @@ scoped_refptr<Extension> CreateExtensionWithBackgroundPage() { class RuntimeDataTest : public testing::Test { public: RuntimeDataTest() : registry_(NULL), runtime_data_(®istry_) {} - virtual ~RuntimeDataTest() {} + ~RuntimeDataTest() override {} protected: ExtensionRegistry registry_; diff --git a/extensions/browser/value_store/leveldb_value_store_unittest.cc b/extensions/browser/value_store/leveldb_value_store_unittest.cc index a81f887..3c0fd53 100644 --- a/extensions/browser/value_store/leveldb_value_store_unittest.cc +++ b/extensions/browser/value_store/leveldb_value_store_unittest.cc @@ -32,16 +32,16 @@ INSTANTIATE_TEST_CASE_P( class LeveldbValueStoreUnitTest : public testing::Test { public: LeveldbValueStoreUnitTest() {} - virtual ~LeveldbValueStoreUnitTest() {} + ~LeveldbValueStoreUnitTest() override {} protected: - virtual void SetUp() override { + void SetUp() override { ASSERT_TRUE(database_dir_.CreateUniqueTempDir()); OpenStore(); ASSERT_FALSE(store_->Get()->HasError()); } - virtual void TearDown() override { + void TearDown() override { store_->Clear(); store_.reset(); } diff --git a/extensions/browser/value_store/value_store_frontend_unittest.cc b/extensions/browser/value_store/value_store_frontend_unittest.cc index 6622af9..c3e6f85 100644 --- a/extensions/browser/value_store/value_store_frontend_unittest.cc +++ b/extensions/browser/value_store/value_store_frontend_unittest.cc @@ -21,7 +21,7 @@ class ValueStoreFrontendTest : public testing::Test { file_thread_(BrowserThread::FILE, base::MessageLoop::current()) { } - virtual void SetUp() { + void SetUp() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); base::FilePath test_data_dir; @@ -33,7 +33,7 @@ class ValueStoreFrontendTest : public testing::Test { ResetStorage(); } - virtual void TearDown() { + void TearDown() override { base::MessageLoop::current()->RunUntilIdle(); // wait for storage to delete storage_.reset(); } diff --git a/extensions/browser/value_store/value_store_unittest.h b/extensions/browser/value_store/value_store_unittest.h index 3571b35..f50e690 100644 --- a/extensions/browser/value_store/value_store_unittest.h +++ b/extensions/browser/value_store/value_store_unittest.h @@ -24,8 +24,8 @@ class ValueStoreTest : public testing::TestWithParam<ValueStoreTestParam> { ValueStoreTest(); virtual ~ValueStoreTest(); - virtual void SetUp() override; - virtual void TearDown() override; + void SetUp() override; + void TearDown() override; protected: scoped_ptr<ValueStore> storage_; diff --git a/extensions/common/manifest_handlers/externally_connectable_unittest.cc b/extensions/common/manifest_handlers/externally_connectable_unittest.cc index 9dedff3..1096fa6 100644 --- a/extensions/common/manifest_handlers/externally_connectable_unittest.cc +++ b/extensions/common/manifest_handlers/externally_connectable_unittest.cc @@ -21,7 +21,7 @@ namespace errors = externally_connectable_errors; class ExternallyConnectableTest : public ManifestTest { public: ExternallyConnectableTest() {} - virtual ~ExternallyConnectableTest() {} + ~ExternallyConnectableTest() override {} protected: ExternallyConnectableInfo* GetExternallyConnectableInfo( diff --git a/extensions/common/manifest_test.h b/extensions/common/manifest_test.h index d331a3b..048306e 100644 --- a/extensions/common/manifest_test.h +++ b/extensions/common/manifest_test.h @@ -22,7 +22,7 @@ namespace extensions { class ManifestTest : public testing::Test { public: ManifestTest(); - virtual ~ManifestTest(); + ~ManifestTest() override; protected: // Helper class that simplifies creating methods that take either a filename diff --git a/extensions/components/native_app_window/native_app_window_views.h b/extensions/components/native_app_window/native_app_window_views.h index b4b1a96..04e924e 100644 --- a/extensions/components/native_app_window/native_app_window_views.h +++ b/extensions/components/native_app_window/native_app_window_views.h @@ -47,7 +47,7 @@ class NativeAppWindowViews : public extensions::NativeAppWindow, public views::WidgetObserver { public: NativeAppWindowViews(); - virtual ~NativeAppWindowViews(); + ~NativeAppWindowViews() override; void Init(extensions::AppWindow* app_window, const extensions::AppWindow::CreateParams& create_params); @@ -73,103 +73,97 @@ class NativeAppWindowViews : public extensions::NativeAppWindow, const extensions::AppWindow::CreateParams& create_params); // ui::BaseWindow implementation. - virtual bool IsActive() const override; - virtual bool IsMaximized() const override; - virtual bool IsMinimized() const override; - virtual bool IsFullscreen() const override; - virtual gfx::NativeWindow GetNativeWindow() override; - virtual gfx::Rect GetRestoredBounds() const override; - virtual ui::WindowShowState GetRestoredState() const override; - virtual gfx::Rect GetBounds() const override; - virtual void Show() override; - virtual void ShowInactive() override; - virtual void Hide() override; - virtual void Close() override; - virtual void Activate() override; - virtual void Deactivate() override; - virtual void Maximize() override; - virtual void Minimize() override; - virtual void Restore() override; - virtual void SetBounds(const gfx::Rect& bounds) override; - virtual void FlashFrame(bool flash) override; - virtual bool IsAlwaysOnTop() const override; - virtual void SetAlwaysOnTop(bool always_on_top) override; + bool IsActive() const override; + bool IsMaximized() const override; + bool IsMinimized() const override; + bool IsFullscreen() const override; + gfx::NativeWindow GetNativeWindow() override; + gfx::Rect GetRestoredBounds() const override; + ui::WindowShowState GetRestoredState() const override; + gfx::Rect GetBounds() const override; + void Show() override; + void ShowInactive() override; + void Hide() override; + void Close() override; + void Activate() override; + void Deactivate() override; + void Maximize() override; + void Minimize() override; + void Restore() override; + void SetBounds(const gfx::Rect& bounds) override; + void FlashFrame(bool flash) override; + bool IsAlwaysOnTop() const override; + void SetAlwaysOnTop(bool always_on_top) override; // WidgetDelegate implementation. - virtual void OnWidgetMove() override; - virtual views::View* GetInitiallyFocusedView() override; - virtual bool CanResize() const override; - virtual bool CanMaximize() const override; - virtual bool CanMinimize() const override; - virtual base::string16 GetWindowTitle() const override; - virtual bool ShouldShowWindowTitle() const override; - virtual bool ShouldShowWindowIcon() const override; - virtual void SaveWindowPlacement(const gfx::Rect& bounds, - ui::WindowShowState show_state) override; - virtual void DeleteDelegate() override; - virtual views::Widget* GetWidget() override; - virtual const views::Widget* GetWidget() const override; - virtual views::View* GetContentsView() override; - virtual bool ShouldDescendIntoChildForEventHandling( + void OnWidgetMove() override; + views::View* GetInitiallyFocusedView() override; + bool CanResize() const override; + bool CanMaximize() const override; + bool CanMinimize() const override; + base::string16 GetWindowTitle() const override; + bool ShouldShowWindowTitle() const override; + bool ShouldShowWindowIcon() const override; + void SaveWindowPlacement(const gfx::Rect& bounds, + ui::WindowShowState show_state) override; + void DeleteDelegate() override; + views::Widget* GetWidget() override; + const views::Widget* GetWidget() const override; + views::View* GetContentsView() override; + bool ShouldDescendIntoChildForEventHandling( gfx::NativeView child, const gfx::Point& location) override; // WidgetObserver implementation. - virtual void OnWidgetVisibilityChanged(views::Widget* widget, - bool visible) override; - virtual void OnWidgetActivationChanged(views::Widget* widget, - bool active) override; + void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; + void OnWidgetActivationChanged(views::Widget* widget, bool active) override; // WebContentsObserver implementation. - virtual void RenderViewCreated( - content::RenderViewHost* render_view_host) override; - virtual void RenderViewHostChanged( - content::RenderViewHost* old_host, - content::RenderViewHost* new_host) override; + void RenderViewCreated(content::RenderViewHost* render_view_host) override; + void RenderViewHostChanged(content::RenderViewHost* old_host, + content::RenderViewHost* new_host) override; // views::View implementation. - virtual void Layout() override; - virtual void ViewHierarchyChanged( + void Layout() override; + void ViewHierarchyChanged( const ViewHierarchyChangedDetails& details) override; - virtual gfx::Size GetMinimumSize() const override; - virtual gfx::Size GetMaximumSize() const override; - virtual void OnFocus() override; + gfx::Size GetMinimumSize() const override; + gfx::Size GetMaximumSize() const override; + void OnFocus() override; // NativeAppWindow implementation. - virtual void SetFullscreen(int fullscreen_types) override; - virtual bool IsFullscreenOrPending() const override; - virtual void UpdateWindowIcon() override; - virtual void UpdateWindowTitle() override; - virtual void UpdateBadgeIcon() override; - virtual void UpdateDraggableRegions( + void SetFullscreen(int fullscreen_types) override; + bool IsFullscreenOrPending() const override; + void UpdateWindowIcon() override; + void UpdateWindowTitle() override; + void UpdateBadgeIcon() override; + void UpdateDraggableRegions( const std::vector<extensions::DraggableRegion>& regions) override; - virtual SkRegion* GetDraggableRegion() override; - virtual void UpdateShape(scoped_ptr<SkRegion> region) override; - virtual void HandleKeyboardEvent( + SkRegion* GetDraggableRegion() override; + void UpdateShape(scoped_ptr<SkRegion> region) override; + void HandleKeyboardEvent( const content::NativeWebKeyboardEvent& event) override; - virtual bool IsFrameless() const override; - virtual bool HasFrameColor() const override; - virtual SkColor ActiveFrameColor() const override; - virtual SkColor InactiveFrameColor() const override; - virtual gfx::Insets GetFrameInsets() const override; - virtual void HideWithApp() override; - virtual void ShowWithApp() override; - virtual void UpdateShelfMenu() override; - virtual gfx::Size GetContentMinimumSize() const override; - virtual gfx::Size GetContentMaximumSize() const override; - virtual void SetContentSizeConstraints(const gfx::Size& min_size, - const gfx::Size& max_size) override; - virtual bool CanHaveAlphaEnabled() const override; - virtual void SetVisibleOnAllWorkspaces(bool always_visible) override; + bool IsFrameless() const override; + bool HasFrameColor() const override; + SkColor ActiveFrameColor() const override; + SkColor InactiveFrameColor() const override; + gfx::Insets GetFrameInsets() const override; + void HideWithApp() override; + void ShowWithApp() override; + void UpdateShelfMenu() override; + gfx::Size GetContentMinimumSize() const override; + gfx::Size GetContentMaximumSize() const override; + void SetContentSizeConstraints(const gfx::Size& min_size, + const gfx::Size& max_size) override; + bool CanHaveAlphaEnabled() const override; + void SetVisibleOnAllWorkspaces(bool always_visible) override; // web_modal::WebContentsModalDialogHost implementation. - virtual gfx::NativeView GetHostView() const override; - virtual gfx::Point GetDialogPosition(const gfx::Size& size) override; - virtual gfx::Size GetMaximumDialogSize() override; - virtual void AddObserver( - web_modal::ModalDialogHostObserver* observer) override; - virtual void RemoveObserver( - web_modal::ModalDialogHostObserver* observer) override; + gfx::NativeView GetHostView() const override; + gfx::Point GetDialogPosition(const gfx::Size& size) override; + gfx::Size GetMaximumDialogSize() override; + void AddObserver(web_modal::ModalDialogHostObserver* observer) override; + void RemoveObserver(web_modal::ModalDialogHostObserver* observer) override; private: // Informs modal dialogs that they need to update their positions. diff --git a/extensions/renderer/activity_log_converter_strategy_unittest.cc b/extensions/renderer/activity_log_converter_strategy_unittest.cc index 9331693..137c544 100644 --- a/extensions/renderer/activity_log_converter_strategy_unittest.cc +++ b/extensions/renderer/activity_log_converter_strategy_unittest.cc @@ -23,7 +23,7 @@ class ActivityLogConverterStrategyTest : public testing::Test { } protected: - virtual void SetUp() { + void SetUp() override { converter_.reset(V8ValueConverter::create()); strategy_.reset(new ActivityLogConverterStrategy()); converter_->SetFunctionAllowed(true); diff --git a/extensions/renderer/api/serial/data_receiver_unittest.cc b/extensions/renderer/api/serial/data_receiver_unittest.cc index 2415e00..381e361 100644 --- a/extensions/renderer/api/serial/data_receiver_unittest.cc +++ b/extensions/renderer/api/serial/data_receiver_unittest.cc @@ -16,7 +16,7 @@ class DataReceiverTest : public ApiTestBase { public: DataReceiverTest() {} - virtual void SetUp() override { + void SetUp() override { ApiTestBase::SetUp(); env()->RegisterModule("async_waiter", IDR_ASYNC_WAITER_JS); env()->RegisterModule("data_receiver", IDR_DATA_RECEIVER_JS); @@ -28,7 +28,7 @@ class DataReceiverTest : public ApiTestBase { &DataReceiverTest::CreateDataSource, base::Unretained(this))); } - virtual void TearDown() override { + void TearDown() override { if (sender_.get()) { sender_->ShutDown(); sender_ = NULL; diff --git a/extensions/renderer/api/serial/data_sender_unittest.cc b/extensions/renderer/api/serial/data_sender_unittest.cc index 77dcfe1..eac7e41c 100644 --- a/extensions/renderer/api/serial/data_sender_unittest.cc +++ b/extensions/renderer/api/serial/data_sender_unittest.cc @@ -16,7 +16,7 @@ class DataSenderTest : public ApiTestBase { public: DataSenderTest() {} - virtual void SetUp() override { + void SetUp() override { ApiTestBase::SetUp(); env()->RegisterModule("async_waiter", IDR_ASYNC_WAITER_JS); env()->RegisterModule("data_sender", IDR_DATA_SENDER_JS); @@ -28,7 +28,7 @@ class DataSenderTest : public ApiTestBase { base::Bind(&DataSenderTest::CreateDataSink, base::Unretained(this))); } - virtual void TearDown() override { + void TearDown() override { if (receiver_.get()) { receiver_->ShutDown(); receiver_ = NULL; diff --git a/extensions/renderer/api/serial/serial_api_unittest.cc b/extensions/renderer/api/serial/serial_api_unittest.cc index 9a07cd7..31362eb 100644 --- a/extensions/renderer/api/serial/serial_api_unittest.cc +++ b/extensions/renderer/api/serial/serial_api_unittest.cc @@ -394,7 +394,7 @@ class SerialApiTest : public ApiTestBase { public: SerialApiTest() {} - virtual void SetUp() override { + void SetUp() override { ApiTestBase::SetUp(); env()->RegisterModule("async_waiter", IDR_ASYNC_WAITER_JS); env()->RegisterModule("data_receiver", IDR_DATA_RECEIVER_JS); diff --git a/extensions/renderer/api_test_base.h b/extensions/renderer/api_test_base.h index c9a23e3..cc12e73 100644 --- a/extensions/renderer/api_test_base.h +++ b/extensions/renderer/api_test_base.h @@ -72,8 +72,8 @@ class TestServiceProvider : public gin::Wrappable<TestServiceProvider> { class ApiTestBase : public ModuleSystemTest { protected: ApiTestBase(); - virtual ~ApiTestBase(); - virtual void SetUp() override; + ~ApiTestBase() override; + void SetUp() override; void RunTest(const std::string& file_name, const std::string& test_name); TestServiceProvider* service_provider() { return service_provider_; } diff --git a/extensions/renderer/api_test_base_unittest.cc b/extensions/renderer/api_test_base_unittest.cc index 5b52fd73..149e34e 100644 --- a/extensions/renderer/api_test_base_unittest.cc +++ b/extensions/renderer/api_test_base_unittest.cc @@ -8,7 +8,7 @@ namespace extensions { class ApiTestBaseTest : public ApiTestBase { public: - virtual void SetUp() override { ApiTestBase::SetUp(); } + void SetUp() override { ApiTestBase::SetUp(); } }; TEST_F(ApiTestBaseTest, TestEnvironment) { diff --git a/extensions/renderer/event_unittest.cc b/extensions/renderer/event_unittest.cc index 73ff56e..4144a01 100644 --- a/extensions/renderer/event_unittest.cc +++ b/extensions/renderer/event_unittest.cc @@ -10,7 +10,7 @@ namespace extensions { namespace { class EventUnittest : public ModuleSystemTest { - virtual void SetUp() override { + void SetUp() override { ModuleSystemTest::SetUp(); env()->RegisterModule(kEventBindings, IDR_EVENT_BINDINGS_JS); diff --git a/extensions/renderer/json_schema_unittest.cc b/extensions/renderer/json_schema_unittest.cc index 8e29f55..920616b 100644 --- a/extensions/renderer/json_schema_unittest.cc +++ b/extensions/renderer/json_schema_unittest.cc @@ -10,7 +10,7 @@ namespace extensions { class JsonSchemaTest : public ModuleSystemTest { public: - virtual void SetUp() override { + void SetUp() override { ModuleSystemTest::SetUp(); env()->RegisterModule("json_schema", IDR_JSON_SCHEMA_JS); diff --git a/extensions/renderer/messaging_utils_unittest.cc b/extensions/renderer/messaging_utils_unittest.cc index bd7dbff..fbb2dec 100644 --- a/extensions/renderer/messaging_utils_unittest.cc +++ b/extensions/renderer/messaging_utils_unittest.cc @@ -24,7 +24,7 @@ class MessagingUtilsUnittest : public ModuleSystemTest { } private: - virtual void SetUp() override { + void SetUp() override { ModuleSystemTest::SetUp(); env()->RegisterModule("messaging_utils", IDR_MESSAGING_UTILS_JS); diff --git a/extensions/renderer/module_system_test.h b/extensions/renderer/module_system_test.h index 58501ab..dd2686b 100644 --- a/extensions/renderer/module_system_test.h +++ b/extensions/renderer/module_system_test.h @@ -79,10 +79,10 @@ class ModuleSystemTestEnvironment { class ModuleSystemTest : public testing::Test { public: ModuleSystemTest(); - virtual ~ModuleSystemTest(); + ~ModuleSystemTest() override; - virtual void SetUp() override; - virtual void TearDown() override; + void SetUp() override; + void TearDown() override; protected: ModuleSystemTestEnvironment* env() { return env_.get(); } diff --git a/extensions/renderer/utils_unittest.cc b/extensions/renderer/utils_unittest.cc index 8a88952..06e20f6 100644 --- a/extensions/renderer/utils_unittest.cc +++ b/extensions/renderer/utils_unittest.cc @@ -12,7 +12,7 @@ namespace { class UtilsUnittest : public ModuleSystemTest { private: - virtual void SetUp() override { + void SetUp() override { ModuleSystemTest::SetUp(); env()->RegisterModule("utils", IDR_UTILS_JS); |