diff options
author | dcheng <dcheng@chromium.org> | 2014-10-23 09:37:48 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-23 16:38:05 +0000 |
commit | 8f4b862cd59d29d615929c5c66ca3fe749914cd0 (patch) | |
tree | ed406e472b20e42dd5bdc819d812ee2a9435f8eb /chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc | |
parent | d28506ba1497a3f5fa5b9f6702892cb1cb58ea15 (diff) | |
download | chromium_src-8f4b862cd59d29d615929c5c66ca3fe749914cd0.zip chromium_src-8f4b862cd59d29d615929c5c66ca3fe749914cd0.tar.gz chromium_src-8f4b862cd59d29d615929c5c66ca3fe749914cd0.tar.bz2 |
Standardize usage of virtual/override/final in chrome/browser/prefs
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=gab@chromium.org
Review URL: https://codereview.chromium.org/668983002
Cr-Commit-Position: refs/heads/master@{#300903}
Diffstat (limited to 'chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc')
-rw-r--r-- | chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc b/chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc index 811235a..575fcea 100644 --- a/chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc +++ b/chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc @@ -17,40 +17,38 @@ class DictionaryPrefStore : public WriteablePrefStore { DictionaryPrefStore() : WriteablePrefStore() {} // Overrides from PrefStore. - virtual void AddObserver(Observer* observer) override { + void AddObserver(Observer* observer) override { observers_.AddObserver(observer); } - virtual void RemoveObserver(Observer* observer) override { + void RemoveObserver(Observer* observer) override { observers_.RemoveObserver(observer); } - virtual bool GetValue(const std::string& key, - const base::Value** result) const override { + bool GetValue(const std::string& key, + const base::Value** result) const override { return prefs_.Get(key, result); } // Overrides from WriteablePrefStore. - virtual void SetValue(const std::string& key, base::Value* value) override { + void SetValue(const std::string& key, base::Value* value) override { DCHECK(value); prefs_.Set(key, value); ReportValueChanged(key); } - virtual void RemoveValue(const std::string& key) override { + void RemoveValue(const std::string& key) override { if (prefs_.RemovePath(key, NULL)) ReportValueChanged(key); } - virtual bool GetMutableValue(const std::string& key, - base::Value** result) override { + bool GetMutableValue(const std::string& key, base::Value** result) override { return prefs_.Get(key, result); } - virtual void ReportValueChanged(const std::string& key) override {} + void ReportValueChanged(const std::string& key) override {} - virtual void SetValueSilently(const std::string& key, - base::Value* value) override { + void SetValueSilently(const std::string& key, base::Value* value) override { NOTIMPLEMENTED(); } @@ -60,7 +58,7 @@ class DictionaryPrefStore : public WriteablePrefStore { } private: - virtual ~DictionaryPrefStore() {} + ~DictionaryPrefStore() override {} base::DictionaryValue prefs_; ObserverList<PrefStore::Observer, true> observers_; |