summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2014-10-29 16:01:29 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-29 23:01:50 +0000
commit3456d92f5ba40d9fc3c5f6a1cd71c6d49a9dc7de (patch)
treebb6248af1d174d2d857dcba9db122d65c0240df6
parent3a36600fd330af8a407a7ea7f1bba99c5c1e5b46 (diff)
downloadchromium_src-3456d92f5ba40d9fc3c5f6a1cd71c6d49a9dc7de.zip
chromium_src-3456d92f5ba40d9fc3c5f6a1cd71c6d49a9dc7de.tar.gz
chromium_src-3456d92f5ba40d9fc3c5f6a1cd71c6d49a9dc7de.tar.bz2
Standardize usage of virtual/override/final specifiers in chrome/browser/safe_browsing.
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=noelutz@google.com Review URL: https://codereview.chromium.org/685553002 Cr-Commit-Position: refs/heads/master@{#301964}
-rw-r--r--chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc4
-rw-r--r--chrome/browser/safe_browsing/client_side_detection_host_unittest.cc4
-rw-r--r--chrome/browser/safe_browsing/client_side_detection_service_unittest.cc4
-rw-r--r--chrome/browser/safe_browsing/download_feedback_service_unittest.cc6
-rw-r--r--chrome/browser/safe_browsing/download_feedback_unittest.cc6
-rw-r--r--chrome/browser/safe_browsing/download_protection_service_unittest.cc4
-rw-r--r--chrome/browser/safe_browsing/incident_reporting/delayed_callback_runner_unittest.cc4
-rw-r--r--chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc2
-rw-r--r--chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc4
-rw-r--r--chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate_unittest.cc8
-rw-r--r--chrome/browser/safe_browsing/malware_details_unittest.cc4
-rw-r--r--chrome/browser/safe_browsing/ping_manager_unittest.cc2
-rw-r--r--chrome/browser/safe_browsing/protocol_manager_unittest.cc2
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc4
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc4
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database_unittest.cc4
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc6
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_store_file_unittest.cc4
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_test.cc7
19 files changed, 39 insertions, 44 deletions
diff --git a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc
index 793dda3..9849233 100644
--- a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc
+++ b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc
@@ -78,7 +78,7 @@ class MockClientSideDetectionHost : public ClientSideDetectionHost {
class BrowserFeatureExtractorTest : public ChromeRenderViewHostTestHarness {
protected:
- virtual void SetUp() {
+ void SetUp() override {
ChromeRenderViewHostTestHarness::SetUp();
ASSERT_TRUE(profile()->CreateHistoryService(
true /* delete_file */, false /* no_db */));
@@ -93,7 +93,7 @@ class BrowserFeatureExtractorTest : public ChromeRenderViewHostTestHarness {
browse_info_.reset(new BrowseInfo);
}
- virtual void TearDown() {
+ void TearDown() override {
extractor_.reset();
host_.reset();
db_manager_ = NULL;
diff --git a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
index 24d05a2..52396ec 100644
--- a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
@@ -201,7 +201,7 @@ class ClientSideDetectionHostTest : public ChromeRenderViewHostTestHarness {
public:
typedef SafeBrowsingUIManager::UnsafeResource UnsafeResource;
- virtual void SetUp() override {
+ void SetUp() override {
ChromeRenderViewHostTestHarness::SetUp();
// Inject service classes.
@@ -222,7 +222,7 @@ class ClientSideDetectionHostTest : public ChromeRenderViewHostTestHarness {
csd_host_->browse_info_.reset(new BrowseInfo);
}
- virtual void TearDown() override {
+ void TearDown() override {
// Delete the host object on the UI thread and release the
// SafeBrowsingService.
BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE,
diff --git a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
index 5762847..275409f 100644
--- a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
@@ -62,7 +62,7 @@ ACTION(QuitCurrentMessageLoop) {
class ClientSideDetectionServiceTest : public testing::Test {
protected:
- virtual void SetUp() {
+ void SetUp() override {
file_thread_.reset(new content::TestBrowserThread(BrowserThread::FILE,
&msg_loop_));
@@ -72,7 +72,7 @@ class ClientSideDetectionServiceTest : public testing::Test {
&msg_loop_));
}
- virtual void TearDown() {
+ void TearDown() override {
msg_loop_.RunUntilIdle();
csd_service_.reset();
file_thread_.reset();
diff --git a/chrome/browser/safe_browsing/download_feedback_service_unittest.cc b/chrome/browser/safe_browsing/download_feedback_service_unittest.cc
index 450524f..1f04532 100644
--- a/chrome/browser/safe_browsing/download_feedback_service_unittest.cc
+++ b/chrome/browser/safe_browsing/download_feedback_service_unittest.cc
@@ -137,14 +137,12 @@ class DownloadFeedbackServiceTest : public testing::Test {
new net::TestURLRequestContextGetter(io_task_runner_)) {
}
- virtual void SetUp() override {
+ void SetUp() override {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
DownloadFeedback::RegisterFactory(&download_feedback_factory_);
}
- virtual void TearDown() override {
- DownloadFeedback::RegisterFactory(NULL);
- }
+ void TearDown() override { DownloadFeedback::RegisterFactory(NULL); }
base::FilePath CreateTestFile(int n) const {
base::FilePath upload_file_path(
diff --git a/chrome/browser/safe_browsing/download_feedback_unittest.cc b/chrome/browser/safe_browsing/download_feedback_unittest.cc
index fa9113a..f4fe38a 100644
--- a/chrome/browser/safe_browsing/download_feedback_unittest.cc
+++ b/chrome/browser/safe_browsing/download_feedback_unittest.cc
@@ -110,7 +110,7 @@ class DownloadFeedbackTest : public testing::Test {
EXPECT_NE(io_task_runner_, file_task_runner_);
}
- virtual void SetUp() override {
+ void SetUp() override {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
upload_file_path_ = temp_dir_.path().AppendASCII("test file");
upload_file_data_ = "data";
@@ -120,9 +120,7 @@ class DownloadFeedbackTest : public testing::Test {
TwoPhaseUploader::RegisterFactory(&two_phase_uploader_factory_);
}
- virtual void TearDown() override {
- TwoPhaseUploader::RegisterFactory(NULL);
- }
+ void TearDown() override { TwoPhaseUploader::RegisterFactory(NULL); }
FakeUploader* uploader() const {
return two_phase_uploader_factory_.uploader_;
diff --git a/chrome/browser/safe_browsing/download_protection_service_unittest.cc b/chrome/browser/safe_browsing/download_protection_service_unittest.cc
index 93324cf..b311980 100644
--- a/chrome/browser/safe_browsing/download_protection_service_unittest.cc
+++ b/chrome/browser/safe_browsing/download_protection_service_unittest.cc
@@ -201,7 +201,7 @@ class DownloadProtectionServiceTest : public testing::Test {
: test_browser_thread_bundle_(
content::TestBrowserThreadBundle::IO_MAINLOOP) {
}
- virtual void SetUp() {
+ void SetUp() override {
#if defined(OS_MACOSX)
field_trial_list_.reset(new base::FieldTrialList(
new metrics::SHA1EntropyProvider("42")));
@@ -230,7 +230,7 @@ class DownloadProtectionServiceTest : public testing::Test {
.AppendASCII("download_protection");
}
- virtual void TearDown() {
+ void TearDown() override {
sb_service_->ShutDown();
// Flush all of the thread message loops to ensure that there are no
// tasks currently running.
diff --git a/chrome/browser/safe_browsing/incident_reporting/delayed_callback_runner_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/delayed_callback_runner_unittest.cc
index df70f79..4cd23b2 100644
--- a/chrome/browser/safe_browsing/incident_reporting/delayed_callback_runner_unittest.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/delayed_callback_runner_unittest.cc
@@ -47,13 +47,13 @@ class DelayedCallbackRunnerTest : public testing::Test {
: task_runner_(new base::TestSimpleTaskRunner),
thread_task_runner_handle_(task_runner_) {}
- virtual void SetUp() override {
+ void SetUp() override {
instance_.reset(new safe_browsing::DelayedCallbackRunner(
base::TimeDelta::FromMilliseconds(1), // ignored by simple runner.
task_runner_));
}
- virtual void TearDown() override { instance_.reset(); }
+ void TearDown() override { instance_.reset(); }
void OnRun(const std::string& name, CallbackArgument* arg) {
EXPECT_FALSE(callbacks_[name].run);
diff --git a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc
index ae6c3ce..a7ce926 100644
--- a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc
@@ -175,7 +175,7 @@ class IncidentReportingServiceTest : public testing::Test {
uploader_destroyed_(),
delayed_analysis_ran_() {}
- virtual void SetUp() override {
+ void SetUp() override {
testing::Test::SetUp();
ASSERT_TRUE(profile_manager_.SetUp());
}
diff --git a/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc
index 1f05848..ccea446 100644
--- a/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc
@@ -101,14 +101,14 @@ class LastDownloadFinderTest : public testing::Test {
LastDownloadFinderTest() : profile_number_() {}
- virtual void SetUp() override {
+ void SetUp() override {
testing::Test::SetUp();
profile_manager_.reset(
new TestingProfileManager(TestingBrowserProcess::GetGlobal()));
ASSERT_TRUE(profile_manager_->SetUp());
}
- virtual void TearDown() override {
+ void TearDown() override {
// Shut down the history service on all profiles.
std::vector<Profile*> profiles(
profile_manager_->profile_manager()->GetLoadedProfiles());
diff --git a/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate_unittest.cc
index e152635..5b687bd 100644
--- a/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate_unittest.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate_unittest.cc
@@ -26,7 +26,7 @@ class PreferenceValidationDelegateTest : public testing::Test {
: kPrefPath_("atomic.pref"),
null_value_(base::Value::CreateNullValue()) {}
- virtual void SetUp() override {
+ void SetUp() override {
testing::Test::SetUp();
invalid_keys_.push_back(std::string("one"));
invalid_keys_.push_back(std::string("two"));
@@ -103,7 +103,7 @@ class PreferenceValidationDelegateValues
public testing::WithParamInterface<
std::tr1::tuple<base::Value::Type, const char*> > {
protected:
- virtual void SetUp() override {
+ void SetUp() override {
PreferenceValidationDelegateTest::SetUp();
value_type_ = std::tr1::get<0>(GetParam());
expected_value_ = std::tr1::get<1>(GetParam());
@@ -183,7 +183,7 @@ class PreferenceValidationDelegateNoIncident
: public PreferenceValidationDelegateTest,
public testing::WithParamInterface<PrefHashStoreTransaction::ValueState> {
protected:
- virtual void SetUp() override {
+ void SetUp() override {
PreferenceValidationDelegateTest::SetUp();
value_state_ = GetParam();
}
@@ -223,7 +223,7 @@ class PreferenceValidationDelegateWithIncident
std::tr1::tuple<PrefHashStoreTransaction::ValueState,
TrackedPreferenceHelper::ResetAction> > {
protected:
- virtual void SetUp() override {
+ void SetUp() override {
PreferenceValidationDelegateTest::SetUp();
value_state_ = std::tr1::get<0>(GetParam());
reset_action_ = std::tr1::get<1>(GetParam());
diff --git a/chrome/browser/safe_browsing/malware_details_unittest.cc b/chrome/browser/safe_browsing/malware_details_unittest.cc
index 390c6b42..6d0c75d 100644
--- a/chrome/browser/safe_browsing/malware_details_unittest.cc
+++ b/chrome/browser/safe_browsing/malware_details_unittest.cc
@@ -184,13 +184,13 @@ class MalwareDetailsTest : public ChromeRenderViewHostTestHarness {
: ui_manager_(new MockSafeBrowsingUIManager()) {
}
- virtual void SetUp() override {
+ void SetUp() override {
ChromeRenderViewHostTestHarness::SetUp();
ASSERT_TRUE(profile()->CreateHistoryService(
true /* delete_file */, false /* no_db */));
}
- virtual void TearDown() override {
+ void TearDown() override {
profile()->DestroyHistoryService();
ChromeRenderViewHostTestHarness::TearDown();
}
diff --git a/chrome/browser/safe_browsing/ping_manager_unittest.cc b/chrome/browser/safe_browsing/ping_manager_unittest.cc
index 08dd992..f115f24 100644
--- a/chrome/browser/safe_browsing/ping_manager_unittest.cc
+++ b/chrome/browser/safe_browsing/ping_manager_unittest.cc
@@ -22,7 +22,7 @@ class SafeBrowsingPingManagerTest : public testing::Test {
protected:
std::string key_param_;
- virtual void SetUp() {
+ void SetUp() override {
std::string key = google_apis::GetAPIKey();
if (!key.empty()) {
key_param_ = base::StringPrintf(
diff --git a/chrome/browser/safe_browsing/protocol_manager_unittest.cc b/chrome/browser/safe_browsing/protocol_manager_unittest.cc
index 687347a..2bf6b3d 100644
--- a/chrome/browser/safe_browsing/protocol_manager_unittest.cc
+++ b/chrome/browser/safe_browsing/protocol_manager_unittest.cc
@@ -72,7 +72,7 @@ class SafeBrowsingProtocolManagerTest : public testing::Test {
protected:
std::string key_param_;
- virtual void SetUp() {
+ void SetUp() override {
std::string key = google_apis::GetAPIKey();
if (!key.empty()) {
key_param_ = base::StringPrintf(
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
index 8b3c56a..07c0265 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
@@ -344,14 +344,14 @@ class SafeBrowsingBlockingPageBrowserTest
SafeBrowsingBlockingPageBrowserTest() {
}
- virtual void SetUp() override {
+ void SetUp() override {
SafeBrowsingService::RegisterFactory(&factory_);
SafeBrowsingBlockingPage::RegisterFactory(&blocking_page_factory_);
MalwareDetails::RegisterFactory(&details_factory_);
InProcessBrowserTest::SetUp();
}
- virtual void TearDown() override {
+ void TearDown() override {
InProcessBrowserTest::TearDown();
SafeBrowsingBlockingPage::RegisterFactory(NULL);
SafeBrowsingService::RegisterFactory(NULL);
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
index 700183d..8fc2e798 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
@@ -98,13 +98,13 @@ class SafeBrowsingBlockingPageTest : public ChromeRenderViewHostTestHarness {
ui_manager_ = new TestSafeBrowsingUIManager(NULL);
}
- virtual void SetUp() override {
+ void SetUp() override {
ChromeRenderViewHostTestHarness::SetUp();
SafeBrowsingBlockingPage::RegisterFactory(&factory_);
ResetUserResponse();
}
- virtual void TearDown() override {
+ void TearDown() override {
// Release the UI manager before the BrowserThreads are destroyed.
ui_manager_ = NULL;
SafeBrowsingBlockingPage::RegisterFactory(NULL);
diff --git a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
index 44d9bdb..5631bfe 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
@@ -254,7 +254,7 @@ class ScopedLogMessageIgnorer {
class SafeBrowsingDatabaseTest : public PlatformTest {
public:
- virtual void SetUp() {
+ void SetUp() override {
PlatformTest::SetUp();
// Setup a database in a temporary directory.
@@ -265,7 +265,7 @@ class SafeBrowsingDatabaseTest : public PlatformTest {
database_->Init(database_filename_);
}
- virtual void TearDown() {
+ void TearDown() override {
database_.reset();
PlatformTest::TearDown();
diff --git a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
index cdb03bb..3137d06 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
@@ -901,7 +901,7 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceTest, StartAndStop) {
class SafeBrowsingServiceShutdownTest : public SafeBrowsingServiceTest {
public:
- virtual void TearDown() override {
+ void TearDown() override {
// Browser should be fully torn down by now, so we can safely check these
// counters.
EXPECT_EQ(1, TestProtocolManager::create_count());
@@ -974,7 +974,7 @@ class SafeBrowsingDatabaseManagerCookieTest : public InProcessBrowserTest {
public:
SafeBrowsingDatabaseManagerCookieTest() {}
- virtual void SetUp() override {
+ void SetUp() override {
// We need to start the test server to get the host&port in the url.
ASSERT_TRUE(test_server()->Start());
@@ -989,7 +989,7 @@ class SafeBrowsingDatabaseManagerCookieTest : public InProcessBrowserTest {
InProcessBrowserTest::SetUp();
}
- virtual void TearDown() override {
+ void TearDown() override {
InProcessBrowserTest::TearDown();
SafeBrowsingService::RegisterFactory(NULL);
diff --git a/chrome/browser/safe_browsing/safe_browsing_store_file_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_store_file_unittest.cc
index 310f634..765b470 100644
--- a/chrome/browser/safe_browsing/safe_browsing_store_file_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_store_file_unittest.cc
@@ -40,7 +40,7 @@ namespace safe_browsing {
class SafeBrowsingStoreFileTest : public PlatformTest {
public:
- virtual void SetUp() {
+ void SetUp() override {
PlatformTest::SetUp();
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
@@ -54,7 +54,7 @@ class SafeBrowsingStoreFileTest : public PlatformTest {
base::Unretained(this)));
corruption_detected_ = false;
}
- virtual void TearDown() {
+ void TearDown() override {
if (store_.get())
store_->Delete();
store_.reset();
diff --git a/chrome/browser/safe_browsing/safe_browsing_test.cc b/chrome/browser/safe_browsing/safe_browsing_test.cc
index 273a086..abbb357 100644
--- a/chrome/browser/safe_browsing/safe_browsing_test.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_test.cc
@@ -160,8 +160,7 @@ class SafeBrowsingServerTest : public InProcessBrowserTest {
is_checked_url_safe_(false) {
}
- virtual ~SafeBrowsingServerTest() {
- }
+ ~SafeBrowsingServerTest() override {}
void UpdateSafeBrowsingStatus() {
ASSERT_TRUE(safe_browsing_service_);
@@ -255,7 +254,7 @@ class SafeBrowsingServerTest : public InProcessBrowserTest {
return safe_browsing_service_ != NULL;
}
- virtual void SetUp() override {
+ void SetUp() override {
base::FilePath datafile_path;
ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &datafile_path));
@@ -275,7 +274,7 @@ class SafeBrowsingServerTest : public InProcessBrowserTest {
InProcessBrowserTest::SetUp();
}
- virtual void TearDown() override {
+ void TearDown() override {
InProcessBrowserTest::TearDown();
SafeBrowsingService::RegisterFactory(NULL);