diff options
author | dcheng <dcheng@chromium.org> | 2014-10-29 14:27:50 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-29 21:28:20 +0000 |
commit | 30a1b15432dd20cf910f96ec35e27a94f769640e (patch) | |
tree | c9f5ffdb5c802fe2a26a22d499b700b49fe8f509 /components/dom_distiller | |
parent | 6913b7737d6124633109d6e3da31689d7ffef838 (diff) | |
download | chromium_src-30a1b15432dd20cf910f96ec35e27a94f769640e.zip chromium_src-30a1b15432dd20cf910f96ec35e27a94f769640e.tar.gz chromium_src-30a1b15432dd20cf910f96ec35e27a94f769640e.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=caitkp@chromium.org
Review URL: https://codereview.chromium.org/684513002
Cr-Commit-Position: refs/heads/master@{#301931}
Diffstat (limited to 'components/dom_distiller')
10 files changed, 15 insertions, 21 deletions
diff --git a/components/dom_distiller/content/dom_distiller_viewer_source_unittest.cc b/components/dom_distiller/content/dom_distiller_viewer_source_unittest.cc index 7d7e8bf..fa14e8a 100644 --- a/components/dom_distiller/content/dom_distiller_viewer_source_unittest.cc +++ b/components/dom_distiller/content/dom_distiller_viewer_source_unittest.cc @@ -13,7 +13,7 @@ const char kTestScheme[] = "myscheme"; class DomDistillerViewerSourceTest : public testing::Test { public: - virtual void SetUp() override { + void SetUp() override { source_.reset(new DomDistillerViewerSource(NULL, kTestScheme)); } diff --git a/components/dom_distiller/core/distilled_content_store_unittest.cc b/components/dom_distiller/core/distilled_content_store_unittest.cc index dced364..b4b7a3d 100644 --- a/components/dom_distiller/core/distilled_content_store_unittest.cc +++ b/components/dom_distiller/core/distilled_content_store_unittest.cc @@ -59,7 +59,7 @@ class InMemoryContentStoreTest : public testing::Test { protected: // testing::Test implementation: - virtual void SetUp() override { + void SetUp() override { store_.reset(new InMemoryContentStore(kDefaultMaxNumCachedEntries)); save_success_ = false; load_success_ = false; diff --git a/components/dom_distiller/core/distilled_page_prefs_unittests.cc b/components/dom_distiller/core/distilled_page_prefs_unittests.cc index cf13fce..e7417cc 100644 --- a/components/dom_distiller/core/distilled_page_prefs_unittests.cc +++ b/components/dom_distiller/core/distilled_page_prefs_unittests.cc @@ -40,7 +40,7 @@ class TestingObserver : public DistilledPagePrefs::Observer { class DistilledPagePrefsTest : public testing::Test { protected: - virtual void SetUp() override { + void SetUp() override { pref_service_.reset(new user_prefs::TestingPrefServiceSyncable()); DistilledPagePrefs::RegisterProfilePrefs(pref_service_->registry()); distilled_page_prefs_.reset(new DistilledPagePrefs(pref_service_.get())); diff --git a/components/dom_distiller/core/distiller_unittest.cc b/components/dom_distiller/core/distiller_unittest.cc index ed70ec5..d55e4f7 100644 --- a/components/dom_distiller/core/distiller_unittest.cc +++ b/components/dom_distiller/core/distiller_unittest.cc @@ -263,7 +263,7 @@ class MockDistillerURLFetcherFactory : public DistillerURLFetcherFactory { class DistillerTest : public testing::Test { public: - virtual ~DistillerTest() {} + ~DistillerTest() override {} void OnDistillArticleDone(scoped_ptr<DistilledArticleProto> proto) { article_proto_ = proto.Pass(); diff --git a/components/dom_distiller/core/distiller_url_fetcher_unittest.cc b/components/dom_distiller/core/distiller_url_fetcher_unittest.cc index d2b69b1..f100d5cd 100644 --- a/components/dom_distiller/core/distiller_url_fetcher_unittest.cc +++ b/components/dom_distiller/core/distiller_url_fetcher_unittest.cc @@ -28,7 +28,7 @@ class DistillerURLFetcherTest : public testing::Test { protected: // testing::Test implementation: - virtual void SetUp() override { + void SetUp() override { url_fetcher_.reset(new dom_distiller::DistillerURLFetcher(NULL)); factory_.reset(new net::FakeURLFetcherFactory(NULL)); factory_->SetFakeResponse( diff --git a/components/dom_distiller/core/dom_distiller_service_unittest.cc b/components/dom_distiller/core/dom_distiller_service_unittest.cc index 4745c25..868b398 100644 --- a/components/dom_distiller/core/dom_distiller_service_unittest.cc +++ b/components/dom_distiller/core/dom_distiller_service_unittest.cc @@ -79,7 +79,7 @@ scoped_ptr<DistilledArticleProto> CreateDefaultArticle() { class DomDistillerServiceTest : public testing::Test { public: - virtual void SetUp() { + void SetUp() override { main_loop_.reset(new base::MessageLoop()); FakeDB<ArticleEntry>* fake_db = new FakeDB<ArticleEntry>(&db_model_); FakeDB<ArticleEntry>::EntryMap store_model; @@ -96,7 +96,7 @@ class DomDistillerServiceTest : public testing::Test { fake_db->LoadCallback(true); } - virtual void TearDown() { + void TearDown() override { base::RunLoop().RunUntilIdle(); store_ = NULL; distiller_factory_ = NULL; diff --git a/components/dom_distiller/core/dom_distiller_store_unittest.cc b/components/dom_distiller/core/dom_distiller_store_unittest.cc index b84f2b0..b2d0efd 100644 --- a/components/dom_distiller/core/dom_distiller_store_unittest.cc +++ b/components/dom_distiller/core/dom_distiller_store_unittest.cc @@ -122,14 +122,14 @@ class MockDistillerObserver : public DomDistillerObserver { class DomDistillerStoreTest : public testing::Test { public: - virtual void SetUp() { + void SetUp() override { db_model_.clear(); sync_model_.clear(); store_model_.clear(); next_sync_id_ = 1; } - virtual void TearDown() { + void TearDown() override { store_.reset(); fake_db_ = NULL; fake_sync_processor_ = NULL; diff --git a/components/dom_distiller/core/task_tracker_unittest.cc b/components/dom_distiller/core/task_tracker_unittest.cc index 435d040..d673553f 100644 --- a/components/dom_distiller/core/task_tracker_unittest.cc +++ b/components/dom_distiller/core/task_tracker_unittest.cc @@ -57,7 +57,7 @@ class MockSaveCallback { class DomDistillerTaskTrackerTest : public testing::Test { public: - virtual void SetUp() override { + void SetUp() override { message_loop_.reset(new base::MessageLoop()); entry_id_ = "id0"; page_0_url_ = GURL("http://www.example.com/1"); diff --git a/components/dom_distiller/core/viewer_unittest.cc b/components/dom_distiller/core/viewer_unittest.cc index 75080b8..35e242f 100644 --- a/components/dom_distiller/core/viewer_unittest.cc +++ b/components/dom_distiller/core/viewer_unittest.cc @@ -75,9 +75,7 @@ class TestDomDistillerService : public DomDistillerServiceInterface { class DomDistillerViewerTest : public testing::Test { public: - virtual void SetUp() override { - service_.reset(new TestDomDistillerService()); - } + void SetUp() override { service_.reset(new TestDomDistillerService()); } protected: scoped_ptr<ViewerHandle> CreateViewRequest( diff --git a/components/dom_distiller/standalone/content_extractor.cc b/components/dom_distiller/standalone/content_extractor.cc index b6a5a4e..8f960b2 100644 --- a/components/dom_distiller/standalone/content_extractor.cc +++ b/components/dom_distiller/standalone/content_extractor.cc @@ -209,11 +209,9 @@ class ContentExtractionRequest : public ViewRequestDelegate { private: ContentExtractionRequest(const GURL& url) : url_(url) {} - virtual void OnArticleUpdated(ArticleDistillationUpdate article_update) - override {} + void OnArticleUpdated(ArticleDistillationUpdate article_update) override {} - virtual void OnArticleReady(const DistilledArticleProto* article_proto) - override { + void OnArticleReady(const DistilledArticleProto* article_proto) override { article_proto_ = article_proto; CHECK(article_proto->pages_size()) << "Failed extracting " << url_; base::MessageLoop::current()->PostTask( @@ -239,7 +237,7 @@ class ContentExtractor : public ContentBrowserTest { // Change behavior of the default host resolver to avoid DNS lookup errors, so // we can make network calls. - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { if (!CommandLine::ForCurrentProcess()->HasSwitch(kDisableDnsSwitch)) { EnableDNSLookupForThisTest(); } @@ -247,9 +245,7 @@ class ContentExtractor : public ContentBrowserTest { AddComponentsResources(); } - virtual void TearDownOnMainThread() override { - DisableDNSLookupForThisTest(); - } + void TearDownOnMainThread() override { DisableDNSLookupForThisTest(); } protected: // Creates the DomDistillerService and creates and starts the extraction |