diff options
author | dcheng <dcheng@chromium.org> | 2014-10-21 03:54:51 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-21 10:55:12 +0000 |
commit | 5648818ef9d5ef5fda79cd5dde2e42567af07785 (patch) | |
tree | c7a0e1c173409ad3a70736413504d6ba3c2b0422 /base/prefs | |
parent | 08038795458017a039565cfa158f0c379f91a007 (diff) | |
download | chromium_src-5648818ef9d5ef5fda79cd5dde2e42567af07785.zip chromium_src-5648818ef9d5ef5fda79cd5dde2e42567af07785.tar.gz chromium_src-5648818ef9d5ef5fda79cd5dde2e42567af07785.tar.bz2 |
Standardize usage of virtual/override/final in base/
BUG=417463
TBR=danakj@chromium.org
Review URL: https://codereview.chromium.org/668783004
Cr-Commit-Position: refs/heads/master@{#300447}
Diffstat (limited to 'base/prefs')
-rw-r--r-- | base/prefs/default_pref_store.h | 12 | ||||
-rw-r--r-- | base/prefs/default_pref_store_unittest.cc | 6 | ||||
-rw-r--r-- | base/prefs/json_pref_store.h | 38 | ||||
-rw-r--r-- | base/prefs/json_pref_store_unittest.cc | 8 | ||||
-rw-r--r-- | base/prefs/overlay_user_pref_store.h | 40 | ||||
-rw-r--r-- | base/prefs/persistent_pref_store.h | 2 | ||||
-rw-r--r-- | base/prefs/pref_change_registrar.h | 4 | ||||
-rw-r--r-- | base/prefs/pref_member.h | 4 | ||||
-rw-r--r-- | base/prefs/pref_notifier_impl.h | 6 | ||||
-rw-r--r-- | base/prefs/pref_registry_simple.h | 2 | ||||
-rw-r--r-- | base/prefs/pref_service.cc | 2 | ||||
-rw-r--r-- | base/prefs/pref_store_observer_mock.h | 6 | ||||
-rw-r--r-- | base/prefs/pref_value_store.h | 6 | ||||
-rw-r--r-- | base/prefs/testing_pref_service.h | 2 | ||||
-rw-r--r-- | base/prefs/testing_pref_store.h | 36 | ||||
-rw-r--r-- | base/prefs/value_map_pref_store.h | 24 | ||||
-rw-r--r-- | base/prefs/writeable_pref_store.h | 2 |
17 files changed, 96 insertions, 104 deletions
diff --git a/base/prefs/default_pref_store.h b/base/prefs/default_pref_store.h index 9939876..26462da 100644 --- a/base/prefs/default_pref_store.h +++ b/base/prefs/default_pref_store.h @@ -21,11 +21,11 @@ class BASE_PREFS_EXPORT DefaultPrefStore : public PrefStore { DefaultPrefStore(); // PrefStore implementation: - virtual bool GetValue(const std::string& key, - const base::Value** result) const override; - virtual void AddObserver(PrefStore::Observer* observer) override; - virtual void RemoveObserver(PrefStore::Observer* observer) override; - virtual bool HasObservers() const override; + bool GetValue(const std::string& key, + const base::Value** result) const override; + void AddObserver(PrefStore::Observer* observer) override; + void RemoveObserver(PrefStore::Observer* observer) override; + bool HasObservers() const override; // Sets a |value| for |key|. Should only be called if a value has not been // set yet; otherwise call ReplaceDefaultValue(). @@ -40,7 +40,7 @@ class BASE_PREFS_EXPORT DefaultPrefStore : public PrefStore { const_iterator end() const; private: - virtual ~DefaultPrefStore(); + ~DefaultPrefStore() override; PrefValueMap prefs_; diff --git a/base/prefs/default_pref_store_unittest.cc b/base/prefs/default_pref_store_unittest.cc index 3f28132..9299937 100644 --- a/base/prefs/default_pref_store_unittest.cc +++ b/base/prefs/default_pref_store_unittest.cc @@ -13,15 +13,15 @@ namespace { class MockPrefStoreObserver : public PrefStore::Observer { public: explicit MockPrefStoreObserver(DefaultPrefStore* pref_store); - virtual ~MockPrefStoreObserver(); + ~MockPrefStoreObserver() override; int change_count() { return change_count_; } // PrefStore::Observer implementation: - virtual void OnPrefValueChanged(const std::string& key) override; - virtual void OnInitializationCompleted(bool succeeded) override {} + void OnPrefValueChanged(const std::string& key) override; + void OnInitializationCompleted(bool succeeded) override {} private: DefaultPrefStore* pref_store_; diff --git a/base/prefs/json_pref_store.h b/base/prefs/json_pref_store.h index b6d0b19..16e431b 100644 --- a/base/prefs/json_pref_store.h +++ b/base/prefs/json_pref_store.h @@ -66,29 +66,27 @@ class BASE_PREFS_EXPORT JsonPrefStore scoped_ptr<PrefFilter> pref_filter); // PrefStore overrides: - virtual bool GetValue(const std::string& key, - const base::Value** result) const override; - virtual void AddObserver(PrefStore::Observer* observer) override; - virtual void RemoveObserver(PrefStore::Observer* observer) override; - virtual bool HasObservers() const override; - virtual bool IsInitializationComplete() const override; + bool GetValue(const std::string& key, + const base::Value** result) const override; + void AddObserver(PrefStore::Observer* observer) override; + void RemoveObserver(PrefStore::Observer* observer) override; + bool HasObservers() const override; + bool IsInitializationComplete() const override; // PersistentPrefStore overrides: - virtual bool GetMutableValue(const std::string& key, - base::Value** result) override; - virtual void SetValue(const std::string& key, base::Value* value) override; - virtual void SetValueSilently(const std::string& key, - base::Value* value) override; - virtual void RemoveValue(const std::string& key) override; - virtual bool ReadOnly() const override; - virtual PrefReadError GetReadError() const override; + bool GetMutableValue(const std::string& key, base::Value** result) override; + void SetValue(const std::string& key, base::Value* value) override; + void SetValueSilently(const std::string& key, base::Value* value) override; + void RemoveValue(const std::string& key) override; + bool ReadOnly() const override; + PrefReadError GetReadError() const override; // Note this method may be asynchronous if this instance has a |pref_filter_| // in which case it will return PREF_READ_ERROR_ASYNCHRONOUS_TASK_INCOMPLETE. // See details in pref_filter.h. - virtual PrefReadError ReadPrefs() override; - virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) override; - virtual void CommitPendingWrite() override; - virtual void ReportValueChanged(const std::string& key) override; + PrefReadError ReadPrefs() override; + void ReadPrefsAsync(ReadErrorDelegate* error_delegate) override; + void CommitPendingWrite() override; + void ReportValueChanged(const std::string& key) override; // Just like RemoveValue(), but doesn't notify observers. Used when doing some // cleanup that shouldn't otherwise alert observers. @@ -100,7 +98,7 @@ class BASE_PREFS_EXPORT JsonPrefStore const base::Closure& on_next_successful_write); private: - virtual ~JsonPrefStore(); + ~JsonPrefStore() override; // This method is called after the JSON file has been read. It then hands // |value| (or an empty dictionary in some read error cases) to the @@ -111,7 +109,7 @@ class BASE_PREFS_EXPORT JsonPrefStore void OnFileRead(scoped_ptr<ReadResult> read_result); // ImportantFileWriter::DataSerializer overrides: - virtual bool SerializeData(std::string* output) override; + bool SerializeData(std::string* output) override; // This method is called after the JSON file has been read and the result has // potentially been intercepted and modified by |pref_filter_|. diff --git a/base/prefs/json_pref_store_unittest.cc b/base/prefs/json_pref_store_unittest.cc index 45bf895..dc4043e 100644 --- a/base/prefs/json_pref_store_unittest.cc +++ b/base/prefs/json_pref_store_unittest.cc @@ -32,14 +32,14 @@ const char kHomePage[] = "homepage"; class InterceptingPrefFilter : public PrefFilter { public: InterceptingPrefFilter(); - virtual ~InterceptingPrefFilter(); + ~InterceptingPrefFilter() override; // PrefFilter implementation: - virtual void FilterOnLoad( + void FilterOnLoad( const PostFilterOnLoadCallback& post_filter_on_load_callback, scoped_ptr<base::DictionaryValue> pref_store_contents) override; - virtual void FilterUpdate(const std::string& path) override {} - virtual void FilterSerializeData( + void FilterUpdate(const std::string& path) override {} + void FilterSerializeData( base::DictionaryValue* pref_store_contents) override {} bool has_intercepted_prefs() const { return intercepted_prefs_ != NULL; } diff --git a/base/prefs/overlay_user_pref_store.h b/base/prefs/overlay_user_pref_store.h index 0e78230..5194a7b 100644 --- a/base/prefs/overlay_user_pref_store.h +++ b/base/prefs/overlay_user_pref_store.h @@ -30,37 +30,35 @@ class BASE_PREFS_EXPORT OverlayUserPrefStore : public PersistentPrefStore, virtual bool IsSetInOverlay(const std::string& key) const; // Methods of PrefStore. - virtual void AddObserver(PrefStore::Observer* observer) override; - virtual void RemoveObserver(PrefStore::Observer* observer) override; - virtual bool HasObservers() const override; - virtual bool IsInitializationComplete() const override; - virtual bool GetValue(const std::string& key, - const base::Value** result) const override; + void AddObserver(PrefStore::Observer* observer) override; + void RemoveObserver(PrefStore::Observer* observer) override; + bool HasObservers() const override; + bool IsInitializationComplete() const override; + bool GetValue(const std::string& key, + const base::Value** result) const override; // Methods of PersistentPrefStore. - virtual bool GetMutableValue(const std::string& key, - base::Value** result) override; - virtual void SetValue(const std::string& key, base::Value* value) override; - virtual void SetValueSilently(const std::string& key, - base::Value* value) override; - virtual void RemoveValue(const std::string& key) override; - virtual bool ReadOnly() const override; - virtual PrefReadError GetReadError() const override; - virtual PrefReadError ReadPrefs() override; - virtual void ReadPrefsAsync(ReadErrorDelegate* delegate) override; - virtual void CommitPendingWrite() override; - virtual void ReportValueChanged(const std::string& key) override; + bool GetMutableValue(const std::string& key, base::Value** result) override; + void SetValue(const std::string& key, base::Value* value) override; + void SetValueSilently(const std::string& key, base::Value* value) override; + void RemoveValue(const std::string& key) override; + bool ReadOnly() const override; + PrefReadError GetReadError() const override; + PrefReadError ReadPrefs() override; + void ReadPrefsAsync(ReadErrorDelegate* delegate) override; + void CommitPendingWrite() override; + void ReportValueChanged(const std::string& key) override; // Methods of PrefStore::Observer. - virtual void OnPrefValueChanged(const std::string& key) override; - virtual void OnInitializationCompleted(bool succeeded) override; + void OnPrefValueChanged(const std::string& key) override; + void OnInitializationCompleted(bool succeeded) override; void RegisterOverlayPref(const std::string& key); void RegisterOverlayPref(const std::string& overlay_key, const std::string& underlay_key); protected: - virtual ~OverlayUserPrefStore(); + ~OverlayUserPrefStore() override; private: typedef std::map<std::string, std::string> NamesMap; diff --git a/base/prefs/persistent_pref_store.h b/base/prefs/persistent_pref_store.h index 093ea8d5..e70e2a6 100644 --- a/base/prefs/persistent_pref_store.h +++ b/base/prefs/persistent_pref_store.h @@ -68,7 +68,7 @@ class BASE_PREFS_EXPORT PersistentPrefStore : public WriteablePrefStore { virtual void CommitPendingWrite() = 0; protected: - virtual ~PersistentPrefStore() {} + ~PersistentPrefStore() override {} }; #endif // BASE_PREFS_PERSISTENT_PREF_STORE_H_ diff --git a/base/prefs/pref_change_registrar.h b/base/prefs/pref_change_registrar.h index 693d3e7..70c22fe 100644 --- a/base/prefs/pref_change_registrar.h +++ b/base/prefs/pref_change_registrar.h @@ -64,8 +64,8 @@ class BASE_PREFS_EXPORT PrefChangeRegistrar : public PrefObserver { private: // PrefObserver: - virtual void OnPreferenceChanged(PrefService* service, - const std::string& pref_name) override; + void OnPreferenceChanged(PrefService* service, + const std::string& pref_name) override; static void InvokeUnnamedCallback(const base::Closure& callback, const std::string& pref_name); diff --git a/base/prefs/pref_member.h b/base/prefs/pref_member.h index fc27793..a05d60e 100644 --- a/base/prefs/pref_member.h +++ b/base/prefs/pref_member.h @@ -116,8 +116,8 @@ class BASE_PREFS_EXPORT PrefMemberBase : public PrefObserver { const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); // PrefObserver - virtual void OnPreferenceChanged(PrefService* service, - const std::string& pref_name) override; + void OnPreferenceChanged(PrefService* service, + const std::string& pref_name) override; void VerifyValuePrefName() const { DCHECK(!pref_name_.empty()); diff --git a/base/prefs/pref_notifier_impl.h b/base/prefs/pref_notifier_impl.h index 1aa243f..3f4c254 100644 --- a/base/prefs/pref_notifier_impl.h +++ b/base/prefs/pref_notifier_impl.h @@ -25,7 +25,7 @@ class BASE_PREFS_EXPORT PrefNotifierImpl public: PrefNotifierImpl(); explicit PrefNotifierImpl(PrefService* pref_service); - virtual ~PrefNotifierImpl(); + ~PrefNotifierImpl() override; // If the pref at the given path changes, we call the observer's // OnPreferenceChanged method. @@ -41,8 +41,8 @@ class BASE_PREFS_EXPORT PrefNotifierImpl protected: // PrefNotifier overrides. - virtual void OnPreferenceChanged(const std::string& pref_name) override; - virtual void OnInitializationCompleted(bool succeeded) override; + void OnPreferenceChanged(const std::string& pref_name) override; + void OnInitializationCompleted(bool succeeded) override; // A map from pref names to a list of observers. Observers get fired in the // order they are added. These should only be accessed externally for unit diff --git a/base/prefs/pref_registry_simple.h b/base/prefs/pref_registry_simple.h index 50b6467..41fe590 100644 --- a/base/prefs/pref_registry_simple.h +++ b/base/prefs/pref_registry_simple.h @@ -36,7 +36,7 @@ class BASE_PREFS_EXPORT PrefRegistrySimple : public PrefRegistry { int64 default_value); private: - virtual ~PrefRegistrySimple(); + ~PrefRegistrySimple() override; DISALLOW_COPY_AND_ASSIGN(PrefRegistrySimple); }; diff --git a/base/prefs/pref_service.cc b/base/prefs/pref_service.cc index bc86ac1..433f814 100644 --- a/base/prefs/pref_service.cc +++ b/base/prefs/pref_service.cc @@ -28,7 +28,7 @@ class ReadErrorHandler : public PersistentPrefStore::ReadErrorDelegate { ReadErrorHandler(base::Callback<void(PersistentPrefStore::PrefReadError)> cb) : callback_(cb) {} - virtual void OnError(PersistentPrefStore::PrefReadError error) override { + void OnError(PersistentPrefStore::PrefReadError error) override { callback_.Run(error); } diff --git a/base/prefs/pref_store_observer_mock.h b/base/prefs/pref_store_observer_mock.h index de7cc9d..1b24b4e 100644 --- a/base/prefs/pref_store_observer_mock.h +++ b/base/prefs/pref_store_observer_mock.h @@ -16,13 +16,13 @@ class PrefStoreObserverMock : public PrefStore::Observer { public: PrefStoreObserverMock(); - virtual ~PrefStoreObserverMock(); + ~PrefStoreObserverMock() override; void VerifyAndResetChangedKey(const std::string& expected); // PrefStore::Observer implementation - virtual void OnPrefValueChanged(const std::string& key) override; - virtual void OnInitializationCompleted(bool success) override; + void OnPrefValueChanged(const std::string& key) override; + void OnInitializationCompleted(bool success) override; std::vector<std::string> changed_keys; bool initialized; diff --git a/base/prefs/pref_value_store.h b/base/prefs/pref_value_store.h index a0409ef..db82a82 100644 --- a/base/prefs/pref_value_store.h +++ b/base/prefs/pref_value_store.h @@ -149,7 +149,7 @@ class BASE_PREFS_EXPORT PrefValueStore { class PrefStoreKeeper : public PrefStore::Observer { public: PrefStoreKeeper(); - virtual ~PrefStoreKeeper(); + ~PrefStoreKeeper() override; // Takes ownership of |pref_store|. void Initialize(PrefValueStore* store, @@ -161,8 +161,8 @@ class BASE_PREFS_EXPORT PrefValueStore { private: // PrefStore::Observer implementation. - virtual void OnPrefValueChanged(const std::string& key) override; - virtual void OnInitializationCompleted(bool succeeded) override; + void OnPrefValueChanged(const std::string& key) override; + void OnInitializationCompleted(bool succeeded) override; // PrefValueStore this keeper is part of. PrefValueStore* pref_value_store_; diff --git a/base/prefs/testing_pref_service.h b/base/prefs/testing_pref_service.h index a9ab937..2f6d494 100644 --- a/base/prefs/testing_pref_service.h +++ b/base/prefs/testing_pref_service.h @@ -84,7 +84,7 @@ class TestingPrefServiceSimple : public TestingPrefServiceBase<PrefService, PrefRegistry> { public: TestingPrefServiceSimple(); - virtual ~TestingPrefServiceSimple(); + ~TestingPrefServiceSimple() override; // This is provided as a convenience for registering preferences on // an existing TestingPrefServiceSimple instance. On a production diff --git a/base/prefs/testing_pref_store.h b/base/prefs/testing_pref_store.h index aa2bd80..866b4ae 100644 --- a/base/prefs/testing_pref_store.h +++ b/base/prefs/testing_pref_store.h @@ -21,26 +21,24 @@ class TestingPrefStore : public PersistentPrefStore { TestingPrefStore(); // Overriden from PrefStore. - virtual bool GetValue(const std::string& key, - const base::Value** result) const override; - virtual void AddObserver(PrefStore::Observer* observer) override; - virtual void RemoveObserver(PrefStore::Observer* observer) override; - virtual bool HasObservers() const override; - virtual bool IsInitializationComplete() const override; + bool GetValue(const std::string& key, + const base::Value** result) const override; + void AddObserver(PrefStore::Observer* observer) override; + void RemoveObserver(PrefStore::Observer* observer) override; + bool HasObservers() const override; + bool IsInitializationComplete() const override; // PersistentPrefStore overrides: - virtual bool GetMutableValue(const std::string& key, - base::Value** result) override; - virtual void ReportValueChanged(const std::string& key) override; - virtual void SetValue(const std::string& key, base::Value* value) override; - virtual void SetValueSilently(const std::string& key, - base::Value* value) override; - virtual void RemoveValue(const std::string& key) override; - virtual bool ReadOnly() const override; - virtual PrefReadError GetReadError() const override; - virtual PersistentPrefStore::PrefReadError ReadPrefs() override; - virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) override; - virtual void CommitPendingWrite() override; + bool GetMutableValue(const std::string& key, base::Value** result) override; + void ReportValueChanged(const std::string& key) override; + void SetValue(const std::string& key, base::Value* value) override; + void SetValueSilently(const std::string& key, base::Value* value) override; + void RemoveValue(const std::string& key) override; + bool ReadOnly() const override; + PrefReadError GetReadError() const override; + PersistentPrefStore::PrefReadError ReadPrefs() override; + void ReadPrefsAsync(ReadErrorDelegate* error_delegate) override; + void CommitPendingWrite() override; // Marks the store as having completed initialization. void SetInitializationCompleted(); @@ -72,7 +70,7 @@ class TestingPrefStore : public PersistentPrefStore { bool committed() { return committed_; } protected: - virtual ~TestingPrefStore(); + ~TestingPrefStore() override; private: // Stores the preference values. diff --git a/base/prefs/value_map_pref_store.h b/base/prefs/value_map_pref_store.h index d90d0c0..8c515ed 100644 --- a/base/prefs/value_map_pref_store.h +++ b/base/prefs/value_map_pref_store.h @@ -21,23 +21,21 @@ class BASE_PREFS_EXPORT ValueMapPrefStore : public WriteablePrefStore { ValueMapPrefStore(); // PrefStore overrides: - virtual bool GetValue(const std::string& key, - const base::Value** value) const override; - virtual void AddObserver(PrefStore::Observer* observer) override; - virtual void RemoveObserver(PrefStore::Observer* observer) override; - virtual bool HasObservers() const override; + bool GetValue(const std::string& key, + const base::Value** value) const override; + void AddObserver(PrefStore::Observer* observer) override; + void RemoveObserver(PrefStore::Observer* observer) override; + bool HasObservers() const override; // WriteablePrefStore overrides: - virtual void SetValue(const std::string& key, base::Value* value) override; - virtual void RemoveValue(const std::string& key) override; - virtual bool GetMutableValue(const std::string& key, - base::Value** value) override; - virtual void ReportValueChanged(const std::string& key) override; - virtual void SetValueSilently(const std::string& key, - base::Value* value) override; + void SetValue(const std::string& key, base::Value* value) override; + void RemoveValue(const std::string& key) override; + bool GetMutableValue(const std::string& key, base::Value** value) override; + void ReportValueChanged(const std::string& key) override; + void SetValueSilently(const std::string& key, base::Value* value) override; protected: - virtual ~ValueMapPrefStore(); + ~ValueMapPrefStore() override; // Notify observers about the initialization completed event. void NotifyInitializationCompleted(); diff --git a/base/prefs/writeable_pref_store.h b/base/prefs/writeable_pref_store.h index d320dcf..5ebab64 100644 --- a/base/prefs/writeable_pref_store.h +++ b/base/prefs/writeable_pref_store.h @@ -43,7 +43,7 @@ class BASE_PREFS_EXPORT WriteablePrefStore : public PrefStore { virtual void SetValueSilently(const std::string& key, base::Value* value) = 0; protected: - virtual ~WriteablePrefStore() {} + ~WriteablePrefStore() override {} private: DISALLOW_COPY_AND_ASSIGN(WriteablePrefStore); |