diff options
author | dcheng <dcheng@chromium.org> | 2015-01-21 12:30:49 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-21 20:31:51 +0000 |
commit | ae98daac90e8a97f807911858856fcb402c36860 (patch) | |
tree | c7bf8dd6cb9f2cb2f005a959304a1cc254e583c8 | |
parent | 1bb3d1d4a9d5155391e88078fdc63dee5bc5c977 (diff) | |
download | chromium_src-ae98daac90e8a97f807911858856fcb402c36860.zip chromium_src-ae98daac90e8a97f807911858856fcb402c36860.tar.gz chromium_src-ae98daac90e8a97f807911858856fcb402c36860.tar.bz2 |
Update {virtual,override,final} to follow C++11 style in chromeos.
The Google style guide states that only one of {virtual,override,final}
should be used for each declaration, since override implies virtual and
final implies both virtual and override.
This patch was automatically generated with a ChromeOS build using a
variation of https://codereview.chromium.org/598073004.
BUG=417463
R=zelidrag@chromium.org
Review URL: https://codereview.chromium.org/856563004
Cr-Commit-Position: refs/heads/master@{#312426}
28 files changed, 281 insertions, 305 deletions
diff --git a/chromeos/attestation/mock_attestation_flow.h b/chromeos/attestation/mock_attestation_flow.h index a4a26b9..efefd94 100644 --- a/chromeos/attestation/mock_attestation_flow.h +++ b/chromeos/attestation/mock_attestation_flow.h @@ -18,17 +18,17 @@ namespace attestation { class FakeServerProxy : public ServerProxy { public: FakeServerProxy(); - virtual ~FakeServerProxy(); + ~FakeServerProxy() override; void set_result(bool result) { result_ = result; } - virtual void SendEnrollRequest(const std::string& request, - const DataCallback& callback) override; + void SendEnrollRequest(const std::string& request, + const DataCallback& callback) override; - virtual void SendCertificateRequest(const std::string& request, - const DataCallback& callback) override; + void SendCertificateRequest(const std::string& request, + const DataCallback& callback) override; private: bool result_; diff --git a/chromeos/audio/audio_devices_pref_handler_impl.h b/chromeos/audio/audio_devices_pref_handler_impl.h index 8b760b7..ef22b69 100644 --- a/chromeos/audio/audio_devices_pref_handler_impl.h +++ b/chromeos/audio/audio_devices_pref_handler_impl.h @@ -27,24 +27,23 @@ class CHROMEOS_EXPORT AudioDevicesPrefHandlerImpl explicit AudioDevicesPrefHandlerImpl(PrefService* local_state); // Overridden from AudioDevicesPrefHandler. - virtual double GetOutputVolumeValue(const AudioDevice* device) override; - virtual double GetInputGainValue(const AudioDevice* device) override; - virtual void SetVolumeGainValue(const AudioDevice& device, - double value) override; + double GetOutputVolumeValue(const AudioDevice* device) override; + double GetInputGainValue(const AudioDevice* device) override; + void SetVolumeGainValue(const AudioDevice& device, double value) override; - virtual bool GetMuteValue(const AudioDevice& device) override; - virtual void SetMuteValue(const AudioDevice& device, bool mute_on) override; + bool GetMuteValue(const AudioDevice& device) override; + void SetMuteValue(const AudioDevice& device, bool mute_on) override; - virtual bool GetAudioOutputAllowedValue() override; + bool GetAudioOutputAllowedValue() override; - virtual void AddAudioPrefObserver(AudioPrefObserver* observer) override; - virtual void RemoveAudioPrefObserver(AudioPrefObserver* observer) override; + void AddAudioPrefObserver(AudioPrefObserver* observer) override; + void RemoveAudioPrefObserver(AudioPrefObserver* observer) override; // Registers volume and mute preferences. static void RegisterPrefs(PrefRegistrySimple* registry); protected: - virtual ~AudioDevicesPrefHandlerImpl(); + ~AudioDevicesPrefHandlerImpl() override; private: // Initializes the observers for the policy prefs. diff --git a/chromeos/audio/cras_audio_handler.h b/chromeos/audio/cras_audio_handler.h index 73b0f9f..e16161f 100644 --- a/chromeos/audio/cras_audio_handler.h +++ b/chromeos/audio/cras_audio_handler.h @@ -191,22 +191,22 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer, protected: explicit CrasAudioHandler( scoped_refptr<AudioDevicesPrefHandler> audio_pref_handler); - virtual ~CrasAudioHandler(); + ~CrasAudioHandler() override; private: friend class CrasAudioHandlerTest; // CrasAudioClient::Observer overrides. - virtual void AudioClientRestarted() override; - virtual void NodesChanged() override; - virtual void ActiveOutputNodeChanged(uint64 node_id) override; - virtual void ActiveInputNodeChanged(uint64 node_id) override; + void AudioClientRestarted() override; + void NodesChanged() override; + void ActiveOutputNodeChanged(uint64 node_id) override; + void ActiveInputNodeChanged(uint64 node_id) override; // AudioPrefObserver overrides. - virtual void OnAudioPolicyPrefChanged() override; + void OnAudioPolicyPrefChanged() override; // SessionManagerClient::Observer overrides. - virtual void EmitLoginPromptVisibleCalled() override; + void EmitLoginPromptVisibleCalled() override; // Sets the active audio output/input node to the node with |node_id|. // If |notify|, notifies Active*NodeChange. diff --git a/chromeos/audio/cras_audio_handler_unittest.cc b/chromeos/audio/cras_audio_handler_unittest.cc index be25133..bc87b09 100644 --- a/chromeos/audio/cras_audio_handler_unittest.cc +++ b/chromeos/audio/cras_audio_handler_unittest.cc @@ -241,37 +241,27 @@ class TestObserver : public chromeos::CrasAudioHandler::AudioObserver { return input_gain_changed_count_; } - virtual ~TestObserver() {} + ~TestObserver() override {} protected: // chromeos::CrasAudioHandler::AudioObserver overrides. - virtual void OnActiveOutputNodeChanged() override { + void OnActiveOutputNodeChanged() override { ++active_output_node_changed_count_; } - virtual void OnActiveInputNodeChanged() override { + void OnActiveInputNodeChanged() override { ++active_input_node_changed_count_; } - virtual void OnAudioNodesChanged() override { - ++audio_nodes_changed_count_; - } + void OnAudioNodesChanged() override { ++audio_nodes_changed_count_; } - virtual void OnOutputMuteChanged() override { - ++output_mute_changed_count_; - } + void OnOutputMuteChanged() override { ++output_mute_changed_count_; } - virtual void OnInputMuteChanged() override { - ++input_mute_changed_count_; - } + void OnInputMuteChanged() override { ++input_mute_changed_count_; } - virtual void OnOutputVolumeChanged() override { - ++output_volume_changed_count_; - } + void OnOutputVolumeChanged() override { ++output_volume_changed_count_; } - virtual void OnInputGainChanged() override { - ++input_gain_changed_count_; - } + void OnInputGainChanged() override { ++input_gain_changed_count_; } private: int active_output_node_changed_count_; @@ -290,12 +280,11 @@ class CrasAudioHandlerTest : public testing::Test { CrasAudioHandlerTest() : cras_audio_handler_(NULL), fake_cras_audio_client_(NULL) { } - virtual ~CrasAudioHandlerTest() {} + ~CrasAudioHandlerTest() override {} - virtual void SetUp() override { - } + void SetUp() override {} - virtual void TearDown() override { + void TearDown() override { cras_audio_handler_->RemoveAudioObserver(test_observer_.get()); test_observer_.reset(); CrasAudioHandler::Shutdown(); diff --git a/chromeos/cert_loader.h b/chromeos/cert_loader.h index d542115..9283918 100644 --- a/chromeos/cert_loader.h +++ b/chromeos/cert_loader.h @@ -92,7 +92,7 @@ class CHROMEOS_EXPORT CertLoader : public net::CertDatabase::Observer { private: CertLoader(); - virtual ~CertLoader(); + ~CertLoader() override; // Trigger a certificate load. If a certificate loading task is already in // progress, will start a reload once the current task is finished. @@ -104,9 +104,9 @@ class CHROMEOS_EXPORT CertLoader : public net::CertDatabase::Observer { void NotifyCertificatesLoaded(bool initial_load); // net::CertDatabase::Observer - virtual void OnCACertChanged(const net::X509Certificate* cert) override; - virtual void OnCertAdded(const net::X509Certificate* cert) override; - virtual void OnCertRemoved(const net::X509Certificate* cert) override; + void OnCACertChanged(const net::X509Certificate* cert) override; + void OnCertAdded(const net::X509Certificate* cert) override; + void OnCertRemoved(const net::X509Certificate* cert) override; ObserverList<Observer> observers_; diff --git a/chromeos/cryptohome/async_method_caller.cc b/chromeos/cryptohome/async_method_caller.cc index 37a8168..0b137b0 100644 --- a/chromeos/cryptohome/async_method_caller.cc +++ b/chromeos/cryptohome/async_method_caller.cc @@ -30,14 +30,14 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { weak_ptr_factory_.GetWeakPtr())); } - virtual ~AsyncMethodCallerImpl() { + ~AsyncMethodCallerImpl() override { DBusThreadManager::Get()->GetCryptohomeClient()-> ResetAsyncCallStatusHandlers(); } - virtual void AsyncCheckKey(const std::string& user_email, - const std::string& passhash, - Callback callback) override { + void AsyncCheckKey(const std::string& user_email, + const std::string& passhash, + Callback callback) override { DBusThreadManager::Get()->GetCryptohomeClient()-> AsyncCheckKey(user_email, passhash, base::Bind( &AsyncMethodCallerImpl::RegisterAsyncCallback, @@ -46,10 +46,10 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { "Couldn't initiate async check of user's key.")); } - virtual void AsyncMigrateKey(const std::string& user_email, - const std::string& old_hash, - const std::string& new_hash, - Callback callback) override { + void AsyncMigrateKey(const std::string& user_email, + const std::string& old_hash, + const std::string& new_hash, + Callback callback) override { DBusThreadManager::Get()->GetCryptohomeClient()-> AsyncMigrateKey(user_email, old_hash, new_hash, base::Bind( &AsyncMethodCallerImpl::RegisterAsyncCallback, @@ -58,10 +58,10 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { "Couldn't initiate aync migration of user's key")); } - virtual void AsyncMount(const std::string& user_email, - const std::string& passhash, - int flags, - Callback callback) override { + void AsyncMount(const std::string& user_email, + const std::string& passhash, + int flags, + Callback callback) override { DBusThreadManager::Get()->GetCryptohomeClient()-> AsyncMount(user_email, passhash, flags, base::Bind( &AsyncMethodCallerImpl::RegisterAsyncCallback, @@ -70,10 +70,10 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { "Couldn't initiate async mount of cryptohome.")); } - virtual void AsyncAddKey(const std::string& user_email, - const std::string& passhash, - const std::string& new_passhash, - Callback callback) override { + void AsyncAddKey(const std::string& user_email, + const std::string& passhash, + const std::string& new_passhash, + Callback callback) override { DBusThreadManager::Get()->GetCryptohomeClient()-> AsyncAddKey(user_email, passhash, new_passhash, base::Bind( &AsyncMethodCallerImpl::RegisterAsyncCallback, @@ -82,7 +82,7 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { "Couldn't initiate async key addition.")); } - virtual void AsyncMountGuest(Callback callback) override { + void AsyncMountGuest(Callback callback) override { DBusThreadManager::Get()->GetCryptohomeClient()-> AsyncMountGuest(base::Bind( &AsyncMethodCallerImpl::RegisterAsyncCallback, @@ -91,9 +91,9 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { "Couldn't initiate async mount of cryptohome.")); } - virtual void AsyncMountPublic(const std::string& public_mount_id, - int flags, - Callback callback) override { + void AsyncMountPublic(const std::string& public_mount_id, + int flags, + Callback callback) override { DBusThreadManager::Get()->GetCryptohomeClient()-> AsyncMountPublic(public_mount_id, flags, base::Bind( &AsyncMethodCallerImpl::RegisterAsyncCallback, @@ -102,8 +102,7 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { "Couldn't initiate async mount public of cryptohome.")); } - virtual void AsyncRemove(const std::string& user_email, - Callback callback) override { + void AsyncRemove(const std::string& user_email, Callback callback) override { DBusThreadManager::Get()->GetCryptohomeClient()-> AsyncRemove(user_email, base::Bind( &AsyncMethodCallerImpl::RegisterAsyncCallback, @@ -112,7 +111,7 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { "Couldn't initiate async removal of cryptohome.")); } - virtual void AsyncTpmAttestationCreateEnrollRequest( + void AsyncTpmAttestationCreateEnrollRequest( chromeos::attestation::PrivacyCAType pca_type, const DataCallback& callback) override { DBusThreadManager::Get()->GetCryptohomeClient()-> @@ -123,10 +122,9 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { "Couldn't initiate async attestation enroll request.")); } - virtual void AsyncTpmAttestationEnroll( - chromeos::attestation::PrivacyCAType pca_type, - const std::string& pca_response, - const Callback& callback) override { + void AsyncTpmAttestationEnroll(chromeos::attestation::PrivacyCAType pca_type, + const std::string& pca_response, + const Callback& callback) override { DBusThreadManager::Get()->GetCryptohomeClient()-> AsyncTpmAttestationEnroll(pca_type, pca_response, base::Bind( &AsyncMethodCallerImpl::RegisterAsyncCallback, @@ -135,7 +133,7 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { "Couldn't initiate async attestation enroll.")); } - virtual void AsyncTpmAttestationCreateCertRequest( + void AsyncTpmAttestationCreateCertRequest( chromeos::attestation::PrivacyCAType pca_type, chromeos::attestation::AttestationCertificateProfile certificate_profile, const std::string& user_id, @@ -153,7 +151,7 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { "Couldn't initiate async attestation cert request.")); } - virtual void AsyncTpmAttestationFinishCertRequest( + void AsyncTpmAttestationFinishCertRequest( const std::string& pca_response, chromeos::attestation::AttestationKeyType key_type, const std::string& user_id, @@ -172,7 +170,7 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { "Couldn't initiate async attestation finish cert request.")); } - virtual void TpmAttestationRegisterKey( + void TpmAttestationRegisterKey( chromeos::attestation::AttestationKeyType key_type, const std::string& user_id, const std::string& key_name, @@ -189,7 +187,7 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { "Couldn't initiate async attestation register key.")); } - virtual void TpmAttestationSignEnterpriseChallenge( + void TpmAttestationSignEnterpriseChallenge( chromeos::attestation::AttestationKeyType key_type, const std::string& user_id, const std::string& key_name, @@ -214,7 +212,7 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { "Couldn't initiate async attestation enterprise challenge.")); } - virtual void TpmAttestationSignSimpleChallenge( + void TpmAttestationSignSimpleChallenge( chromeos::attestation::AttestationKeyType key_type, const std::string& user_id, const std::string& key_name, @@ -233,9 +231,8 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { "Couldn't initiate async attestation simple challenge.")); } - virtual void AsyncGetSanitizedUsername( - const std::string& user, - const DataCallback& callback) override { + void AsyncGetSanitizedUsername(const std::string& user, + const DataCallback& callback) override { DBusThreadManager::Get()->GetCryptohomeClient()-> GetSanitizedUsername(user, base::Bind( diff --git a/chromeos/cryptohome/homedir_methods.cc b/chromeos/cryptohome/homedir_methods.cc index 6589030..cbb934c 100644 --- a/chromeos/cryptohome/homedir_methods.cc +++ b/chromeos/cryptohome/homedir_methods.cc @@ -174,11 +174,11 @@ class HomedirMethodsImpl : public HomedirMethods { public: HomedirMethodsImpl() : weak_ptr_factory_(this) {} - virtual ~HomedirMethodsImpl() {} + ~HomedirMethodsImpl() override {} - virtual void GetKeyDataEx(const Identification& id, - const std::string& label, - const GetKeyDataCallback& callback) override { + void GetKeyDataEx(const Identification& id, + const std::string& label, + const GetKeyDataCallback& callback) override { cryptohome::AccountIdentifier id_proto; cryptohome::AuthorizationRequest kEmptyAuthProto; cryptohome::GetKeyDataRequest request; @@ -195,9 +195,9 @@ class HomedirMethodsImpl : public HomedirMethods { callback)); } - virtual void CheckKeyEx(const Identification& id, - const Authorization& auth, - const Callback& callback) override { + void CheckKeyEx(const Identification& id, + const Authorization& auth, + const Callback& callback) override { cryptohome::AccountIdentifier id_proto; cryptohome::AuthorizationRequest auth_proto; cryptohome::CheckKeyRequest request; @@ -214,10 +214,10 @@ class HomedirMethodsImpl : public HomedirMethods { callback)); } - virtual void MountEx(const Identification& id, - const Authorization& auth, - const MountParameters& request, - const MountCallback& callback) override { + void MountEx(const Identification& id, + const Authorization& auth, + const MountParameters& request, + const MountCallback& callback) override { cryptohome::AccountIdentifier id_proto; cryptohome::AuthorizationRequest auth_proto; cryptohome::MountRequest request_proto; @@ -243,11 +243,11 @@ class HomedirMethodsImpl : public HomedirMethods { callback)); } - virtual void AddKeyEx(const Identification& id, - const Authorization& auth, - const KeyDefinition& new_key, - bool clobber_if_exists, - const Callback& callback) override { + void AddKeyEx(const Identification& id, + const Authorization& auth, + const KeyDefinition& new_key, + bool clobber_if_exists, + const Callback& callback) override { cryptohome::AccountIdentifier id_proto; cryptohome::AuthorizationRequest auth_proto; cryptohome::AddKeyRequest request; @@ -266,10 +266,10 @@ class HomedirMethodsImpl : public HomedirMethods { callback)); } - virtual void RemoveKeyEx(const Identification& id, - const Authorization& auth, - const std::string& label, - const Callback& callback) override { + void RemoveKeyEx(const Identification& id, + const Authorization& auth, + const std::string& label, + const Callback& callback) override { cryptohome::AccountIdentifier id_proto; cryptohome::AuthorizationRequest auth_proto; cryptohome::RemoveKeyRequest request; @@ -287,11 +287,11 @@ class HomedirMethodsImpl : public HomedirMethods { callback)); } - virtual void UpdateKeyEx(const Identification& id, - const Authorization& auth, - const KeyDefinition& new_key, - const std::string& signature, - const Callback& callback) override { + void UpdateKeyEx(const Identification& id, + const Authorization& auth, + const KeyDefinition& new_key, + const std::string& signature, + const Callback& callback) override { cryptohome::AccountIdentifier id_proto; cryptohome::AuthorizationRequest auth_proto; cryptohome::UpdateKeyRequest pb_update_key; diff --git a/chromeos/cryptohome/homedir_methods_unittest.cc b/chromeos/cryptohome/homedir_methods_unittest.cc index 3ed9753..9edd7b0 100644 --- a/chromeos/cryptohome/homedir_methods_unittest.cc +++ b/chromeos/cryptohome/homedir_methods_unittest.cc @@ -46,11 +46,11 @@ const char kProviderData2Bytes[] = "data_2 bytes"; class HomedirMethodsTest : public testing::Test { public: HomedirMethodsTest(); - virtual ~HomedirMethodsTest(); + ~HomedirMethodsTest() override; // testing::Test: - virtual void SetUp() override; - virtual void TearDown() override; + void SetUp() override; + void TearDown() override; void RunProtobufMethodCallback( const chromeos::CryptohomeClient::ProtobufMethodCallback& callback); diff --git a/chromeos/cryptohome/system_salt_getter_unittest.cc b/chromeos/cryptohome/system_salt_getter_unittest.cc index f60bc7f..43e1690 100644 --- a/chromeos/cryptohome/system_salt_getter_unittest.cc +++ b/chromeos/cryptohome/system_salt_getter_unittest.cc @@ -24,7 +24,7 @@ class SystemSaltGetterTest : public testing::Test { protected: SystemSaltGetterTest() : fake_cryptohome_client_(NULL) {} - virtual void SetUp() override { + void SetUp() override { fake_cryptohome_client_ = new FakeCryptohomeClient; DBusThreadManager::GetSetterForTesting()->SetCryptohomeClient( scoped_ptr<CryptohomeClient>(fake_cryptohome_client_)); @@ -35,7 +35,7 @@ class SystemSaltGetterTest : public testing::Test { ASSERT_TRUE(SystemSaltGetter::Get()); } - virtual void TearDown() override { + void TearDown() override { SystemSaltGetter::Shutdown(); DBusThreadManager::Shutdown(); } diff --git a/chromeos/disks/disk_mount_manager.cc b/chromeos/disks/disk_mount_manager.cc index 4867d51..569df7f 100644 --- a/chromeos/disks/disk_mount_manager.cc +++ b/chromeos/disks/disk_mount_manager.cc @@ -44,25 +44,25 @@ class DiskMountManagerImpl : public DiskMountManager { weak_ptr_factory_.GetWeakPtr())); } - virtual ~DiskMountManagerImpl() { + ~DiskMountManagerImpl() override { STLDeleteContainerPairSecondPointers(disks_.begin(), disks_.end()); } // DiskMountManager override. - virtual void AddObserver(Observer* observer) override { + void AddObserver(Observer* observer) override { observers_.AddObserver(observer); } // DiskMountManager override. - virtual void RemoveObserver(Observer* observer) override { + void RemoveObserver(Observer* observer) override { observers_.RemoveObserver(observer); } // DiskMountManager override. - virtual void MountPath(const std::string& source_path, - const std::string& source_format, - const std::string& mount_label, - MountType type) override { + void MountPath(const std::string& source_path, + const std::string& source_format, + const std::string& mount_label, + MountType type) override { // Hidden and non-existent devices should not be mounted. if (type == MOUNT_TYPE_DEVICE) { DiskMap::const_iterator it = disks_.find(source_path); @@ -85,9 +85,9 @@ class DiskMountManagerImpl : public DiskMountManager { } // DiskMountManager override. - virtual void UnmountPath(const std::string& mount_path, - UnmountOptions options, - const UnmountPathCallback& callback) override { + void UnmountPath(const std::string& mount_path, + UnmountOptions options, + const UnmountPathCallback& callback) override { UnmountChildMounts(mount_path); cros_disks_client_->Unmount(mount_path, options, base::Bind(&DiskMountManagerImpl::OnUnmountPath, @@ -103,7 +103,7 @@ class DiskMountManagerImpl : public DiskMountManager { } // DiskMountManager override. - virtual void FormatMountedDevice(const std::string& mount_path) override { + void FormatMountedDevice(const std::string& mount_path) override { MountPointMap::const_iterator mount_point = mount_points_.find(mount_path); if (mount_point == mount_points_.end()) { LOG(ERROR) << "Mount point with path \"" << mount_path << "\" not found."; @@ -127,7 +127,7 @@ class DiskMountManagerImpl : public DiskMountManager { } // DiskMountManager override. - virtual void UnmountDeviceRecursively( + void UnmountDeviceRecursively( const std::string& device_path, const UnmountDeviceRecursivelyCallbackType& callback) override { std::vector<std::string> devices_to_unmount; @@ -191,7 +191,7 @@ class DiskMountManagerImpl : public DiskMountManager { } // DiskMountManager override. - virtual void EnsureMountInfoRefreshed( + void EnsureMountInfoRefreshed( const EnsureMountInfoRefreshedCallback& callback) override { if (already_refreshed_) { callback.Run(true); @@ -210,22 +210,20 @@ class DiskMountManagerImpl : public DiskMountManager { } // DiskMountManager override. - virtual const DiskMap& disks() const override { return disks_; } + const DiskMap& disks() const override { return disks_; } // DiskMountManager override. - virtual const Disk* FindDiskBySourcePath(const std::string& source_path) - const override { + const Disk* FindDiskBySourcePath( + const std::string& source_path) const override { DiskMap::const_iterator disk_it = disks_.find(source_path); return disk_it == disks_.end() ? NULL : disk_it->second; } // DiskMountManager override. - virtual const MountPointMap& mount_points() const override { - return mount_points_; - } + const MountPointMap& mount_points() const override { return mount_points_; } // DiskMountManager override. - virtual bool AddDiskForTest(Disk* disk) override { + bool AddDiskForTest(Disk* disk) override { if (disks_.find(disk->device_path()) != disks_.end()) { LOG(ERROR) << "Attempt to add a duplicate disk"; return false; @@ -237,8 +235,7 @@ class DiskMountManagerImpl : public DiskMountManager { // DiskMountManager override. // Corresponding disk should be added to the manager before this is called. - virtual bool AddMountPointForTest( - const MountPointInfo& mount_point) override { + bool AddMountPointForTest(const MountPointInfo& mount_point) override { if (mount_points_.find(mount_point.mount_path) != mount_points_.end()) { LOG(ERROR) << "Attempt to add a duplicate mount point"; return false; diff --git a/chromeos/disks/disk_mount_manager_unittest.cc b/chromeos/disks/disk_mount_manager_unittest.cc index 674ee7a..becb950 100644 --- a/chromeos/disks/disk_mount_manager_unittest.cc +++ b/chromeos/disks/disk_mount_manager_unittest.cc @@ -116,12 +116,12 @@ class MockDiskMountManagerObserver : public DiskMountManager::Observer { class DiskMountManagerTest : public testing::Test { public: DiskMountManagerTest() {} - virtual ~DiskMountManagerTest() {} + ~DiskMountManagerTest() override {} // Sets up test dbus tread manager and disks mount manager. // Initializes disk mount manager disks and mount points. // Adds a test observer to the disk mount manager. - virtual void SetUp() { + void SetUp() override { fake_cros_disks_client_ = new FakeCrosDisksClient; DBusThreadManager::GetSetterForTesting()->SetCrosDisksClient( scoped_ptr<CrosDisksClient>(fake_cros_disks_client_)); @@ -134,7 +134,7 @@ class DiskMountManagerTest : public testing::Test { } // Shuts down dbus thread manager and disk moutn manager used in the test. - virtual void TearDown() { + void TearDown() override { DiskMountManager::GetInstance()->RemoveObserver(&observer_); DiskMountManager::Shutdown(); DBusThreadManager::Shutdown(); diff --git a/chromeos/geolocation/simple_geolocation_request.h b/chromeos/geolocation/simple_geolocation_request.h index 88de64b..179efcb 100644 --- a/chromeos/geolocation/simple_geolocation_request.h +++ b/chromeos/geolocation/simple_geolocation_request.h @@ -48,7 +48,7 @@ class SimpleGeolocationRequest : private net::URLFetcherDelegate { const GURL& service_url, base::TimeDelta timeout); - virtual ~SimpleGeolocationRequest(); + ~SimpleGeolocationRequest() override; // Initiates request. // Note: if request object is destroyed before callback is called, @@ -67,7 +67,7 @@ class SimpleGeolocationRequest : private net::URLFetcherDelegate { private: // net::URLFetcherDelegate - virtual void OnURLFetchComplete(const net::URLFetcher* source) override; + void OnURLFetchComplete(const net::URLFetcher* source) override; // Start new request. void StartRequest(); diff --git a/chromeos/login/auth/cryptohome_authenticator.h b/chromeos/login/auth/cryptohome_authenticator.h index e47f34d..d767bd9 100644 --- a/chromeos/login/auth/cryptohome_authenticator.h +++ b/chromeos/login/auth/cryptohome_authenticator.h @@ -95,8 +95,8 @@ class CHROMEOS_EXPORT CryptohomeAuthenticator AuthStatusConsumer* consumer); // Authenticator overrides. - virtual void CompleteLogin(content::BrowserContext* context, - const UserContext& user_context) override; + void CompleteLogin(content::BrowserContext* context, + const UserContext& user_context) override; // Given |user_context|, this method attempts to authenticate to your // Chrome OS device. As soon as we have successfully mounted the encrypted @@ -106,43 +106,43 @@ class CHROMEOS_EXPORT CryptohomeAuthenticator // with an error message. // // Uses |context| when doing URL fetches. - virtual void AuthenticateToLogin(content::BrowserContext* context, - const UserContext& user_context) override; + void AuthenticateToLogin(content::BrowserContext* context, + const UserContext& user_context) override; // Given |user_context|, this method attempts to authenticate to the cached // user_context. This will never contact the server even if it's online. // The auth result is sent to AuthStatusConsumer in a same way as // AuthenticateToLogin does. - virtual void AuthenticateToUnlock(const UserContext& user_context) override; + void AuthenticateToUnlock(const UserContext& user_context) override; // Initiates supervised user login. // Creates cryptohome if missing or mounts existing one and // notifies consumer on the success/failure. - virtual void LoginAsSupervisedUser(const UserContext& user_context) override; + void LoginAsSupervisedUser(const UserContext& user_context) override; // Initiates incognito ("browse without signing in") login. // Mounts tmpfs and notifies consumer on the success/failure. - virtual void LoginOffTheRecord() override; + void LoginOffTheRecord() override; // Initiates login into a public session. // Mounts an ephemeral cryptohome and notifies consumer on the // success/failure. - virtual void LoginAsPublicSession(const UserContext& user_context) override; + void LoginAsPublicSession(const UserContext& user_context) override; // Initiates login into the kiosk mode account identified by |app_user_id|. // Mounts an ephemeral guest cryptohome if |use_guest_mount| is |true|. // Otherwise, mounts a public cryptohome, which will be ephemeral if the // |DeviceEphemeralUsersEnabled| policy is enabled and non-ephemeral // otherwise. - virtual void LoginAsKioskAccount(const std::string& app_user_id, - bool use_guest_mount) override; + void LoginAsKioskAccount(const std::string& app_user_id, + bool use_guest_mount) override; // These methods must be called on the UI thread, as they make DBus calls // and also call back to the login UI. - virtual void OnAuthSuccess() override; - virtual void OnAuthFailure(const AuthFailure& error) override; - virtual void RecoverEncryptedData(const std::string& old_password) override; - virtual void ResyncEncryptedData() override; + void OnAuthSuccess() override; + void OnAuthFailure(const AuthFailure& error) override; + void RecoverEncryptedData(const std::string& old_password) override; + void ResyncEncryptedData() override; // AuthAttemptStateResolver overrides. // Attempts to make a decision and call back |consumer_| based on @@ -151,13 +151,13 @@ class CHROMEOS_EXPORT CryptohomeAuthenticator // When a decision is made, will call back to |consumer_| on the UI thread. // // Must be called on the UI thread. - virtual void Resolve() override; + void Resolve() override; void OnOffTheRecordAuthSuccess(); void OnPasswordChangeDetected(); protected: - virtual ~CryptohomeAuthenticator(); + ~CryptohomeAuthenticator() override; typedef base::Callback<void(bool is_owner)> IsOwnerCallback; diff --git a/chromeos/login/auth/extended_authenticator_impl.h b/chromeos/login/auth/extended_authenticator_impl.h index 103cbd2..519c1fe 100644 --- a/chromeos/login/auth/extended_authenticator_impl.h +++ b/chromeos/login/auth/extended_authenticator_impl.h @@ -27,33 +27,30 @@ class CHROMEOS_EXPORT ExtendedAuthenticatorImpl : public ExtendedAuthenticator { explicit ExtendedAuthenticatorImpl(AuthStatusConsumer* consumer); // ExtendedAuthenticator: - virtual void SetConsumer(AuthStatusConsumer* consumer) override; - virtual void AuthenticateToMount( - const UserContext& context, - const ResultCallback& success_callback) override; - virtual void AuthenticateToCheck( - const UserContext& context, - const base::Closure& success_callback) override; - virtual void CreateMount(const std::string& user_id, - const std::vector<cryptohome::KeyDefinition>& keys, + void SetConsumer(AuthStatusConsumer* consumer) override; + void AuthenticateToMount(const UserContext& context, const ResultCallback& success_callback) override; - virtual void AddKey(const UserContext& context, - const cryptohome::KeyDefinition& key, - bool replace_existing, - const base::Closure& success_callback) override; - virtual void UpdateKeyAuthorized( - const UserContext& context, - const cryptohome::KeyDefinition& key, - const std::string& signature, - const base::Closure& success_callback) override; - virtual void RemoveKey(const UserContext& context, - const std::string& key_to_remove, - const base::Closure& success_callback) override; - virtual void TransformKeyIfNeeded(const UserContext& user_context, - const ContextCallback& callback) override; + void AuthenticateToCheck(const UserContext& context, + const base::Closure& success_callback) override; + void CreateMount(const std::string& user_id, + const std::vector<cryptohome::KeyDefinition>& keys, + const ResultCallback& success_callback) override; + void AddKey(const UserContext& context, + const cryptohome::KeyDefinition& key, + bool replace_existing, + const base::Closure& success_callback) override; + void UpdateKeyAuthorized(const UserContext& context, + const cryptohome::KeyDefinition& key, + const std::string& signature, + const base::Closure& success_callback) override; + void RemoveKey(const UserContext& context, + const std::string& key_to_remove, + const base::Closure& success_callback) override; + void TransformKeyIfNeeded(const UserContext& user_context, + const ContextCallback& callback) override; private: - virtual ~ExtendedAuthenticatorImpl(); + ~ExtendedAuthenticatorImpl() override; // Callback for system salt getter. void OnSaltObtained(const std::string& system_salt); diff --git a/chromeos/login/auth/fake_extended_authenticator.h b/chromeos/login/auth/fake_extended_authenticator.h index 54b0319f..96dc4f4 100644 --- a/chromeos/login/auth/fake_extended_authenticator.h +++ b/chromeos/login/auth/fake_extended_authenticator.h @@ -22,32 +22,30 @@ class CHROMEOS_EXPORT FakeExtendedAuthenticator : public ExtendedAuthenticator { const UserContext& expected_user_context); // ExtendedAuthenticator: - virtual void SetConsumer(AuthStatusConsumer* consumer) override; - virtual void AuthenticateToMount( - const UserContext& context, - const ResultCallback& success_callback) override; - virtual void AuthenticateToCheck( - const UserContext& context, - const base::Closure& success_callback) override; - virtual void CreateMount(const std::string& user_id, - const std::vector<cryptohome::KeyDefinition>& keys, + void SetConsumer(AuthStatusConsumer* consumer) override; + void AuthenticateToMount(const UserContext& context, const ResultCallback& success_callback) override; - virtual void AddKey(const UserContext& context, - const cryptohome::KeyDefinition& key, - bool replace_existing, - const base::Closure& success_callback) override; - virtual void UpdateKeyAuthorized( - const UserContext& context, - const cryptohome::KeyDefinition& key, - const std::string& signature, - const base::Closure& success_callback) override; - virtual void RemoveKey(const UserContext& context, - const std::string& key_to_remove, - const base::Closure& success_callback) override; - virtual void TransformKeyIfNeeded(const UserContext& user_context, - const ContextCallback& callback) override; + void AuthenticateToCheck(const UserContext& context, + const base::Closure& success_callback) override; + void CreateMount(const std::string& user_id, + const std::vector<cryptohome::KeyDefinition>& keys, + const ResultCallback& success_callback) override; + void AddKey(const UserContext& context, + const cryptohome::KeyDefinition& key, + bool replace_existing, + const base::Closure& success_callback) override; + void UpdateKeyAuthorized(const UserContext& context, + const cryptohome::KeyDefinition& key, + const std::string& signature, + const base::Closure& success_callback) override; + void RemoveKey(const UserContext& context, + const std::string& key_to_remove, + const base::Closure& success_callback) override; + void TransformKeyIfNeeded(const UserContext& user_context, + const ContextCallback& callback) override; + private: - virtual ~FakeExtendedAuthenticator(); + ~FakeExtendedAuthenticator() override; void OnAuthSuccess(const UserContext& context); void OnAuthFailure(AuthState state, const AuthFailure& error); diff --git a/chromeos/login/auth/login_performer.h b/chromeos/login/auth/login_performer.h index 47ce631..0f81d04 100644 --- a/chromeos/login/auth/login_performer.h +++ b/chromeos/login/auth/login_performer.h @@ -54,7 +54,7 @@ class CHROMEOS_EXPORT LoginPerformer : public AuthStatusConsumer, // Delegate class to get notifications from the LoginPerformer. class Delegate : public AuthStatusConsumer { public: - virtual ~Delegate() {} + ~Delegate() override {} virtual void WhiteListCheckFailed(const std::string& email) = 0; virtual void PolicyLoadFailed() = 0; virtual void OnOnlineChecked(const std::string& email, bool success) = 0; @@ -62,7 +62,7 @@ class CHROMEOS_EXPORT LoginPerformer : public AuthStatusConsumer, LoginPerformer(scoped_refptr<base::TaskRunner> task_runner, Delegate* delegate); - virtual ~LoginPerformer(); + ~LoginPerformer() override; // Performs a login for |user_context|. // If auth_mode is AUTH_MODE_EXTENSION, there are no further auth checks, @@ -84,10 +84,10 @@ class CHROMEOS_EXPORT LoginPerformer : public AuthStatusConsumer, bool use_guest_mount); // AuthStatusConsumer implementation: - virtual void OnAuthFailure(const AuthFailure& error) override; - virtual void OnAuthSuccess(const UserContext& user_context) override; - virtual void OnOffTheRecordAuthSuccess() override; - virtual void OnPasswordChangeDetected() override; + void OnAuthFailure(const AuthFailure& error) override; + void OnAuthSuccess(const UserContext& user_context) override; + void OnOffTheRecordAuthSuccess() override; + void OnPasswordChangeDetected() override; // Migrates cryptohome using |old_password| specified. void RecoverEncryptedData(const std::string& old_password); @@ -118,7 +118,7 @@ class CHROMEOS_EXPORT LoginPerformer : public AuthStatusConsumer, protected: // Implements OnlineAttemptHost::Delegate. - virtual void OnChecked(const std::string& user_id, bool success) override; + void OnChecked(const std::string& user_id, bool success) override; // Platform-dependant methods to be implemented by concrete class. diff --git a/chromeos/login/auth/mock_authenticator.h b/chromeos/login/auth/mock_authenticator.h index 158cec7..e36eb6c 100644 --- a/chromeos/login/auth/mock_authenticator.h +++ b/chromeos/login/auth/mock_authenticator.h @@ -27,25 +27,25 @@ class CHROMEOS_EXPORT MockAuthenticator : public Authenticator { const UserContext& expected_user_context); // Authenticator: - virtual void CompleteLogin(content::BrowserContext* context, - const UserContext& user_context) override; - virtual void AuthenticateToLogin(content::BrowserContext* context, - const UserContext& user_context) override; - virtual void AuthenticateToUnlock(const UserContext& user_context) override; - virtual void LoginAsSupervisedUser(const UserContext& user_context) override; - virtual void LoginOffTheRecord() override; - virtual void LoginAsPublicSession(const UserContext& user_context) override; - virtual void LoginAsKioskAccount(const std::string& app_user_id, - bool use_guest_mount) override; - virtual void OnAuthSuccess() override; - virtual void OnAuthFailure(const AuthFailure& failure) override; - virtual void RecoverEncryptedData(const std::string& old_password) override; - virtual void ResyncEncryptedData() override; + void CompleteLogin(content::BrowserContext* context, + const UserContext& user_context) override; + void AuthenticateToLogin(content::BrowserContext* context, + const UserContext& user_context) override; + void AuthenticateToUnlock(const UserContext& user_context) override; + void LoginAsSupervisedUser(const UserContext& user_context) override; + void LoginOffTheRecord() override; + void LoginAsPublicSession(const UserContext& user_context) override; + void LoginAsKioskAccount(const std::string& app_user_id, + bool use_guest_mount) override; + void OnAuthSuccess() override; + void OnAuthFailure(const AuthFailure& failure) override; + void RecoverEncryptedData(const std::string& old_password) override; + void ResyncEncryptedData() override; virtual void SetExpectedCredentials(const UserContext& user_context); protected: - virtual ~MockAuthenticator(); + ~MockAuthenticator() override; private: UserContext expected_user_context_; diff --git a/chromeos/login/auth/mock_url_fetchers.h b/chromeos/login/auth/mock_url_fetchers.h index cb541ee..8d81e41 100644 --- a/chromeos/login/auth/mock_url_fetchers.h +++ b/chromeos/login/auth/mock_url_fetchers.h @@ -30,9 +30,9 @@ class ExpectCanceledFetcher : public net::TestURLFetcher { const std::string& results, net::URLFetcher::RequestType request_type, net::URLFetcherDelegate* d); - virtual ~ExpectCanceledFetcher(); + ~ExpectCanceledFetcher() override; - virtual void Start() override; + void Start() override; void CompleteFetch(); @@ -48,9 +48,9 @@ class GotCanceledFetcher : public net::TestURLFetcher { const std::string& results, net::URLFetcher::RequestType request_type, net::URLFetcherDelegate* d); - virtual ~GotCanceledFetcher(); + ~GotCanceledFetcher() override; - virtual void Start() override; + void Start() override; private: DISALLOW_COPY_AND_ASSIGN(GotCanceledFetcher); @@ -63,9 +63,9 @@ class SuccessFetcher : public net::TestURLFetcher { const std::string& results, net::URLFetcher::RequestType request_type, net::URLFetcherDelegate* d); - virtual ~SuccessFetcher(); + ~SuccessFetcher() override; - virtual void Start() override; + void Start() override; private: DISALLOW_COPY_AND_ASSIGN(SuccessFetcher); @@ -78,9 +78,9 @@ class FailFetcher : public net::TestURLFetcher { const std::string& results, net::URLFetcher::RequestType request_type, net::URLFetcherDelegate* d); - virtual ~FailFetcher(); + ~FailFetcher() override; - virtual void Start() override; + void Start() override; private: DISALLOW_COPY_AND_ASSIGN(FailFetcher); @@ -93,13 +93,13 @@ class CaptchaFetcher : public net::TestURLFetcher { const std::string& results, net::URLFetcher::RequestType request_type, net::URLFetcherDelegate* d); - virtual ~CaptchaFetcher(); + ~CaptchaFetcher() override; static std::string GetCaptchaToken(); static std::string GetCaptchaUrl(); static std::string GetUnlockUrl(); - virtual void Start() override; + void Start() override; private: static const char kCaptchaToken[]; @@ -116,9 +116,9 @@ class HostedFetcher : public net::TestURLFetcher { const std::string& results, net::URLFetcher::RequestType request_type, net::URLFetcherDelegate* d); - virtual ~HostedFetcher(); + ~HostedFetcher() override; - virtual void Start() override; + void Start() override; private: DISALLOW_COPY_AND_ASSIGN(HostedFetcher); diff --git a/chromeos/login/auth/online_attempt.h b/chromeos/login/auth/online_attempt.h index e03684b..032d2f5 100644 --- a/chromeos/login/auth/online_attempt.h +++ b/chromeos/login/auth/online_attempt.h @@ -31,7 +31,7 @@ class CHROMEOS_EXPORT OnlineAttempt : public GaiaAuthConsumer { public: OnlineAttempt(AuthAttemptState* current_attempt, AuthAttemptStateResolver* callback); - virtual ~OnlineAttempt(); + ~OnlineAttempt() override; // Initiate the online login attempt either through client or auth login. // Status will be recorded in |current_attempt|, and resolver_->Resolve() will @@ -40,9 +40,8 @@ class CHROMEOS_EXPORT OnlineAttempt : public GaiaAuthConsumer { void Initiate(net::URLRequestContextGetter* request_context); // GaiaAuthConsumer overrides. Callbacks from GaiaAuthFetcher - virtual void OnClientLoginFailure( - const GoogleServiceAuthError& error) override; - virtual void OnClientLoginSuccess( + void OnClientLoginFailure(const GoogleServiceAuthError& error) override; + void OnClientLoginSuccess( const GaiaAuthConsumer::ClientLoginResult& credentials) override; private: diff --git a/chromeos/login/auth/online_attempt_host.h b/chromeos/login/auth/online_attempt_host.h index da392450..ee9fcb9 100644 --- a/chromeos/login/auth/online_attempt_host.h +++ b/chromeos/login/auth/online_attempt_host.h @@ -34,7 +34,7 @@ class CHROMEOS_EXPORT OnlineAttemptHost : public AuthAttemptStateResolver { }; explicit OnlineAttemptHost(Delegate* delegate); - virtual ~OnlineAttemptHost(); + ~OnlineAttemptHost() override; // Performs an online check of the credentials in |request_context| and // invokes @@ -50,7 +50,7 @@ class CHROMEOS_EXPORT OnlineAttemptHost : public AuthAttemptStateResolver { // AuthAttemptStateResolver overrides. // Executed on IO thread. - virtual void Resolve() override; + void Resolve() override; // Does an actual resolve on UI thread. void ResolveOnUIThread(bool success); diff --git a/chromeos/login/auth/test_attempt_state.h b/chromeos/login/auth/test_attempt_state.h index cebe9d7..5c93862 100644 --- a/chromeos/login/auth/test_attempt_state.h +++ b/chromeos/login/auth/test_attempt_state.h @@ -19,7 +19,7 @@ class CHROMEOS_EXPORT TestAttemptState : public AuthAttemptState { public: TestAttemptState(const UserContext& credentials, const bool user_is_new); - virtual ~TestAttemptState(); + ~TestAttemptState() override; // Act as though an online login attempt completed already. void PresetOnlineLoginStatus(const AuthFailure& outcome); @@ -32,13 +32,13 @@ class CHROMEOS_EXPORT TestAttemptState : public AuthAttemptState { cryptohome::MountError cryptohome_code); // To allow state to be queried on the main thread during tests. - virtual bool online_complete() override; - virtual const AuthFailure& online_outcome() override; - virtual bool is_first_time_user() override; - virtual GaiaAuthFetcher::HostedAccountsSetting hosted_policy() override; - virtual bool cryptohome_complete() override; - virtual bool cryptohome_outcome() override; - virtual cryptohome::MountError cryptohome_code() override; + bool online_complete() override; + const AuthFailure& online_outcome() override; + bool is_first_time_user() override; + GaiaAuthFetcher::HostedAccountsSetting hosted_policy() override; + bool cryptohome_complete() override; + bool cryptohome_outcome() override; + cryptohome::MountError cryptohome_code() override; private: DISALLOW_COPY_AND_ASSIGN(TestAttemptState); diff --git a/chromeos/login/login_state_unittest.cc b/chromeos/login/login_state_unittest.cc index dbe448e..a6a5d4a 100644 --- a/chromeos/login/login_state_unittest.cc +++ b/chromeos/login/login_state_unittest.cc @@ -21,23 +21,22 @@ class LoginStateTest : public testing::Test, LoginStateTest() : logged_in_user_type_(LoginState::LOGGED_IN_USER_NONE), login_state_changes_count_(0) { } - virtual ~LoginStateTest() { - } + ~LoginStateTest() override {} // testing::Test - virtual void SetUp() override { + void SetUp() override { LoginState::Initialize(); LoginState::Get()->set_always_logged_in(false); LoginState::Get()->AddObserver(this); } - virtual void TearDown() override { + void TearDown() override { LoginState::Get()->RemoveObserver(this); LoginState::Shutdown(); } // LoginState::Observer - virtual void LoggedInStateChanged() override { + void LoggedInStateChanged() override { ++login_state_changes_count_; logged_in_user_type_ = LoginState::Get()->GetLoggedInUserType(); } diff --git a/chromeos/process_proxy/process_output_watcher_unittest.cc b/chromeos/process_proxy/process_output_watcher_unittest.cc index f08a852..5732467 100644 --- a/chromeos/process_proxy/process_output_watcher_unittest.cc +++ b/chromeos/process_proxy/process_output_watcher_unittest.cc @@ -88,9 +88,9 @@ class ProcessOutputWatcherTest : public testing::Test { failed_(false) { } - virtual ~ProcessOutputWatcherTest() {} + ~ProcessOutputWatcherTest() override {} - virtual void TearDown() override { + void TearDown() override { if (output_watch_thread_started_) output_watch_thread_->Stop(); } diff --git a/chromeos/process_proxy/process_proxy_unittest.cc b/chromeos/process_proxy/process_proxy_unittest.cc index cb41359..e6b9c46 100644 --- a/chromeos/process_proxy/process_proxy_unittest.cc +++ b/chromeos/process_proxy/process_proxy_unittest.cc @@ -39,9 +39,9 @@ class TestRunner { class RegistryTestRunner : public TestRunner { public: - virtual ~RegistryTestRunner() {} + ~RegistryTestRunner() override {} - virtual void SetupExpectations(pid_t pid) override { + void SetupExpectations(pid_t pid) override { pid_ = pid; left_to_check_index_[0] = 0; left_to_check_index_[1] = 0; @@ -59,8 +59,9 @@ class RegistryTestRunner : public TestRunner { // abc|abcdef|defgh|gh). To deal with that, we allow to test received text // against two lines. The lines MUST NOT have two same characters for this // algorithm to work. - virtual void OnSomeRead(pid_t pid, const std::string& type, - const std::string& output) override { + void OnSomeRead(pid_t pid, + const std::string& type, + const std::string& output) override { EXPECT_EQ(type, kStdoutType); EXPECT_EQ(pid_, pid); @@ -79,7 +80,7 @@ class RegistryTestRunner : public TestRunner { } } - virtual void StartRegistryTest(ProcessProxyRegistry* registry) override { + void StartRegistryTest(ProcessProxyRegistry* registry) override { for (int i = 0; i < kTestLineNum; i++) { EXPECT_TRUE(registry->SendInput(pid_, kTestLineToSend)); } @@ -116,15 +117,16 @@ class RegistryTestRunner : public TestRunner { class RegistryNotifiedOnProcessExitTestRunner : public TestRunner { public: - virtual ~RegistryNotifiedOnProcessExitTestRunner() {} + ~RegistryNotifiedOnProcessExitTestRunner() override {} - virtual void SetupExpectations(pid_t pid) override { + void SetupExpectations(pid_t pid) override { output_received_ = false; pid_ = pid; } - virtual void OnSomeRead(pid_t pid, const std::string& type, - const std::string& output) override { + void OnSomeRead(pid_t pid, + const std::string& type, + const std::string& output) override { EXPECT_EQ(pid_, pid); if (!output_received_) { output_received_ = true; @@ -138,7 +140,7 @@ class RegistryNotifiedOnProcessExitTestRunner : public TestRunner { base::MessageLoop::QuitClosure()); } - virtual void StartRegistryTest(ProcessProxyRegistry* registry) override { + void StartRegistryTest(ProcessProxyRegistry* registry) override { EXPECT_TRUE(registry->SendInput(pid_, "p")); } @@ -148,14 +150,13 @@ class RegistryNotifiedOnProcessExitTestRunner : public TestRunner { class SigIntTestRunner : public TestRunner { public: - virtual ~SigIntTestRunner() {} + ~SigIntTestRunner() override {} - virtual void SetupExpectations(pid_t pid) override { - pid_ = pid; - } + void SetupExpectations(pid_t pid) override { pid_ = pid; } - virtual void OnSomeRead(pid_t pid, const std::string& type, - const std::string& output) override { + void OnSomeRead(pid_t pid, + const std::string& type, + const std::string& output) override { EXPECT_EQ(pid_, pid); // We may receive ^C on stdout, but we don't care about that, as long as we // eventually received exit event. @@ -165,7 +166,7 @@ class SigIntTestRunner : public TestRunner { } } - virtual void StartRegistryTest(ProcessProxyRegistry* registry) override { + void StartRegistryTest(ProcessProxyRegistry* registry) override { // Send SingInt and verify the process exited. EXPECT_TRUE(registry->SendInput(pid_, "\003")); } @@ -176,7 +177,7 @@ class SigIntTestRunner : public TestRunner { class ProcessProxyTest : public testing::Test { public: ProcessProxyTest() {} - virtual ~ProcessProxyTest() {} + ~ProcessProxyTest() override {} protected: void InitRegistryTest() { diff --git a/chromeos/settings/timezone_settings.cc b/chromeos/settings/timezone_settings.cc index 7403b5ba..08704b8 100644 --- a/chromeos/settings/timezone_settings.cc +++ b/chromeos/settings/timezone_settings.cc @@ -259,15 +259,15 @@ void SetTimezoneIDFromString(const std::string& id) { // Common code of the TimezoneSettings implementations. class TimezoneSettingsBaseImpl : public chromeos::system::TimezoneSettings { public: - virtual ~TimezoneSettingsBaseImpl(); + ~TimezoneSettingsBaseImpl() override; // TimezoneSettings implementation: - virtual const icu::TimeZone& GetTimezone() override; - virtual base::string16 GetCurrentTimezoneID() override; - virtual void SetTimezoneFromID(const base::string16& timezone_id) override; - virtual void AddObserver(Observer* observer) override; - virtual void RemoveObserver(Observer* observer) override; - virtual const std::vector<icu::TimeZone*>& GetTimezoneList() const override; + const icu::TimeZone& GetTimezone() override; + base::string16 GetCurrentTimezoneID() override; + void SetTimezoneFromID(const base::string16& timezone_id) override; + void AddObserver(Observer* observer) override; + void RemoveObserver(Observer* observer) override; + const std::vector<icu::TimeZone*>& GetTimezoneList() const override; protected: TimezoneSettingsBaseImpl(); @@ -294,7 +294,7 @@ class TimezoneSettingsBaseImpl : public chromeos::system::TimezoneSettings { class TimezoneSettingsImpl : public TimezoneSettingsBaseImpl { public: // TimezoneSettings implementation: - virtual void SetTimezone(const icu::TimeZone& timezone) override; + void SetTimezone(const icu::TimeZone& timezone) override; static TimezoneSettingsImpl* GetInstance(); @@ -310,7 +310,7 @@ class TimezoneSettingsImpl : public TimezoneSettingsBaseImpl { class TimezoneSettingsStubImpl : public TimezoneSettingsBaseImpl { public: // TimezoneSettings implementation: - virtual void SetTimezone(const icu::TimeZone& timezone) override; + void SetTimezone(const icu::TimeZone& timezone) override; static TimezoneSettingsStubImpl* GetInstance(); diff --git a/chromeos/system/fake_statistics_provider.h b/chromeos/system/fake_statistics_provider.h index c2dde04..7ea8ec2 100644 --- a/chromeos/system/fake_statistics_provider.h +++ b/chromeos/system/fake_statistics_provider.h @@ -17,18 +17,18 @@ namespace system { class FakeStatisticsProvider : public StatisticsProvider { public: FakeStatisticsProvider(); - virtual ~FakeStatisticsProvider(); + ~FakeStatisticsProvider() override; // StatisticsProvider implementation: - virtual void StartLoadingMachineStatistics( + void StartLoadingMachineStatistics( const scoped_refptr<base::TaskRunner>& file_task_runner, bool load_oem_manifest) override; - virtual bool GetMachineStatistic(const std::string& name, - std::string* result) override; - virtual bool HasMachineStatistic(const std::string& name) override; - virtual bool GetMachineFlag(const std::string& name, bool* result) override; - virtual bool HasMachineFlag(const std::string& name) override; - virtual void Shutdown() override; + bool GetMachineStatistic(const std::string& name, + std::string* result) override; + bool HasMachineStatistic(const std::string& name) override; + bool GetMachineFlag(const std::string& name, bool* result) override; + bool HasMachineFlag(const std::string& name) override; + void Shutdown() override; void SetMachineStatistic(const std::string& key, const std::string& value); void ClearMachineStatistic(const std::string& key); @@ -47,7 +47,7 @@ class FakeStatisticsProvider : public StatisticsProvider { class ScopedFakeStatisticsProvider : public FakeStatisticsProvider { public: ScopedFakeStatisticsProvider(); - virtual ~ScopedFakeStatisticsProvider(); + ~ScopedFakeStatisticsProvider() override; private: DISALLOW_COPY_AND_ASSIGN(ScopedFakeStatisticsProvider); diff --git a/chromeos/system/statistics_provider.cc b/chromeos/system/statistics_provider.cc index 7ac8863..8451bdf 100644 --- a/chromeos/system/statistics_provider.cc +++ b/chromeos/system/statistics_provider.cc @@ -94,15 +94,15 @@ bool HasOemPrefix(const std::string& name) { class StatisticsProviderImpl : public StatisticsProvider { public: // StatisticsProvider implementation: - virtual void StartLoadingMachineStatistics( + void StartLoadingMachineStatistics( const scoped_refptr<base::TaskRunner>& file_task_runner, bool load_oem_manifest) override; - virtual bool GetMachineStatistic(const std::string& name, - std::string* result) override; - virtual bool HasMachineStatistic(const std::string& name) override; - virtual bool GetMachineFlag(const std::string& name, bool* result) override; - virtual bool HasMachineFlag(const std::string& name) override; - virtual void Shutdown() override; + bool GetMachineStatistic(const std::string& name, + std::string* result) override; + bool HasMachineStatistic(const std::string& name) override; + bool GetMachineFlag(const std::string& name, bool* result) override; + bool HasMachineFlag(const std::string& name) override; + void Shutdown() override; static StatisticsProviderImpl* GetInstance(); @@ -111,7 +111,7 @@ class StatisticsProviderImpl : public StatisticsProvider { friend struct DefaultSingletonTraits<StatisticsProviderImpl>; StatisticsProviderImpl(); - virtual ~StatisticsProviderImpl(); + ~StatisticsProviderImpl() override; // Waits up to |kTimeoutSecs| for statistics to be loaded. Returns true if // they were loaded successfully. diff --git a/chromeos/timezone/timezone_request.h b/chromeos/timezone/timezone_request.h index 2433236..e908578 100644 --- a/chromeos/timezone/timezone_request.h +++ b/chromeos/timezone/timezone_request.h @@ -75,7 +75,7 @@ class CHROMEOS_EXPORT TimeZoneRequest : private net::URLFetcherDelegate { const Geoposition& geoposition, base::TimeDelta retry_timeout); - virtual ~TimeZoneRequest(); + ~TimeZoneRequest() override; // Initiates request. // Note: if request object is destroyed before callback is called, @@ -94,7 +94,7 @@ class CHROMEOS_EXPORT TimeZoneRequest : private net::URLFetcherDelegate { private: // net::URLFetcherDelegate - virtual void OnURLFetchComplete(const net::URLFetcher* source) override; + void OnURLFetchComplete(const net::URLFetcher* source) override; // Start new request. void StartRequest(); |