diff options
31 files changed, 168 insertions, 190 deletions
diff --git a/chrome/browser/prefs/browser_ui_prefs_migrator.h b/chrome/browser/prefs/browser_ui_prefs_migrator.h index 9c8aec3..7094aca 100644 --- a/chrome/browser/prefs/browser_ui_prefs_migrator.h +++ b/chrome/browser/prefs/browser_ui_prefs_migrator.h @@ -24,13 +24,13 @@ class BrowserUIPrefsMigrator : public PrefStore::Observer { explicit BrowserUIPrefsMigrator(WriteablePrefStore* pref_store); // Overrides from 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; private: friend struct base::DefaultDeleter<BrowserUIPrefsMigrator>; - virtual ~BrowserUIPrefsMigrator(); + ~BrowserUIPrefsMigrator() override; WriteablePrefStore* pref_store_; 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_; diff --git a/chrome/browser/prefs/command_line_pref_store.h b/chrome/browser/prefs/command_line_pref_store.h index e614c8e..a9b9382 100644 --- a/chrome/browser/prefs/command_line_pref_store.h +++ b/chrome/browser/prefs/command_line_pref_store.h @@ -17,7 +17,7 @@ class CommandLinePrefStore : public ValueMapPrefStore { explicit CommandLinePrefStore(const base::CommandLine* command_line); protected: - virtual ~CommandLinePrefStore(); + ~CommandLinePrefStore() override; // Logs a message and returns false if the proxy switches are // self-contradictory. Protected so it can be used in unit testing. diff --git a/chrome/browser/prefs/command_line_pref_store_unittest.cc b/chrome/browser/prefs/command_line_pref_store_unittest.cc index cd5ad93..c4d2490 100644 --- a/chrome/browser/prefs/command_line_pref_store_unittest.cc +++ b/chrome/browser/prefs/command_line_pref_store_unittest.cc @@ -59,7 +59,7 @@ class TestCommandLinePrefStore : public CommandLinePrefStore { } private: - virtual ~TestCommandLinePrefStore() {} + ~TestCommandLinePrefStore() override {} }; // Tests a simple string pref on the command line. diff --git a/chrome/browser/prefs/leveldb_pref_store.h b/chrome/browser/prefs/leveldb_pref_store.h index 0f74127..0b6b052 100644 --- a/chrome/browser/prefs/leveldb_pref_store.h +++ b/chrome/browser/prefs/leveldb_pref_store.h @@ -37,33 +37,31 @@ class LevelDBPrefStore : public PersistentPrefStore { base::SequencedTaskRunner* sequenced_task_runner); // 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; + bool GetMutableValue(const std::string& key, base::Value** result) override; // Takes ownership of value. - 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* error_delegate) override; - virtual void CommitPendingWrite() override; - virtual 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; + PrefReadError ReadPrefs() override; + void ReadPrefsAsync(ReadErrorDelegate* error_delegate) override; + void CommitPendingWrite() override; + void ReportValueChanged(const std::string& key) override; private: struct ReadingResults; class FileThreadSerializer; - virtual ~LevelDBPrefStore(); + ~LevelDBPrefStore() override; static scoped_ptr<ReadingResults> DoReading(const base::FilePath& path); static void OpenDB(const base::FilePath& path, diff --git a/chrome/browser/prefs/pref_metrics_service.h b/chrome/browser/prefs/pref_metrics_service.h index 2b6c67e..0335817 100644 --- a/chrome/browser/prefs/pref_metrics_service.h +++ b/chrome/browser/prefs/pref_metrics_service.h @@ -23,7 +23,7 @@ class PrefRegistrySimple; class PrefMetricsService : public KeyedService { public: explicit PrefMetricsService(Profile* profile); - virtual ~PrefMetricsService(); + ~PrefMetricsService() override; class Factory : public BrowserContextKeyedServiceFactory { public: @@ -33,14 +33,14 @@ class PrefMetricsService : public KeyedService { friend struct DefaultSingletonTraits<Factory>; Factory(); - virtual ~Factory(); + ~Factory() override; // BrowserContextKeyedServiceFactory implementation - virtual KeyedService* BuildServiceInstanceFor( + KeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const override; - virtual bool ServiceIsCreatedWithBrowserContext() const override; - virtual bool ServiceIsNULLWhileTesting() const override; - virtual content::BrowserContext* GetBrowserContextToUse( + bool ServiceIsCreatedWithBrowserContext() const override; + bool ServiceIsNULLWhileTesting() const override; + content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; }; diff --git a/chrome/browser/prefs/pref_model_associator.h b/chrome/browser/prefs/pref_model_associator.h index 2c20f04..4e72722 100644 --- a/chrome/browser/prefs/pref_model_associator.h +++ b/chrome/browser/prefs/pref_model_associator.h @@ -38,23 +38,22 @@ class PrefModelAssociator public base::NonThreadSafe { public: explicit PrefModelAssociator(syncer::ModelType type); - virtual ~PrefModelAssociator(); + ~PrefModelAssociator() override; // See description above field for details. bool models_associated() const { return models_associated_; } // syncer::SyncableService implementation. - virtual syncer::SyncDataList GetAllSyncData( - syncer::ModelType type) const override; - virtual syncer::SyncError ProcessSyncChanges( + syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; + syncer::SyncError ProcessSyncChanges( const tracked_objects::Location& from_here, const syncer::SyncChangeList& change_list) override; - virtual syncer::SyncMergeResult MergeDataAndStartSyncing( + syncer::SyncMergeResult MergeDataAndStartSyncing( syncer::ModelType type, const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) override; - virtual void StopSyncing(syncer::ModelType type) override; + void StopSyncing(syncer::ModelType type) override; // Returns the list of preference names that are registered as syncable, and // hence should be monitored for changes. diff --git a/chrome/browser/prefs/pref_service_browsertest.cc b/chrome/browser/prefs/pref_service_browsertest.cc index 72be947..c8134be 100644 --- a/chrome/browser/prefs/pref_service_browsertest.cc +++ b/chrome/browser/prefs/pref_service_browsertest.cc @@ -54,7 +54,7 @@ class PreferenceServiceTest : public InProcessBrowserTest { explicit PreferenceServiceTest(bool new_profile) : new_profile_(new_profile) { } - virtual bool SetUpUserDataDirectory() override { + bool SetUpUserDataDirectory() override { base::FilePath user_data_directory; PathService::Get(chrome::DIR_USER_DATA, &user_data_directory); diff --git a/chrome/browser/prefs/pref_service_mock_factory.h b/chrome/browser/prefs/pref_service_mock_factory.h index 44617e8..ab9bc26 100644 --- a/chrome/browser/prefs/pref_service_mock_factory.h +++ b/chrome/browser/prefs/pref_service_mock_factory.h @@ -11,7 +11,7 @@ class PrefServiceMockFactory : public PrefServiceSyncableFactory { public: PrefServiceMockFactory(); - virtual ~PrefServiceMockFactory(); + ~PrefServiceMockFactory() override; private: DISALLOW_COPY_AND_ASSIGN(PrefServiceMockFactory); diff --git a/chrome/browser/prefs/pref_service_syncable.h b/chrome/browser/prefs/pref_service_syncable.h index fd799b3..c1b4960 100644 --- a/chrome/browser/prefs/pref_service_syncable.h +++ b/chrome/browser/prefs/pref_service_syncable.h @@ -44,7 +44,7 @@ class PrefServiceSyncable : public PrefService { base::Callback<void(PersistentPrefStore::PrefReadError)> read_error_callback, bool async); - virtual ~PrefServiceSyncable(); + ~PrefServiceSyncable() override; // Creates an incognito copy of the pref service that shares most pref stores // but uses a fresh non-persistent overlay for the user pref store and an @@ -79,7 +79,7 @@ class PrefServiceSyncable : public PrefService { syncer::SyncableService* GetSyncableService(const syncer::ModelType& type); // Do not call this after having derived an incognito or per tab pref service. - virtual void UpdateCommandLinePrefStore(PrefStore* cmd_line_store) override; + void UpdateCommandLinePrefStore(PrefStore* cmd_line_store) override; void AddSyncedPrefObserver(const std::string& name, SyncedPrefObserver* observer); diff --git a/chrome/browser/prefs/pref_service_syncable_factory.h b/chrome/browser/prefs/pref_service_syncable_factory.h index b3d326c..ff57059 100644 --- a/chrome/browser/prefs/pref_service_syncable_factory.h +++ b/chrome/browser/prefs/pref_service_syncable_factory.h @@ -27,7 +27,7 @@ class PrefRegistrySyncable; class PrefServiceSyncableFactory : public base::PrefServiceFactory { public: PrefServiceSyncableFactory(); - virtual ~PrefServiceSyncableFactory(); + ~PrefServiceSyncableFactory() override; #if defined(ENABLE_CONFIGURATION_POLICY) // Set up policy pref stores using the given policy service. diff --git a/chrome/browser/prefs/prefs_syncable_service_unittest.cc b/chrome/browser/prefs/prefs_syncable_service_unittest.cc index 2f20316..462c46d 100644 --- a/chrome/browser/prefs/prefs_syncable_service_unittest.cc +++ b/chrome/browser/prefs/prefs_syncable_service_unittest.cc @@ -40,7 +40,7 @@ class TestSyncProcessorStub : public syncer::SyncChangeProcessor { public: explicit TestSyncProcessorStub(syncer::SyncChangeList* output) : output_(output), fail_next_(false) {} - virtual syncer::SyncError ProcessSyncChanges( + syncer::SyncError ProcessSyncChanges( const tracked_objects::Location& from_here, const syncer::SyncChangeList& change_list) override { if (output_) @@ -58,8 +58,7 @@ class TestSyncProcessorStub : public syncer::SyncChangeProcessor { fail_next_ = true; } - virtual syncer::SyncDataList GetAllSyncData(syncer::ModelType type) - const override { + syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override { return syncer::SyncDataList(); } private: diff --git a/chrome/browser/prefs/profile_pref_store_manager_unittest.cc b/chrome/browser/prefs/profile_pref_store_manager_unittest.cc index a552d86..bc9d983 100644 --- a/chrome/browser/prefs/profile_pref_store_manager_unittest.cc +++ b/chrome/browser/prefs/profile_pref_store_manager_unittest.cc @@ -51,7 +51,7 @@ class RegistryVerifier : public PrefStore::Observer { : pref_registry_(pref_registry) {} // PrefStore::Observer implementation - virtual void OnPrefValueChanged(const std::string& key) override { + void OnPrefValueChanged(const std::string& key) override { EXPECT_TRUE(pref_registry_->end() != std::find_if(pref_registry_->begin(), pref_registry_->end(), @@ -59,7 +59,7 @@ class RegistryVerifier : public PrefStore::Observer { << "Unregistered key " << key << " was changed."; } - virtual void OnInitializationCompleted(bool succeeded) override {} + void OnInitializationCompleted(bool succeeded) override {} private: scoped_refptr<PrefRegistry> pref_registry_; diff --git a/chrome/browser/prefs/synced_pref_change_registrar.h b/chrome/browser/prefs/synced_pref_change_registrar.h index 8acc1e7..66d6bc5 100644 --- a/chrome/browser/prefs/synced_pref_change_registrar.h +++ b/chrome/browser/prefs/synced_pref_change_registrar.h @@ -43,8 +43,7 @@ class SyncedPrefChangeRegistrar : public SyncedPrefObserver { private: // SyncedPrefObserver implementation - virtual void OnSyncedPrefChanged(const std::string& path, bool from_sync) - override; + void OnSyncedPrefChanged(const std::string& path, bool from_sync) override; typedef std::map<std::string, NamedChangeCallback> ObserverMap; diff --git a/chrome/browser/prefs/synced_pref_change_registrar_browsertest.cc b/chrome/browser/prefs/synced_pref_change_registrar_browsertest.cc index 939aff4..f99ea75 100644 --- a/chrome/browser/prefs/synced_pref_change_registrar_browsertest.cc +++ b/chrome/browser/prefs/synced_pref_change_registrar_browsertest.cc @@ -94,7 +94,7 @@ class SyncedPrefChangeRegistrarTest : public InProcessBrowserTest { private: #if defined(ENABLE_CONFIGURATION_POLICY) - virtual void SetUpInProcessBrowserTestFixture() override { + void SetUpInProcessBrowserTestFixture() override { EXPECT_CALL(policy_provider_, IsInitializationComplete(_)) .WillRepeatedly(Return(true)); policy::BrowserPolicyConnector::SetPolicyProviderForTesting( @@ -102,7 +102,7 @@ class SyncedPrefChangeRegistrarTest : public InProcessBrowserTest { } #endif - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { prefs_ = PrefServiceSyncable::FromProfile(browser()->profile()); syncer_ = prefs_->GetSyncableService(syncer::PREFERENCES); syncer_->MergeDataAndStartSyncing( @@ -114,9 +114,7 @@ class SyncedPrefChangeRegistrarTest : public InProcessBrowserTest { registrar_.reset(new SyncedPrefChangeRegistrar(prefs_)); } - virtual void TearDownOnMainThread() override { - registrar_.reset(); - } + void TearDownOnMainThread() override { registrar_.reset(); } PrefServiceSyncable* prefs_; syncer::SyncableService* syncer_; diff --git a/chrome/browser/prefs/tracked/dictionary_hash_store_contents.cc b/chrome/browser/prefs/tracked/dictionary_hash_store_contents.cc index 50cc479..7b6f542 100644 --- a/chrome/browser/prefs/tracked/dictionary_hash_store_contents.cc +++ b/chrome/browser/prefs/tracked/dictionary_hash_store_contents.cc @@ -21,7 +21,7 @@ class MutablePreferenceMacDictionary explicit MutablePreferenceMacDictionary(base::DictionaryValue* storage); // MutableDictionary implementation - virtual base::DictionaryValue* operator->() override; + base::DictionaryValue* operator->() override; private: base::DictionaryValue* storage_; diff --git a/chrome/browser/prefs/tracked/dictionary_hash_store_contents.h b/chrome/browser/prefs/tracked/dictionary_hash_store_contents.h index f3317c8..fc29db5 100644 --- a/chrome/browser/prefs/tracked/dictionary_hash_store_contents.h +++ b/chrome/browser/prefs/tracked/dictionary_hash_store_contents.h @@ -31,13 +31,13 @@ class DictionaryHashStoreContents : public HashStoreContents { static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); // HashStoreContents implementation - virtual std::string hash_store_id() const override; - virtual void Reset() override; - virtual bool IsInitialized() const override; - virtual const base::DictionaryValue* GetContents() const override; - virtual scoped_ptr<MutableDictionary> GetMutableContents() override; - virtual std::string GetSuperMac() const override; - virtual void SetSuperMac(const std::string& super_mac) override; + std::string hash_store_id() const override; + void Reset() override; + bool IsInitialized() const override; + const base::DictionaryValue* GetContents() const override; + scoped_ptr<MutableDictionary> GetMutableContents() override; + std::string GetSuperMac() const override; + void SetSuperMac(const std::string& super_mac) override; private: base::DictionaryValue* storage_; diff --git a/chrome/browser/prefs/tracked/interceptable_pref_filter.h b/chrome/browser/prefs/tracked/interceptable_pref_filter.h index 3a70ab3..aacbfc7 100644 --- a/chrome/browser/prefs/tracked/interceptable_pref_filter.h +++ b/chrome/browser/prefs/tracked/interceptable_pref_filter.h @@ -33,10 +33,10 @@ class InterceptablePrefFilter scoped_ptr<base::DictionaryValue> prefs)> FilterOnLoadInterceptor; InterceptablePrefFilter(); - virtual ~InterceptablePrefFilter(); + ~InterceptablePrefFilter() override; // PrefFilter partial implementation. - virtual void FilterOnLoad( + void FilterOnLoad( const PostFilterOnLoadCallback& post_filter_on_load_callback, scoped_ptr<base::DictionaryValue> pref_store_contents) override; diff --git a/chrome/browser/prefs/tracked/mock_validation_delegate.h b/chrome/browser/prefs/tracked/mock_validation_delegate.h index e572508..7fbb204 100644 --- a/chrome/browser/prefs/tracked/mock_validation_delegate.h +++ b/chrome/browser/prefs/tracked/mock_validation_delegate.h @@ -35,7 +35,7 @@ class MockValidationDelegate : public TrackedPreferenceValidationDelegate { }; MockValidationDelegate(); - virtual ~MockValidationDelegate(); + ~MockValidationDelegate() override; // Returns the number of recorded validations. size_t recorded_validations_count() const { return validations_.size(); } @@ -48,12 +48,12 @@ class MockValidationDelegate : public TrackedPreferenceValidationDelegate { const ValidationEvent* GetEventForPath(const std::string& pref_path) const; // TrackedPreferenceValidationDelegate implementation. - virtual void OnAtomicPreferenceValidation( + void OnAtomicPreferenceValidation( const std::string& pref_path, const base::Value* value, PrefHashStoreTransaction::ValueState value_state, TrackedPreferenceHelper::ResetAction reset_action) override; - virtual void OnSplitPreferenceValidation( + void OnSplitPreferenceValidation( const std::string& pref_path, const base::DictionaryValue* dict_value, const std::vector<std::string>& invalid_keys, diff --git a/chrome/browser/prefs/tracked/pref_hash_browsertest.cc b/chrome/browser/prefs/tracked/pref_hash_browsertest.cc index 155ce31..d60b998 100644 --- a/chrome/browser/prefs/tracked/pref_hash_browsertest.cc +++ b/chrome/browser/prefs/tracked/pref_hash_browsertest.cc @@ -147,7 +147,7 @@ class PrefHashBrowserTestBase : protection_level_(GetProtectionLevelFromTrialGroup(GetParam())) { } - virtual void SetUpCommandLine(CommandLine* command_line) override { + void SetUpCommandLine(CommandLine* command_line) override { ExtensionBrowserTest::SetUpCommandLine(command_line); EXPECT_FALSE(command_line->HasSwitch(switches::kForceFieldTrials)); command_line->AppendSwitchASCII( @@ -160,7 +160,7 @@ class PrefHashBrowserTestBase #endif } - virtual bool SetUpUserDataDirectory() override { + bool SetUpUserDataDirectory() override { // Do the normal setup in the PRE test and attack preferences in the main // test. if (IsPRETest()) @@ -231,7 +231,7 @@ class PrefHashBrowserTestBase // In the PRE_ test, find the number of tracked preferences that were // initialized and save it to a file to be read back in the main test and used // as the total number of tracked preferences. - virtual void SetUpOnMainThread() override { + void SetUpOnMainThread() override { ExtensionBrowserTest::SetUpOnMainThread(); // File in which the PRE_ test will save the number of tracked preferences @@ -354,17 +354,17 @@ class PrefHashBrowserTestBase // Also sanity checks that the expected preferences files are in place. class PrefHashBrowserTestUnchangedDefault : public PrefHashBrowserTestBase { public: - virtual void SetupPreferences() override { + void SetupPreferences() override { // Default Chrome setup. } - virtual void AttackPreferencesOnDisk( + void AttackPreferencesOnDisk( base::DictionaryValue* unprotected_preferences, base::DictionaryValue* protected_preferences) override { // No attack. } - virtual void VerifyReactionToPrefAttack() override { + void VerifyReactionToPrefAttack() override { // Expect all prefs to be reported as Unchanged with no resets. EXPECT_EQ(protection_level_ > PROTECTION_DISABLED_ON_PLATFORM ? num_tracked_prefs() : 0, @@ -408,14 +408,14 @@ PREF_HASH_BROWSER_TEST(PrefHashBrowserTestUnchangedDefault, UnchangedDefault); class PrefHashBrowserTestUnchangedCustom : public PrefHashBrowserTestUnchangedDefault { public: - virtual void SetupPreferences() override { + void SetupPreferences() override { profile()->GetPrefs()->SetString(prefs::kHomePage, "http://example.com"); InstallExtensionWithUIAutoConfirm( test_data_dir_.AppendASCII("good.crx"), 1, browser()); } - virtual void VerifyReactionToPrefAttack() override { + void VerifyReactionToPrefAttack() override { // Make sure the settings written in the last run stuck. EXPECT_EQ("http://example.com", profile()->GetPrefs()->GetString(prefs::kHomePage)); @@ -432,11 +432,11 @@ PREF_HASH_BROWSER_TEST(PrefHashBrowserTestUnchangedCustom, UnchangedCustom); // Verifies that cleared prefs are reported. class PrefHashBrowserTestClearedAtomic : public PrefHashBrowserTestBase { public: - virtual void SetupPreferences() override { + void SetupPreferences() override { profile()->GetPrefs()->SetString(prefs::kHomePage, "http://example.com"); } - virtual void AttackPreferencesOnDisk( + void AttackPreferencesOnDisk( base::DictionaryValue* unprotected_preferences, base::DictionaryValue* protected_preferences) override { base::DictionaryValue* selected_prefs = @@ -448,7 +448,7 @@ class PrefHashBrowserTestClearedAtomic : public PrefHashBrowserTestBase { EXPECT_TRUE(selected_prefs->Remove(prefs::kHomePage, NULL)); } - virtual void VerifyReactionToPrefAttack() override { + void VerifyReactionToPrefAttack() override { // The clearance of homepage should have been noticed (as pref #2 being // cleared), but shouldn't have triggered a reset (as there is nothing we // can do when the pref is already gone). @@ -492,7 +492,7 @@ PREF_HASH_BROWSER_TEST(PrefHashBrowserTestClearedAtomic, ClearedAtomic); // non-null protected prefs. class PrefHashBrowserTestUntrustedInitialized : public PrefHashBrowserTestBase { public: - virtual void SetupPreferences() override { + void SetupPreferences() override { // Explicitly set the DSE (it's otherwise NULL by default, preventing // thorough testing of the PROTECTION_ENABLED_DSE level). DefaultSearchManager default_search_manager( @@ -516,7 +516,7 @@ class PrefHashBrowserTestUntrustedInitialized : public PrefHashBrowserTestBase { SessionStartupPref::URLS); } - virtual void AttackPreferencesOnDisk( + void AttackPreferencesOnDisk( base::DictionaryValue* unprotected_preferences, base::DictionaryValue* protected_preferences) override { EXPECT_TRUE(unprotected_preferences->Remove("protection.macs", NULL)); @@ -524,7 +524,7 @@ class PrefHashBrowserTestUntrustedInitialized : public PrefHashBrowserTestBase { EXPECT_TRUE(protected_preferences->Remove("protection.macs", NULL)); } - virtual void VerifyReactionToPrefAttack() override { + void VerifyReactionToPrefAttack() override { // Preferences that are NULL by default will be NullInitialized. int num_null_values = GetTrackedPrefHistogramCount( "Settings.TrackedPreferenceNullInitialized", ALLOW_ANY); @@ -613,7 +613,7 @@ PREF_HASH_BROWSER_TEST(PrefHashBrowserTestUntrustedInitialized, // if the protection level allows it). class PrefHashBrowserTestChangedAtomic : public PrefHashBrowserTestBase { public: - virtual void SetupPreferences() override { + void SetupPreferences() override { profile()->GetPrefs()->SetInteger(prefs::kRestoreOnStartup, SessionStartupPref::URLS); @@ -622,7 +622,7 @@ class PrefHashBrowserTestChangedAtomic : public PrefHashBrowserTestBase { update->AppendString("http://example.com"); } - virtual void AttackPreferencesOnDisk( + void AttackPreferencesOnDisk( base::DictionaryValue* unprotected_preferences, base::DictionaryValue* protected_preferences) override { base::DictionaryValue* selected_prefs = @@ -639,7 +639,7 @@ class PrefHashBrowserTestChangedAtomic : public PrefHashBrowserTestBase { startup_urls->AppendString("http://example.org"); } - virtual void VerifyReactionToPrefAttack() override { + void VerifyReactionToPrefAttack() override { // Expect a single Changed event for tracked pref #4 (startup URLs). EXPECT_EQ(protection_level_ > PROTECTION_DISABLED_ON_PLATFORM ? 1 : 0, GetTrackedPrefHistogramCount("Settings.TrackedPreferenceChanged", @@ -695,12 +695,12 @@ PREF_HASH_BROWSER_TEST(PrefHashBrowserTestChangedAtomic, ChangedAtomic); // items being reported (and remove if the protection level allows it). class PrefHashBrowserTestChangedSplitPref : public PrefHashBrowserTestBase { public: - virtual void SetupPreferences() override { + void SetupPreferences() override { InstallExtensionWithUIAutoConfirm( test_data_dir_.AppendASCII("good.crx"), 1, browser()); } - virtual void AttackPreferencesOnDisk( + void AttackPreferencesOnDisk( base::DictionaryValue* unprotected_preferences, base::DictionaryValue* protected_preferences) override { base::DictionaryValue* selected_prefs = @@ -730,7 +730,7 @@ class PrefHashBrowserTestChangedSplitPref : public PrefHashBrowserTestBase { extensions_dict->Set(std::string(32, 'a'), fake_extension); } - virtual void VerifyReactionToPrefAttack() override { + void VerifyReactionToPrefAttack() override { // Expect a single split pref changed report with a count of 2 for tracked // pref #5 (extensions). EXPECT_EQ(protection_level_ > PROTECTION_DISABLED_ON_PLATFORM ? 1 : 0, @@ -788,20 +788,20 @@ PREF_HASH_BROWSER_TEST(PrefHashBrowserTestChangedSplitPref, ChangedSplitPref); class PrefHashBrowserTestUntrustedAdditionToPrefs : public PrefHashBrowserTestBase { public: - virtual void SetupPreferences() override { + void SetupPreferences() override { // Ensure there is no user-selected value for kRestoreOnStartup. EXPECT_FALSE( profile()->GetPrefs()->GetUserPrefValue(prefs::kRestoreOnStartup)); } - virtual void AttackPreferencesOnDisk( + void AttackPreferencesOnDisk( base::DictionaryValue* unprotected_preferences, base::DictionaryValue* protected_preferences) override { unprotected_preferences->SetInteger(prefs::kRestoreOnStartup, SessionStartupPref::LAST); } - virtual void VerifyReactionToPrefAttack() override { + void VerifyReactionToPrefAttack() override { // Expect a single Changed event for tracked pref #3 (kRestoreOnStartup) if // not protecting; if protection is enabled the change should be a no-op. int changed_expected = @@ -854,11 +854,11 @@ PREF_HASH_BROWSER_TEST(PrefHashBrowserTestUntrustedAdditionToPrefs, class PrefHashBrowserTestUntrustedAdditionToPrefsAfterWipe : public PrefHashBrowserTestBase { public: - virtual void SetupPreferences() override { + void SetupPreferences() override { profile()->GetPrefs()->SetString(prefs::kHomePage, "http://example.com"); } - virtual void AttackPreferencesOnDisk( + void AttackPreferencesOnDisk( base::DictionaryValue* unprotected_preferences, base::DictionaryValue* protected_preferences) override { // Set or change the value in Preferences to the attacker's choice. @@ -868,7 +868,7 @@ class PrefHashBrowserTestUntrustedAdditionToPrefsAfterWipe protected_preferences->Remove(prefs::kHomePage, NULL); } - virtual void VerifyReactionToPrefAttack() override { + void VerifyReactionToPrefAttack() override { // Expect a single Changed event for tracked pref #2 (kHomePage) if // not protecting; if protection is enabled the change should be a Cleared. int changed_expected = diff --git a/chrome/browser/prefs/tracked/pref_hash_filter.h b/chrome/browser/prefs/tracked/pref_hash_filter.h index 1c1a3c8..669f327 100644 --- a/chrome/browser/prefs/tracked/pref_hash_filter.h +++ b/chrome/browser/prefs/tracked/pref_hash_filter.h @@ -75,7 +75,7 @@ class PrefHashFilter : public InterceptablePrefFilter { size_t reporting_ids_count, bool report_super_mac_validity); - virtual ~PrefHashFilter(); + ~PrefHashFilter() override; // Registers required user preferences. static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); @@ -94,13 +94,12 @@ class PrefHashFilter : public InterceptablePrefFilter { void Initialize(base::DictionaryValue* pref_store_contents); // PrefFilter remaining implementation. - virtual void FilterUpdate(const std::string& path) override; - virtual void FilterSerializeData( - base::DictionaryValue* pref_store_contents) override; + void FilterUpdate(const std::string& path) override; + void FilterSerializeData(base::DictionaryValue* pref_store_contents) override; private: // InterceptablePrefFilter implementation. - virtual void FinalizeFilterOnLoad( + void FinalizeFilterOnLoad( const PostFilterOnLoadCallback& post_filter_on_load_callback, scoped_ptr<base::DictionaryValue> pref_store_contents, bool prefs_altered) override; diff --git a/chrome/browser/prefs/tracked/pref_hash_filter_unittest.cc b/chrome/browser/prefs/tracked/pref_hash_filter_unittest.cc index 25bfb99..3c3e58e 100644 --- a/chrome/browser/prefs/tracked/pref_hash_filter_unittest.cc +++ b/chrome/browser/prefs/tracked/pref_hash_filter_unittest.cc @@ -85,9 +85,7 @@ class MockPrefHashStore : public PrefHashStore { transactions_performed_(0), transaction_active_(false) {} - virtual ~MockPrefHashStore() { - EXPECT_FALSE(transaction_active_); - } + ~MockPrefHashStore() override { EXPECT_FALSE(transaction_active_); } // Set the result that will be returned when |path| is passed to // |CheckValue/CheckSplitValue|. @@ -153,7 +151,7 @@ class MockPrefHashStore : public PrefHashStore { } // PrefHashStore implementation. - virtual scoped_ptr<PrefHashStoreTransaction> BeginTransaction( + scoped_ptr<PrefHashStoreTransaction> BeginTransaction( scoped_ptr<HashStoreContents> storage) override; private: @@ -166,29 +164,28 @@ class MockPrefHashStore : public PrefHashStore { explicit MockPrefHashStoreTransaction(MockPrefHashStore* outer) : outer_(outer) {} - virtual ~MockPrefHashStoreTransaction() { + ~MockPrefHashStoreTransaction() override { outer_->transaction_active_ = false; ++outer_->transactions_performed_; } // PrefHashStoreTransaction implementation. - virtual PrefHashStoreTransaction::ValueState CheckValue( - const std::string& path, const base::Value* value) const override; - virtual void StoreHash(const std::string& path, - const base::Value* new_value) override; - virtual PrefHashStoreTransaction::ValueState CheckSplitValue( + PrefHashStoreTransaction::ValueState CheckValue( + const std::string& path, + const base::Value* value) const override; + void StoreHash(const std::string& path, + const base::Value* new_value) override; + PrefHashStoreTransaction::ValueState CheckSplitValue( const std::string& path, const base::DictionaryValue* initial_split_value, std::vector<std::string>* invalid_keys) const override; - virtual void StoreSplitHash( - const std::string& path, - const base::DictionaryValue* split_value) override; - virtual bool HasHash(const std::string& path) const override; - virtual void ImportHash(const std::string& path, - const base::Value* hash) override; - virtual void ClearHash(const std::string& path) override; - virtual bool IsSuperMACValid() const override; - virtual bool StampSuperMac() override; + void StoreSplitHash(const std::string& path, + const base::DictionaryValue* split_value) override; + bool HasHash(const std::string& path) const override; + void ImportHash(const std::string& path, const base::Value* hash) override; + void ClearHash(const std::string& path) override; + bool IsSuperMACValid() const override; + bool StampSuperMac() override; private: MockPrefHashStore* outer_; diff --git a/chrome/browser/prefs/tracked/pref_hash_store_impl.cc b/chrome/browser/prefs/tracked/pref_hash_store_impl.cc index a99db41..f43e06b1 100644 --- a/chrome/browser/prefs/tracked/pref_hash_store_impl.cc +++ b/chrome/browser/prefs/tracked/pref_hash_store_impl.cc @@ -17,26 +17,23 @@ class PrefHashStoreImpl::PrefHashStoreTransactionImpl // members of its |outer| PrefHashStoreImpl. PrefHashStoreTransactionImpl(PrefHashStoreImpl* outer, scoped_ptr<HashStoreContents> storage); - virtual ~PrefHashStoreTransactionImpl(); + ~PrefHashStoreTransactionImpl() override; // PrefHashStoreTransaction implementation. - virtual ValueState CheckValue(const std::string& path, - const base::Value* value) const override; - virtual void StoreHash(const std::string& path, - const base::Value* value) override; - virtual ValueState CheckSplitValue( + ValueState CheckValue(const std::string& path, + const base::Value* value) const override; + void StoreHash(const std::string& path, const base::Value* value) override; + ValueState CheckSplitValue( const std::string& path, const base::DictionaryValue* initial_split_value, std::vector<std::string>* invalid_keys) const override; - virtual void StoreSplitHash( - const std::string& path, - const base::DictionaryValue* split_value) override; - virtual bool HasHash(const std::string& path) const override; - virtual void ImportHash(const std::string& path, - const base::Value* hash) override; - virtual void ClearHash(const std::string& path) override; - virtual bool IsSuperMACValid() const override; - virtual bool StampSuperMac() override; + void StoreSplitHash(const std::string& path, + const base::DictionaryValue* split_value) override; + bool HasHash(const std::string& path) const override; + void ImportHash(const std::string& path, const base::Value* hash) override; + void ClearHash(const std::string& path) override; + bool IsSuperMACValid() const override; + bool StampSuperMac() override; private: bool GetSplitMacs(const std::string& path, diff --git a/chrome/browser/prefs/tracked/pref_hash_store_impl.h b/chrome/browser/prefs/tracked/pref_hash_store_impl.h index 2b4640f..ccef877 100644 --- a/chrome/browser/prefs/tracked/pref_hash_store_impl.h +++ b/chrome/browser/prefs/tracked/pref_hash_store_impl.h @@ -39,7 +39,7 @@ class PrefHashStoreImpl : public PrefHashStore { const std::string& device_id, bool use_super_mac); - virtual ~PrefHashStoreImpl(); + ~PrefHashStoreImpl() override; // Provides an external HashStoreContents implementation to be used. // BeginTransaction() will ignore |storage| if this is provided. @@ -51,7 +51,7 @@ class PrefHashStoreImpl : public PrefHashStore { void Reset(); // PrefHashStore implementation. - virtual scoped_ptr<PrefHashStoreTransaction> BeginTransaction( + scoped_ptr<PrefHashStoreTransaction> BeginTransaction( scoped_ptr<HashStoreContents> storage) override; private: diff --git a/chrome/browser/prefs/tracked/pref_service_hash_store_contents.cc b/chrome/browser/prefs/tracked/pref_service_hash_store_contents.cc index a59eb84..9ab446f 100644 --- a/chrome/browser/prefs/tracked/pref_service_hash_store_contents.cc +++ b/chrome/browser/prefs/tracked/pref_service_hash_store_contents.cc @@ -23,7 +23,7 @@ class PrefServiceMutableDictionary PrefService* pref_service); // HashStoreContents::MutableDictionary implementation - virtual base::DictionaryValue* operator->() override; + base::DictionaryValue* operator->() override; private: const std::string key_; diff --git a/chrome/browser/prefs/tracked/pref_service_hash_store_contents.h b/chrome/browser/prefs/tracked/pref_service_hash_store_contents.h index 851e2ad..5bb6c95 100644 --- a/chrome/browser/prefs/tracked/pref_service_hash_store_contents.h +++ b/chrome/browser/prefs/tracked/pref_service_hash_store_contents.h @@ -54,13 +54,13 @@ class PrefServiceHashStoreContents : public HashStoreContents { static void ResetAllPrefHashStores(PrefService* pref_service); // HashStoreContents implementation - virtual std::string hash_store_id() const override; - virtual void Reset() override; - virtual bool IsInitialized() const override; - virtual const base::DictionaryValue* GetContents() const override; - virtual scoped_ptr<MutableDictionary> GetMutableContents() override; - virtual std::string GetSuperMac() const override; - virtual void SetSuperMac(const std::string& super_mac) override; + std::string hash_store_id() const override; + void Reset() override; + bool IsInitialized() const override; + const base::DictionaryValue* GetContents() const override; + scoped_ptr<MutableDictionary> GetMutableContents() override; + std::string GetSuperMac() const override; + void SetSuperMac(const std::string& super_mac) override; private: const std::string hash_store_id_; diff --git a/chrome/browser/prefs/tracked/segregated_pref_store.h b/chrome/browser/prefs/tracked/segregated_pref_store.h index aea3a3b..5fe4778 100644 --- a/chrome/browser/prefs/tracked/segregated_pref_store.h +++ b/chrome/browser/prefs/tracked/segregated_pref_store.h @@ -44,28 +44,26 @@ class SegregatedPrefStore : public PersistentPrefStore { const std::set<std::string>& selected_pref_names); // PrefStore implementation - virtual void AddObserver(Observer* observer) override; - virtual void RemoveObserver(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(Observer* observer) override; + void RemoveObserver(Observer* observer) override; + bool HasObservers() const override; + bool IsInitializationComplete() const override; + bool GetValue(const std::string& key, + const base::Value** result) const override; // WriteablePrefStore implementation - virtual void SetValue(const std::string& key, base::Value* value) override; - virtual void RemoveValue(const std::string& key) override; + void SetValue(const std::string& key, base::Value* value) override; + void RemoveValue(const std::string& key) override; // PersistentPrefStore implementation - virtual bool GetMutableValue(const std::string& key, - base::Value** result) override; - virtual void ReportValueChanged(const std::string& key) override; - virtual void SetValueSilently(const std::string& key, - base::Value* value) override; - virtual bool ReadOnly() const override; - virtual PrefReadError GetReadError() const override; - virtual 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 SetValueSilently(const std::string& key, base::Value* value) override; + bool ReadOnly() const override; + PrefReadError GetReadError() const override; + PrefReadError ReadPrefs() override; + void ReadPrefsAsync(ReadErrorDelegate* error_delegate) override; + void CommitPendingWrite() override; private: // Aggregates events from the underlying stores and synthesizes external @@ -75,8 +73,8 @@ class SegregatedPrefStore : public PersistentPrefStore { explicit AggregatingObserver(SegregatedPrefStore* outer); // 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: SegregatedPrefStore* outer_; @@ -86,7 +84,7 @@ class SegregatedPrefStore : public PersistentPrefStore { DISALLOW_COPY_AND_ASSIGN(AggregatingObserver); }; - virtual ~SegregatedPrefStore(); + ~SegregatedPrefStore() override; // Returns |selected_pref_store| if |key| is selected and |default_pref_store| // otherwise. diff --git a/chrome/browser/prefs/tracked/segregated_pref_store_unittest.cc b/chrome/browser/prefs/tracked/segregated_pref_store_unittest.cc index 182b2eb..693fbfcc 100644 --- a/chrome/browser/prefs/tracked/segregated_pref_store_unittest.cc +++ b/chrome/browser/prefs/tracked/segregated_pref_store_unittest.cc @@ -42,7 +42,7 @@ class MockReadErrorDelegate : public PersistentPrefStore::ReadErrorDelegate { } // PersistentPrefStore::ReadErrorDelegate implementation - virtual void OnError(PersistentPrefStore::PrefReadError read_error) override { + void OnError(PersistentPrefStore::PrefReadError read_error) override { EXPECT_FALSE(data_->invoked); data_->invoked = true; data_->read_error = read_error; diff --git a/chrome/browser/prefs/tracked/tracked_atomic_preference.h b/chrome/browser/prefs/tracked/tracked_atomic_preference.h index f3ee9c7..1f9567b 100644 --- a/chrome/browser/prefs/tracked/tracked_atomic_preference.h +++ b/chrome/browser/prefs/tracked/tracked_atomic_preference.h @@ -27,11 +27,10 @@ class TrackedAtomicPreference : public TrackedPreference { TrackedPreferenceValidationDelegate* delegate); // TrackedPreference implementation. - virtual void OnNewValue(const base::Value* value, - PrefHashStoreTransaction* transaction) const override; - virtual bool EnforceAndReport( - base::DictionaryValue* pref_store_contents, - PrefHashStoreTransaction* transaction) const override; + void OnNewValue(const base::Value* value, + PrefHashStoreTransaction* transaction) const override; + bool EnforceAndReport(base::DictionaryValue* pref_store_contents, + PrefHashStoreTransaction* transaction) const override; private: const std::string pref_path_; diff --git a/chrome/browser/prefs/tracked/tracked_preferences_migration_unittest.cc b/chrome/browser/prefs/tracked/tracked_preferences_migration_unittest.cc index bf7e0fa..c753596 100644 --- a/chrome/browser/prefs/tracked/tracked_preferences_migration_unittest.cc +++ b/chrome/browser/prefs/tracked/tracked_preferences_migration_unittest.cc @@ -46,17 +46,15 @@ const char kPreviouslyProtectedPrefValue[] = "previously_protected_value"; class SimpleInterceptablePrefFilter : public InterceptablePrefFilter { public: // PrefFilter remaining implementation. - virtual void FilterUpdate(const std::string& path) override { - ADD_FAILURE(); - } - virtual void FilterSerializeData( + void FilterUpdate(const std::string& path) override { ADD_FAILURE(); } + void FilterSerializeData( base::DictionaryValue* pref_store_contents) override { ADD_FAILURE(); } private: // InterceptablePrefFilter implementation. - virtual void FinalizeFilterOnLoad( + void FinalizeFilterOnLoad( const PostFilterOnLoadCallback& post_filter_on_load_callback, scoped_ptr<base::DictionaryValue> pref_store_contents, bool prefs_altered) override { diff --git a/chrome/browser/prefs/tracked/tracked_split_preference.h b/chrome/browser/prefs/tracked/tracked_split_preference.h index 0bbe7c7..2c2d596 100644 --- a/chrome/browser/prefs/tracked/tracked_split_preference.h +++ b/chrome/browser/prefs/tracked/tracked_split_preference.h @@ -30,11 +30,10 @@ class TrackedSplitPreference : public TrackedPreference { TrackedPreferenceValidationDelegate* delegate); // TrackedPreference implementation. - virtual void OnNewValue(const base::Value* value, - PrefHashStoreTransaction* transaction) const override; - virtual bool EnforceAndReport( - base::DictionaryValue* pref_store_contents, - PrefHashStoreTransaction* transaction) const override; + void OnNewValue(const base::Value* value, + PrefHashStoreTransaction* transaction) const override; + bool EnforceAndReport(base::DictionaryValue* pref_store_contents, + PrefHashStoreTransaction* transaction) const override; private: const std::string pref_path_; |