Commit e1bc798b authored by dcheng's avatar dcheng Committed by Commit bot
Browse files

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=jhawkins@chromium.org

Review URL: https://codereview.chromium.org/684613002

Cr-Commit-Position: refs/heads/master@{#301990}
parent 750ade3f
......@@ -292,7 +292,7 @@ class AboutFlagsTest : public ::testing::Test {
testing::ClearState();
}
virtual void SetUp() override {
void SetUp() override {
for (size_t i = 0; i < arraysize(kExperiments); ++i)
kExperiments[i].supported_platforms = GetCurrentPlatform();
......@@ -304,9 +304,7 @@ class AboutFlagsTest : public ::testing::Test {
testing::SetExperiments(kExperiments, arraysize(kExperiments));
}
virtual void TearDown() override {
testing::SetExperiments(NULL, 0);
}
void TearDown() override { testing::SetExperiments(NULL, 0); }
TestingPrefServiceSimple prefs_;
PrefServiceFlagsStorage flags_storage_;
......
......@@ -30,7 +30,7 @@ class CustomLauncherPageBrowserTest
public:
CustomLauncherPageBrowserTest() {}
virtual void SetUpCommandLine(base::CommandLine* command_line) override {
void SetUpCommandLine(base::CommandLine* command_line) override {
PlatformAppBrowserTest::SetUpCommandLine(command_line);
// Custom launcher pages only work in the experimental app list.
......@@ -43,8 +43,7 @@ class CustomLauncherPageBrowserTest
// Open the launcher. Ignores the Extension argument (this will simply
// activate any loaded launcher pages).
virtual void LaunchPlatformApp(
const extensions::Extension* /*unused*/) override {
void LaunchPlatformApp(const extensions::Extension* /*unused*/) override {
AppListService* service =
AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE);
DCHECK(service);
......
......@@ -39,7 +39,7 @@ const char kAppUrl[] = "http://foobar.com/drive_app";
class DriveAppConverterTest : public ExtensionBrowserTest {
public:
DriveAppConverterTest() {}
virtual ~DriveAppConverterTest() {}
~DriveAppConverterTest() override {}
// ExtensionBrowserTest:
void SetUpOnMainThread() override {
......
......@@ -12,10 +12,10 @@
class DriveAppMappingTest : public testing::Test {
public:
DriveAppMappingTest() {}
virtual ~DriveAppMappingTest() {}
~DriveAppMappingTest() override {}
// testing::Test:
virtual void SetUp() override {
void SetUp() override {
pref_service_.reset(new TestingPrefServiceSyncable);
DriveAppMapping::RegisterProfilePrefs(pref_service_->registry());
......
......@@ -91,7 +91,7 @@ class DriveAppProviderTest : public ExtensionBrowserTest,
public extensions::InstallObserver {
public:
DriveAppProviderTest() {}
virtual ~DriveAppProviderTest() {}
~DriveAppProviderTest() override {}
// ExtensionBrowserTest:
void SetUpOnMainThread() override {
......
......@@ -25,7 +25,7 @@ class EphemeralAppTestBase : public extensions::PlatformAppBrowserTest {
static const char kFileSystemTestApp[];
EphemeralAppTestBase();
virtual ~EphemeralAppTestBase();
~EphemeralAppTestBase() override;
void SetUpCommandLine(base::CommandLine* command_line) override;
void SetUpOnMainThread() override;
......
......@@ -37,7 +37,7 @@ class EphemeralAppServiceTest : public testing::Test {
typedef EphemeralAppService::LaunchTimeAppMap LaunchTimeAppMap;
EphemeralAppServiceTest() {}
virtual ~EphemeralAppServiceTest() {}
~EphemeralAppServiceTest() override {}
void RunTest(int ephemeral_app_count,
const LaunchTimeAppMap& launch_times,
......
......@@ -9,11 +9,11 @@
class SpeechRecognitionTest : public extensions::PlatformAppBrowserTest {
public:
SpeechRecognitionTest() {}
virtual ~SpeechRecognitionTest() {}
SpeechRecognitionTest() {}
~SpeechRecognitionTest() override {}
protected:
virtual void SetUp() override {
void SetUp() override {
const testing::TestInfo* const test_info =
testing::UnitTest::GetInstance()->current_test_info();
// For SpeechRecognitionTest.SpeechFromBackgroundPage test, we need to
......
......@@ -254,7 +254,7 @@ class MockDownloadWebContentsDelegate : public content::WebContentsDelegate {
class WebViewTest : public extensions::PlatformAppBrowserTest {
protected:
virtual void SetUp() override {
void SetUp() override {
if (UsesFakeSpeech()) {
// SpeechRecognition test specific SetUp.
fake_speech_recognition_manager_.reset(
......@@ -268,7 +268,7 @@ class WebViewTest : public extensions::PlatformAppBrowserTest {
extensions::PlatformAppBrowserTest::SetUp();
}
virtual void TearDown() override {
void TearDown() override {
if (UsesFakeSpeech()) {
// SpeechRecognition test specific TearDown.
content::SpeechRecognitionManager::SetManagerForTesting(NULL);
......@@ -2264,8 +2264,8 @@ IN_PROC_BROWSER_TEST_F(WebViewPluginTest, TestLoadPluginEvent) {
class WebViewCaptureTest : public WebViewTest {
public:
WebViewCaptureTest() {}
virtual ~WebViewCaptureTest() {}
virtual void SetUp() override {
~WebViewCaptureTest() override {}
void SetUp() override {
EnablePixelOutput();
WebViewTest::SetUp();
}
......
......@@ -70,7 +70,7 @@ class BookmarkProviderTest : public testing::Test {
BookmarkProviderTest();
protected:
virtual void SetUp() override;
void SetUp() override;
bookmarks::TestBookmarkClient client_;
scoped_ptr<TestingProfile> profile_;
......
......@@ -27,10 +27,10 @@ class BuiltinProviderTest : public testing::Test {
};
BuiltinProviderTest() : provider_(NULL) {}
virtual ~BuiltinProviderTest() {}
~BuiltinProviderTest() override {}
virtual void SetUp() override { provider_ = new BuiltinProvider(); }
virtual void TearDown() override { provider_ = NULL; }
void SetUp() override { provider_ = new BuiltinProvider(); }
void TearDown() override { provider_ = NULL; }
void RunTest(const TestData cases[], size_t num_cases) {
ACMatches matches;
......
......@@ -136,8 +136,8 @@ class HistoryQuickProviderTest : public testing::Test {
NULL, NULL, base::Closure());
}
virtual void SetUp();
virtual void TearDown();
void SetUp() override;
void TearDown() override;
virtual void GetTestData(size_t* data_count, TestURLInfo** test_data);
......
......@@ -163,7 +163,7 @@ class HistoryURLProviderTest : public testing::Test,
HistoryQuickProvider::set_disabled(true);
}
virtual ~HistoryURLProviderTest() {
~HistoryURLProviderTest() override {
HistoryQuickProvider::set_disabled(false);
}
......
......@@ -62,10 +62,10 @@ void ScopedExtensionLoadObserver::OnExtensionInstalled(
class KeywordExtensionsDelegateImplTest : public ExtensionServiceTestBase {
public:
KeywordExtensionsDelegateImplTest() {}
virtual ~KeywordExtensionsDelegateImplTest() {}
~KeywordExtensionsDelegateImplTest() override {}
protected:
virtual void SetUp() override;
void SetUp() override;
void RunTest(bool incognito);
......
......@@ -157,8 +157,8 @@ class SearchProviderTest : public testing::Test,
}
// See description above class for what this registers.
virtual void SetUp() override;
virtual void TearDown() override;
void SetUp() override;
void TearDown() override;
void RunTest(TestData* cases, int num_cases, bool prefer_keyword);
......
......@@ -35,8 +35,8 @@ class ShortcutsBackendTest : public testing::Test,
AutocompleteMatch::Type type = AutocompleteMatchType::URL_WHAT_YOU_TYPED);
void SetSearchProvider();
virtual void SetUp();
virtual void TearDown();
void SetUp() override;
void TearDown() override;
void OnShortcutsLoaded() override;
void OnShortcutsChanged() override;
......
......@@ -260,8 +260,8 @@ class ShortcutsProviderTest : public testing::Test {
std::set<ExpectedURLAndAllowedToBeDefault> matches_;
};
virtual void SetUp();
virtual void TearDown();
void SetUp() override;
void TearDown() override;
// Fills test data into the provider.
void FillData(TestShortcutInfo* db, size_t db_size);
......
......@@ -99,8 +99,7 @@ class FakeEmptyTopSites : public history::TopSites {
// after top sites have been requested.
GetMostVisitedURLsCallback mv_callback;
protected:
virtual ~FakeEmptyTopSites() {
}
~FakeEmptyTopSites() override {}
};
void FakeEmptyTopSites::GetMostVisitedURLs(
......@@ -117,8 +116,8 @@ class ZeroSuggestProviderTest : public testing::Test,
public:
ZeroSuggestProviderTest();
virtual void SetUp() override;
virtual void TearDown() override;
void SetUp() override;
void TearDown() override;
protected:
// AutocompleteProviderListener:
......
......@@ -52,10 +52,10 @@ class TestPersonalDataManager : public PersonalDataManager {
class AutofillCCInfobarDelegateTest : public ChromeRenderViewHostTestHarness {
public:
virtual ~AutofillCCInfobarDelegateTest();
~AutofillCCInfobarDelegateTest() override;
virtual void SetUp() override;
virtual void TearDown() override;
void SetUp() override;
void TearDown() override;
protected:
scoped_ptr<ConfirmInfoBarDelegate> CreateDelegate(
......
......@@ -200,7 +200,7 @@ class AutofillInteractiveTest : public InProcessBrowserTest {
key_press_event_sink_(
base::Bind(&AutofillInteractiveTest::HandleKeyPressEvent,
base::Unretained(this))) {}
virtual ~AutofillInteractiveTest() {}
~AutofillInteractiveTest() override {}
// InProcessBrowserTest:
void SetUpOnMainThread() override {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment