diff --git a/chromeos/attestation/attestation_flow.h b/chromeos/attestation/attestation_flow.h index 7ad61231fe13f4..55033285002ccb 100644 --- a/chromeos/attestation/attestation_flow.h +++ b/chromeos/attestation/attestation_flow.h @@ -77,6 +77,9 @@ class COMPONENT_EXPORT(CHROMEOS_ATTESTATION) AttestationFlow { AttestationFlow(std::unique_ptr server_proxy, ::attestation::KeyType crypto_key_type); + AttestationFlow(const AttestationFlow&) = delete; + AttestationFlow& operator=(const AttestationFlow&) = delete; + virtual ~AttestationFlow(); // Sets the timeout for attestation to be ready. @@ -285,8 +288,6 @@ class COMPONENT_EXPORT(CHROMEOS_ATTESTATION) AttestationFlow { base::TimeDelta retry_delay_; base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(AttestationFlow); }; } // namespace attestation diff --git a/chromeos/attestation/mock_attestation_flow.h b/chromeos/attestation/mock_attestation_flow.h index 4302bb12d6b9ec..e1b89af0733587 100644 --- a/chromeos/attestation/mock_attestation_flow.h +++ b/chromeos/attestation/mock_attestation_flow.h @@ -23,6 +23,10 @@ namespace attestation { class FakeServerProxy : public ServerProxy { public: FakeServerProxy(); + + FakeServerProxy(const FakeServerProxy&) = delete; + FakeServerProxy& operator=(const FakeServerProxy&) = delete; + ~FakeServerProxy() override; void set_result(bool result) { @@ -50,8 +54,6 @@ class FakeServerProxy : public ServerProxy { std::string enroll_response_; std::string cert_response_; - - DISALLOW_COPY_AND_ASSIGN(FakeServerProxy); }; class MockServerProxy : public FakeServerProxy { diff --git a/chromeos/components/camera_app_ui/camera_app_helper_impl.h b/chromeos/components/camera_app_ui/camera_app_helper_impl.h index ecf2ef82c51eec..58a6d17d740b8b 100644 --- a/chromeos/components/camera_app_ui/camera_app_helper_impl.h +++ b/chromeos/components/camera_app_ui/camera_app_helper_impl.h @@ -43,6 +43,10 @@ class CameraAppHelperImpl : public ash::TabletModeObserver, CameraResultCallback camera_result_callback, SendBroadcastCallback send_broadcast_callback, aura::Window* window); + + CameraAppHelperImpl(const CameraAppHelperImpl&) = delete; + CameraAppHelperImpl& operator=(const CameraAppHelperImpl&) = delete; + ~CameraAppHelperImpl() override; void Bind(mojo::PendingReceiver receiver); @@ -139,8 +143,6 @@ class CameraAppHelperImpl : public ash::TabletModeObserver, // Client to connect to document detection service. std::unique_ptr document_scanner_service_; - - DISALLOW_COPY_AND_ASSIGN(CameraAppHelperImpl); }; } // namespace chromeos_camera diff --git a/chromeos/components/camera_app_ui/camera_app_ui.h b/chromeos/components/camera_app_ui/camera_app_ui.h index 2d56f1b66b082e..14b275464c557a 100644 --- a/chromeos/components/camera_app_ui/camera_app_ui.h +++ b/chromeos/components/camera_app_ui/camera_app_ui.h @@ -30,6 +30,10 @@ class CameraAppUI : public ui::MojoWebUIController, public: CameraAppUI(content::WebUI* web_ui, std::unique_ptr delegate); + + CameraAppUI(const CameraAppUI&) = delete; + CameraAppUI& operator=(const CameraAppUI&) = delete; + ~CameraAppUI() override; // Instantiates implementor of the cros::mojom::CameraAppDeviceProvider mojo @@ -67,8 +71,6 @@ class CameraAppUI : public ui::MojoWebUIController, std::unique_ptr helper_; WEB_UI_CONTROLLER_TYPE_DECL(); - - DISALLOW_COPY_AND_ASSIGN(CameraAppUI); }; } // namespace chromeos diff --git a/chromeos/components/multidevice/debug_webui/proximity_auth_ui.h b/chromeos/components/multidevice/debug_webui/proximity_auth_ui.h index 7fb3ffd2b6c2d1..5250355247d769 100644 --- a/chromeos/components/multidevice/debug_webui/proximity_auth_ui.h +++ b/chromeos/components/multidevice/debug_webui/proximity_auth_ui.h @@ -35,6 +35,10 @@ class ProximityAuthUI : public ui::MojoWebUIController { device_sync::DeviceSyncClient* device_sync_client, secure_channel::SecureChannelClient* secure_channel_client, MultiDeviceSetupBinder multidevice_setup_binder); + + ProximityAuthUI(const ProximityAuthUI&) = delete; + ProximityAuthUI& operator=(const ProximityAuthUI&) = delete; + ~ProximityAuthUI() override; // Instantiates implementor of the mojom::MultiDeviceSetup mojo interface @@ -47,8 +51,6 @@ class ProximityAuthUI : public ui::MojoWebUIController { const MultiDeviceSetupBinder multidevice_setup_binder_; WEB_UI_CONTROLLER_TYPE_DECL(); - - DISALLOW_COPY_AND_ASSIGN(ProximityAuthUI); }; } // namespace multidevice diff --git a/chromeos/components/multidevice/debug_webui/proximity_auth_webui_handler.h b/chromeos/components/multidevice/debug_webui/proximity_auth_webui_handler.h index c1343fd7b1e6b1..7b225d7935ead4 100644 --- a/chromeos/components/multidevice/debug_webui/proximity_auth_webui_handler.h +++ b/chromeos/components/multidevice/debug_webui/proximity_auth_webui_handler.h @@ -41,6 +41,11 @@ class ProximityAuthWebUIHandler ProximityAuthWebUIHandler( device_sync::DeviceSyncClient* device_sync_client, secure_channel::SecureChannelClient* secure_channel_client); + + ProximityAuthWebUIHandler(const ProximityAuthWebUIHandler&) = delete; + ProximityAuthWebUIHandler& operator=(const ProximityAuthWebUIHandler&) = + delete; + ~ProximityAuthWebUIHandler() override; // content::WebUIMessageHandler: @@ -129,8 +134,6 @@ class ProximityAuthWebUIHandler bool get_local_state_update_waiting_for_debug_info_ = false; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ProximityAuthWebUIHandler); }; } // namespace multidevice diff --git a/chromeos/components/multidevice/expiring_remote_device_cache.h b/chromeos/components/multidevice/expiring_remote_device_cache.h index 28ade2e99e0f42..2488e001ee1be9 100644 --- a/chromeos/components/multidevice/expiring_remote_device_cache.h +++ b/chromeos/components/multidevice/expiring_remote_device_cache.h @@ -36,6 +36,11 @@ class RemoteDeviceCache; class ExpiringRemoteDeviceCache { public: ExpiringRemoteDeviceCache(); + + ExpiringRemoteDeviceCache(const ExpiringRemoteDeviceCache&) = delete; + ExpiringRemoteDeviceCache& operator=(const ExpiringRemoteDeviceCache&) = + delete; + virtual ~ExpiringRemoteDeviceCache(); void SetRemoteDevicesAndInvalidateOldEntries( @@ -64,8 +69,6 @@ class ExpiringRemoteDeviceCache { base::flat_set legacy_device_ids_from_last_set_call_; base::flat_set instance_ids_from_last_set_call_; - - DISALLOW_COPY_AND_ASSIGN(ExpiringRemoteDeviceCache); }; } // namespace multidevice diff --git a/chromeos/components/multidevice/fake_secure_message_delegate.h b/chromeos/components/multidevice/fake_secure_message_delegate.h index 8bf3d17f8dd61f..5809b390c0daac 100644 --- a/chromeos/components/multidevice/fake_secure_message_delegate.h +++ b/chromeos/components/multidevice/fake_secure_message_delegate.h @@ -21,6 +21,11 @@ namespace multidevice { class FakeSecureMessageDelegate : public SecureMessageDelegate { public: FakeSecureMessageDelegate(); + + FakeSecureMessageDelegate(const FakeSecureMessageDelegate&) = delete; + FakeSecureMessageDelegate& operator=(const FakeSecureMessageDelegate&) = + delete; + ~FakeSecureMessageDelegate() override; // SecureMessageDelegate: @@ -48,14 +53,18 @@ class FakeSecureMessageDelegate : public SecureMessageDelegate { private: std::string next_public_key_; - - DISALLOW_COPY_AND_ASSIGN(FakeSecureMessageDelegate); }; class FakeSecureMessageDelegateFactory : public multidevice::SecureMessageDelegateImpl::Factory { public: FakeSecureMessageDelegateFactory() = default; + + FakeSecureMessageDelegateFactory(const FakeSecureMessageDelegateFactory&) = + delete; + FakeSecureMessageDelegateFactory& operator=( + const FakeSecureMessageDelegateFactory&) = delete; + ~FakeSecureMessageDelegateFactory() override = default; multidevice::FakeSecureMessageDelegate* instance() { return instance_; } @@ -65,8 +74,6 @@ class FakeSecureMessageDelegateFactory std::unique_ptr CreateInstance() override; multidevice::FakeSecureMessageDelegate* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeSecureMessageDelegateFactory); }; } // namespace multidevice diff --git a/chromeos/components/multidevice/logging/log_buffer.h b/chromeos/components/multidevice/logging/log_buffer.h index 436744367e0176..3a78933ab88553 100644 --- a/chromeos/components/multidevice/logging/log_buffer.h +++ b/chromeos/components/multidevice/logging/log_buffer.h @@ -48,6 +48,10 @@ class LogBuffer { }; LogBuffer(); + + LogBuffer(const LogBuffer&) = delete; + LogBuffer& operator=(const LogBuffer&) = delete; + ~LogBuffer(); // Returns the global instance. @@ -76,8 +80,6 @@ class LogBuffer { // List of observers. base::ObserverList::Unchecked observers_; - - DISALLOW_COPY_AND_ASSIGN(LogBuffer); }; } // namespace multidevice diff --git a/chromeos/components/multidevice/logging/logging.h b/chromeos/components/multidevice/logging/logging.h index d08fb3466e1e6e..7c35c69d86a8b9 100644 --- a/chromeos/components/multidevice/logging/logging.h +++ b/chromeos/components/multidevice/logging/logging.h @@ -44,6 +44,10 @@ class ScopedDisableLoggingForTesting { class ScopedLogMessage { public: ScopedLogMessage(const char* file, int line, logging::LogSeverity severity); + + ScopedLogMessage(const ScopedLogMessage&) = delete; + ScopedLogMessage& operator=(const ScopedLogMessage&) = delete; + ~ScopedLogMessage(); std::ostream& stream() { return stream_; } @@ -53,8 +57,6 @@ class ScopedLogMessage { int line_; logging::LogSeverity severity_; std::ostringstream stream_; - - DISALLOW_COPY_AND_ASSIGN(ScopedLogMessage); }; } // namespace multidevice diff --git a/chromeos/components/proximity_auth/fake_lock_handler.h b/chromeos/components/proximity_auth/fake_lock_handler.h index 11493d30cddf7f..aa1ad70ffcb15c 100644 --- a/chromeos/components/proximity_auth/fake_lock_handler.h +++ b/chromeos/components/proximity_auth/fake_lock_handler.h @@ -13,6 +13,10 @@ namespace proximity_auth { class FakeLockHandler : public ScreenlockBridge::LockHandler { public: FakeLockHandler(); + + FakeLockHandler(const FakeLockHandler&) = delete; + FakeLockHandler& operator=(const FakeLockHandler&) = delete; + ~FakeLockHandler() override; // LockHandler: @@ -32,9 +36,6 @@ class FakeLockHandler : public ScreenlockBridge::LockHandler { void AttemptEasySignin(const AccountId& account_id, const std::string& secret, const std::string& key_label) override; - - private: - DISALLOW_COPY_AND_ASSIGN(FakeLockHandler); }; } // namespace proximity_auth diff --git a/chromeos/components/proximity_auth/fake_remote_device_life_cycle.h b/chromeos/components/proximity_auth/fake_remote_device_life_cycle.h index 5bf2404bb1c6de..2b7af60ad71549 100644 --- a/chromeos/components/proximity_auth/fake_remote_device_life_cycle.h +++ b/chromeos/components/proximity_auth/fake_remote_device_life_cycle.h @@ -19,6 +19,11 @@ class FakeRemoteDeviceLifeCycle : public RemoteDeviceLifeCycle { explicit FakeRemoteDeviceLifeCycle( chromeos::multidevice::RemoteDeviceRef remote_device, absl::optional local_device); + + FakeRemoteDeviceLifeCycle(const FakeRemoteDeviceLifeCycle&) = delete; + FakeRemoteDeviceLifeCycle& operator=(const FakeRemoteDeviceLifeCycle&) = + delete; + ~FakeRemoteDeviceLifeCycle() override; // RemoteDeviceLifeCycle: @@ -55,8 +60,6 @@ class FakeRemoteDeviceLifeCycle : public RemoteDeviceLifeCycle { State state_; chromeos::secure_channel::ClientChannel* channel_; Messenger* messenger_; - - DISALLOW_COPY_AND_ASSIGN(FakeRemoteDeviceLifeCycle); }; } // namespace proximity_auth diff --git a/chromeos/components/proximity_auth/messenger_impl.h b/chromeos/components/proximity_auth/messenger_impl.h index 74810884acb4b3..315902f125078d 100644 --- a/chromeos/components/proximity_auth/messenger_impl.h +++ b/chromeos/components/proximity_auth/messenger_impl.h @@ -31,6 +31,10 @@ class MessengerImpl : public Messenger, // The messenger begins observing messages as soon as it is constructed. explicit MessengerImpl( std::unique_ptr channel); + + MessengerImpl(const MessengerImpl&) = delete; + MessengerImpl& operator=(const MessengerImpl&) = delete; + ~MessengerImpl() override; // Messenger: @@ -102,8 +106,6 @@ class MessengerImpl : public Messenger, std::unique_ptr pending_message_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(MessengerImpl); }; } // namespace proximity_auth diff --git a/chromeos/components/proximity_auth/messenger_impl_unittest.cc b/chromeos/components/proximity_auth/messenger_impl_unittest.cc index ac1dca525ec375..95b800039e2ba4 100644 --- a/chromeos/components/proximity_auth/messenger_impl_unittest.cc +++ b/chromeos/components/proximity_auth/messenger_impl_unittest.cc @@ -37,6 +37,10 @@ class MockMessengerObserver : public MessengerObserver { explicit MockMessengerObserver(Messenger* messenger) : messenger_(messenger) { messenger_->AddObserver(this); } + + MockMessengerObserver(const MockMessengerObserver&) = delete; + MockMessengerObserver& operator=(const MockMessengerObserver&) = delete; + virtual ~MockMessengerObserver() { messenger_->RemoveObserver(this); } MOCK_METHOD1(OnUnlockEventSent, void(bool success)); @@ -54,8 +58,6 @@ class MockMessengerObserver : public MessengerObserver { private: // The messenger that |this| instance observes. Messenger* const messenger_; - - DISALLOW_COPY_AND_ASSIGN(MockMessengerObserver); }; class TestMessenger : public MessengerImpl { @@ -63,10 +65,11 @@ class TestMessenger : public MessengerImpl { TestMessenger( std::unique_ptr channel) : MessengerImpl(std::move(channel)) {} - ~TestMessenger() override {} - private: - DISALLOW_COPY_AND_ASSIGN(TestMessenger); + TestMessenger(const TestMessenger&) = delete; + TestMessenger& operator=(const TestMessenger&) = delete; + + ~TestMessenger() override {} }; } // namespace diff --git a/chromeos/components/proximity_auth/mock_proximity_auth_client.h b/chromeos/components/proximity_auth/mock_proximity_auth_client.h index 547184a05a45d9..43183b27b15018 100644 --- a/chromeos/components/proximity_auth/mock_proximity_auth_client.h +++ b/chromeos/components/proximity_auth/mock_proximity_auth_client.h @@ -18,6 +18,10 @@ namespace proximity_auth { class MockProximityAuthClient : public ProximityAuthClient { public: MockProximityAuthClient(); + + MockProximityAuthClient(const MockProximityAuthClient&) = delete; + MockProximityAuthClient& operator=(const MockProximityAuthClient&) = delete; + ~MockProximityAuthClient() override; // ProximityAuthClient: @@ -32,9 +36,6 @@ class MockProximityAuthClient : public ProximityAuthClient { base::OnceCallback callback)); MOCK_CONST_METHOD0(GetAuthenticatedUsername, std::string(void)); MOCK_METHOD0(GetPrefManager, ProximityAuthPrefManager*(void)); - - private: - DISALLOW_COPY_AND_ASSIGN(MockProximityAuthClient); }; } // namespace proximity_auth diff --git a/chromeos/components/proximity_auth/proximity_auth_local_state_pref_manager.h b/chromeos/components/proximity_auth/proximity_auth_local_state_pref_manager.h index cffcf952ccc8f8..a7ebadd40062be 100644 --- a/chromeos/components/proximity_auth/proximity_auth_local_state_pref_manager.h +++ b/chromeos/components/proximity_auth/proximity_auth_local_state_pref_manager.h @@ -27,6 +27,12 @@ namespace proximity_auth { class ProximityAuthLocalStatePrefManager : public ProximityAuthPrefManager { public: explicit ProximityAuthLocalStatePrefManager(PrefService* local_state); + + ProximityAuthLocalStatePrefManager( + const ProximityAuthLocalStatePrefManager&) = delete; + ProximityAuthLocalStatePrefManager& operator=( + const ProximityAuthLocalStatePrefManager&) = delete; + ~ProximityAuthLocalStatePrefManager() override; // Registers the prefs used by this class to the given |pref_service|. @@ -64,8 +70,6 @@ class ProximityAuthLocalStatePrefManager : public ProximityAuthPrefManager { // The account id of the active user for which to fetch the prefs. AccountId active_user_; - - DISALLOW_COPY_AND_ASSIGN(ProximityAuthLocalStatePrefManager); }; } // namespace proximity_auth diff --git a/chromeos/components/proximity_auth/proximity_auth_pref_manager.h b/chromeos/components/proximity_auth/proximity_auth_pref_manager.h index bfa1325ca2cabb..7685c918924090 100644 --- a/chromeos/components/proximity_auth/proximity_auth_pref_manager.h +++ b/chromeos/components/proximity_auth/proximity_auth_pref_manager.h @@ -17,6 +17,10 @@ namespace proximity_auth { class ProximityAuthPrefManager { public: ProximityAuthPrefManager() {} + + ProximityAuthPrefManager(const ProximityAuthPrefManager&) = delete; + ProximityAuthPrefManager& operator=(const ProximityAuthPrefManager&) = delete; + virtual ~ProximityAuthPrefManager() {} // Returns true if EasyUnlock is allowed. Note: there is no corresponding @@ -60,9 +64,6 @@ class ProximityAuthPrefManager { // message on the login screen has been shown. virtual void SetHasShownLoginDisabledMessage(bool has_shown) = 0; virtual bool HasShownLoginDisabledMessage() const = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(ProximityAuthPrefManager); }; } // namespace proximity_auth diff --git a/chromeos/components/proximity_auth/proximity_auth_profile_pref_manager.h b/chromeos/components/proximity_auth/proximity_auth_profile_pref_manager.h index 7a3c7cc241455a..58e31fed5babd0 100644 --- a/chromeos/components/proximity_auth/proximity_auth_profile_pref_manager.h +++ b/chromeos/components/proximity_auth/proximity_auth_profile_pref_manager.h @@ -38,6 +38,12 @@ class ProximityAuthProfilePrefManager PrefService* pref_service, chromeos::multidevice_setup::MultiDeviceSetupClient* multidevice_setup_client); + + ProximityAuthProfilePrefManager(const ProximityAuthProfilePrefManager&) = + delete; + ProximityAuthProfilePrefManager& operator=( + const ProximityAuthProfilePrefManager&) = delete; + ~ProximityAuthProfilePrefManager() override; // Initializes the manager to listen to pref changes and sync prefs to the @@ -92,8 +98,6 @@ class ProximityAuthProfilePrefManager multidevice_setup_client_ = nullptr; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ProximityAuthProfilePrefManager); }; } // namespace proximity_auth diff --git a/chromeos/components/proximity_auth/proximity_auth_system.h b/chromeos/components/proximity_auth/proximity_auth_system.h index 448cd2ad3d10fb..93e7b36b7394b9 100644 --- a/chromeos/components/proximity_auth/proximity_auth_system.h +++ b/chromeos/components/proximity_auth/proximity_auth_system.h @@ -38,6 +38,10 @@ class ProximityAuthSystem : public ScreenlockBridge::Observer { ScreenlockType screenlock_type, ProximityAuthClient* proximity_auth_client, chromeos::secure_channel::SecureChannelClient* secure_channel_client); + + ProximityAuthSystem(const ProximityAuthSystem&) = delete; + ProximityAuthSystem& operator=(const ProximityAuthSystem&) = delete; + ~ProximityAuthSystem() override; // Starts the system to connect and authenticate when a registered user is @@ -128,8 +132,6 @@ class ProximityAuthSystem : public ScreenlockBridge::Observer { // True if the system is started_. bool started_; - - DISALLOW_COPY_AND_ASSIGN(ProximityAuthSystem); }; } // namespace proximity_auth diff --git a/chromeos/components/proximity_auth/proximity_auth_system_unittest.cc b/chromeos/components/proximity_auth/proximity_auth_system_unittest.cc index 7573ee38cc6e79..e2f7a9772b65c0 100644 --- a/chromeos/components/proximity_auth/proximity_auth_system_unittest.cc +++ b/chromeos/components/proximity_auth/proximity_auth_system_unittest.cc @@ -65,15 +65,16 @@ chromeos::multidevice::RemoteDeviceRef CreateRemoteDevice( class MockUnlockManager : public UnlockManager { public: MockUnlockManager() {} + + MockUnlockManager(const MockUnlockManager&) = delete; + MockUnlockManager& operator=(const MockUnlockManager&) = delete; + ~MockUnlockManager() override {} MOCK_METHOD0(IsUnlockAllowed, bool()); MOCK_METHOD1(SetRemoteDeviceLifeCycle, void(RemoteDeviceLifeCycle*)); MOCK_METHOD1(OnAuthAttempted, void(mojom::AuthType)); MOCK_METHOD0(CancelConnectionAttempt, void()); MOCK_METHOD0(GetLastRemoteStatusUnlockForLogging, std::string()); - - private: - DISALLOW_COPY_AND_ASSIGN(MockUnlockManager); }; // Mock implementation of ProximityAuthProfilePrefManager. @@ -84,11 +85,13 @@ class MockProximityAuthPrefManager : public ProximityAuthProfilePrefManager { fake_multidevice_setup_client) : ProximityAuthProfilePrefManager(nullptr, fake_multidevice_setup_client) {} + + MockProximityAuthPrefManager(const MockProximityAuthPrefManager&) = delete; + MockProximityAuthPrefManager& operator=(const MockProximityAuthPrefManager&) = + delete; + ~MockProximityAuthPrefManager() override {} MOCK_CONST_METHOD0(GetLastPasswordEntryTimestampMs, int64_t()); - - private: - DISALLOW_COPY_AND_ASSIGN(MockProximityAuthPrefManager); }; // Harness for ProximityAuthSystem to make it testable. @@ -100,6 +103,11 @@ class TestableProximityAuthSystem : public ProximityAuthSystem { ProximityAuthPrefManager* pref_manager) : ProximityAuthSystem(secure_channel_client, std::move(unlock_manager)), life_cycle_(nullptr) {} + + TestableProximityAuthSystem(const TestableProximityAuthSystem&) = delete; + TestableProximityAuthSystem& operator=(const TestableProximityAuthSystem&) = + delete; + ~TestableProximityAuthSystem() override {} FakeRemoteDeviceLifeCycle* life_cycle() { return life_cycle_; } @@ -116,8 +124,6 @@ class TestableProximityAuthSystem : public ProximityAuthSystem { } FakeRemoteDeviceLifeCycle* life_cycle_; - - DISALLOW_COPY_AND_ASSIGN(TestableProximityAuthSystem); }; } // namespace diff --git a/chromeos/components/proximity_auth/proximity_monitor_impl.h b/chromeos/components/proximity_auth/proximity_monitor_impl.h index f1dd5affcc91ef..744c56bd48fd7a 100644 --- a/chromeos/components/proximity_auth/proximity_monitor_impl.h +++ b/chromeos/components/proximity_auth/proximity_monitor_impl.h @@ -33,6 +33,10 @@ class ProximityMonitorImpl : public ProximityMonitor { // The |connection| is not owned, and must outlive |this| instance. ProximityMonitorImpl(chromeos::multidevice::RemoteDeviceRef remote_device, chromeos::secure_channel::ClientChannel* channel); + + ProximityMonitorImpl(const ProximityMonitorImpl&) = delete; + ProximityMonitorImpl& operator=(const ProximityMonitorImpl&) = delete; + ~ProximityMonitorImpl() override; // ProximityMonitor: @@ -110,8 +114,6 @@ class ProximityMonitorImpl : public ProximityMonitor { // Used to vend all other weak pointers. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ProximityMonitorImpl); }; } // namespace proximity_auth diff --git a/chromeos/components/proximity_auth/proximity_monitor_impl_unittest.cc b/chromeos/components/proximity_auth/proximity_monitor_impl_unittest.cc index 7199e2175ba808..a605789c4a6287 100644 --- a/chromeos/components/proximity_auth/proximity_monitor_impl_unittest.cc +++ b/chromeos/components/proximity_auth/proximity_monitor_impl_unittest.cc @@ -45,12 +45,14 @@ const int kRssiThreshold = -70; class MockProximityMonitorObserver : public ProximityMonitorObserver { public: MockProximityMonitorObserver() {} + + MockProximityMonitorObserver(const MockProximityMonitorObserver&) = delete; + MockProximityMonitorObserver& operator=(const MockProximityMonitorObserver&) = + delete; + ~MockProximityMonitorObserver() override {} MOCK_METHOD0(OnProximityStateChanged, void()); - - private: - DISALLOW_COPY_AND_ASSIGN(MockProximityMonitorObserver); }; // Creates a mock Bluetooth adapter and sets it as the global adapter for diff --git a/chromeos/components/proximity_auth/remote_device_life_cycle_impl.h b/chromeos/components/proximity_auth/remote_device_life_cycle_impl.h index a06138b30b80d2..8351274420eb49 100644 --- a/chromeos/components/proximity_auth/remote_device_life_cycle_impl.h +++ b/chromeos/components/proximity_auth/remote_device_life_cycle_impl.h @@ -41,6 +41,11 @@ class RemoteDeviceLifeCycleImpl chromeos::multidevice::RemoteDeviceRef remote_device, absl::optional local_device, chromeos::secure_channel::SecureChannelClient* secure_channel_client); + + RemoteDeviceLifeCycleImpl(const RemoteDeviceLifeCycleImpl&) = delete; + RemoteDeviceLifeCycleImpl& operator=(const RemoteDeviceLifeCycleImpl&) = + delete; + ~RemoteDeviceLifeCycleImpl() override; // RemoteDeviceLifeCycle: @@ -105,8 +110,6 @@ class RemoteDeviceLifeCycleImpl base::OneShotTimer authentication_recovery_timer_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(RemoteDeviceLifeCycleImpl); }; } // namespace proximity_auth diff --git a/chromeos/components/proximity_auth/remote_device_life_cycle_impl_unittest.cc b/chromeos/components/proximity_auth/remote_device_life_cycle_impl_unittest.cc index 35daa3c1874cbc..30d30bd168f274 100644 --- a/chromeos/components/proximity_auth/remote_device_life_cycle_impl_unittest.cc +++ b/chromeos/components/proximity_auth/remote_device_life_cycle_impl_unittest.cc @@ -45,12 +45,15 @@ class TestableRemoteDeviceLifeCycleImpl : public RemoteDeviceLifeCycleImpl { secure_channel_client), remote_device_(remote_device) {} + TestableRemoteDeviceLifeCycleImpl(const TestableRemoteDeviceLifeCycleImpl&) = + delete; + TestableRemoteDeviceLifeCycleImpl& operator=( + const TestableRemoteDeviceLifeCycleImpl&) = delete; + ~TestableRemoteDeviceLifeCycleImpl() override {} private: const chromeos::multidevice::RemoteDeviceRef remote_device_; - - DISALLOW_COPY_AND_ASSIGN(TestableRemoteDeviceLifeCycleImpl); }; } // namespace diff --git a/chromeos/components/proximity_auth/unlock_manager_impl.h b/chromeos/components/proximity_auth/unlock_manager_impl.h index 7425c29c87c6ae..6a15c6b123dd1f 100644 --- a/chromeos/components/proximity_auth/unlock_manager_impl.h +++ b/chromeos/components/proximity_auth/unlock_manager_impl.h @@ -46,6 +46,10 @@ class UnlockManagerImpl : public UnlockManager, // unlock manager. UnlockManagerImpl(ProximityAuthSystem::ScreenlockType screenlock_type, ProximityAuthClient* proximity_auth_client); + + UnlockManagerImpl(const UnlockManagerImpl&) = delete; + UnlockManagerImpl& operator=(const UnlockManagerImpl&) = delete; + ~UnlockManagerImpl() override; // UnlockManager: @@ -315,8 +319,6 @@ class UnlockManagerImpl : public UnlockManager, // Used to vend all other weak pointers. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(UnlockManagerImpl); }; } // namespace proximity_auth diff --git a/chromeos/components/proximity_auth/unlock_manager_impl_unittest.cc b/chromeos/components/proximity_auth/unlock_manager_impl_unittest.cc index f03926588566d0..1b70b76cff9eed 100644 --- a/chromeos/components/proximity_auth/unlock_manager_impl_unittest.cc +++ b/chromeos/components/proximity_auth/unlock_manager_impl_unittest.cc @@ -63,6 +63,10 @@ RemoteStatusUpdate kRemoteScreenlockStateUnknown = { class MockMessenger : public Messenger { public: MockMessenger() {} + + MockMessenger(const MockMessenger&) = delete; + MockMessenger& operator=(const MockMessenger&) = delete; + ~MockMessenger() override {} MOCK_METHOD1(AddObserver, void(MessengerObserver* observer)); @@ -72,9 +76,6 @@ class MockMessenger : public Messenger { MOCK_METHOD0(RequestUnlock, void()); MOCK_CONST_METHOD0(GetConnection, chromeos::secure_channel::Connection*()); MOCK_CONST_METHOD0(GetChannel, chromeos::secure_channel::ClientChannel*()); - - private: - DISALLOW_COPY_AND_ASSIGN(MockMessenger); }; class MockProximityMonitor : public ProximityMonitor { @@ -83,6 +84,10 @@ class MockProximityMonitor : public ProximityMonitor { : destroy_callback_(std::move(destroy_callback)), started_(false) { ON_CALL(*this, IsUnlockAllowed()).WillByDefault(Return(true)); } + + MockProximityMonitor(const MockProximityMonitor&) = delete; + MockProximityMonitor& operator=(const MockProximityMonitor&) = delete; + ~MockProximityMonitor() override { std::move(destroy_callback_).Run(); } void Start() override { started_ = true; } @@ -95,8 +100,6 @@ class MockProximityMonitor : public ProximityMonitor { private: base::OnceClosure destroy_callback_; bool started_; - - DISALLOW_COPY_AND_ASSIGN(MockProximityMonitor); }; class TestUnlockManager : public UnlockManagerImpl { @@ -104,6 +107,10 @@ class TestUnlockManager : public UnlockManagerImpl { TestUnlockManager(ProximityAuthSystem::ScreenlockType screenlock_type, ProximityAuthClient* proximity_auth_client) : UnlockManagerImpl(screenlock_type, proximity_auth_client) {} + + TestUnlockManager(const TestUnlockManager&) = delete; + TestUnlockManager& operator=(const TestUnlockManager&) = delete; + ~TestUnlockManager() override {} using MessengerObserver::OnDecryptResponse; @@ -134,8 +141,6 @@ class TestUnlockManager : public UnlockManagerImpl { // Owned by the super class. MockProximityMonitor* proximity_monitor_ = nullptr; bool proximity_monitor_destroyed_ = false; - - DISALLOW_COPY_AND_ASSIGN(TestUnlockManager); }; // Creates a mock Bluetooth adapter and sets it as the global adapter for diff --git a/chromeos/components/string_matching/fuzzy_tokenized_string_match.h b/chromeos/components/string_matching/fuzzy_tokenized_string_match.h index 52d5bbdc4701cc..8a37257a1b8590 100644 --- a/chromeos/components/string_matching/fuzzy_tokenized_string_match.h +++ b/chromeos/components/string_matching/fuzzy_tokenized_string_match.h @@ -26,6 +26,11 @@ class FuzzyTokenizedStringMatch { typedef std::vector Hits; FuzzyTokenizedStringMatch(); + + FuzzyTokenizedStringMatch(const FuzzyTokenizedStringMatch&) = delete; + FuzzyTokenizedStringMatch& operator=(const FuzzyTokenizedStringMatch&) = + delete; + ~FuzzyTokenizedStringMatch(); // TokenSetRatio takes two sets of tokens, finds their intersection and @@ -92,8 +97,6 @@ class FuzzyTokenizedStringMatch { // Score in range of [0,1] representing how well the query matches the text. double relevance_ = 0; Hits hits_; - - DISALLOW_COPY_AND_ASSIGN(FuzzyTokenizedStringMatch); }; } // namespace string_matching diff --git a/chromeos/components/string_matching/sequence_matcher.h b/chromeos/components/string_matching/sequence_matcher.h index 91b7fe9b40ff07..07d8fe205f1f54 100644 --- a/chromeos/components/string_matching/sequence_matcher.h +++ b/chromeos/components/string_matching/sequence_matcher.h @@ -42,6 +42,9 @@ class SequenceMatcher { bool use_edit_distance, double num_matching_blocks_penalty); + SequenceMatcher(const SequenceMatcher&) = delete; + SequenceMatcher& operator=(const SequenceMatcher&) = delete; + ~SequenceMatcher() = default; // Calculates similarity ratio of |first_string_| and |second_string_|. @@ -81,7 +84,6 @@ class SequenceMatcher { std::unordered_map> char_to_positions_; // Memory for dynamic programming algorithm used in FindLongestMatch(). std::vector dp_common_string_; - DISALLOW_COPY_AND_ASSIGN(SequenceMatcher); }; } // namespace string_matching diff --git a/chromeos/components/string_matching/term_break_iterator.h b/chromeos/components/string_matching/term_break_iterator.h index ba5a9d3d87aef6..c2a43cf68bc892 100644 --- a/chromeos/components/string_matching/term_break_iterator.h +++ b/chromeos/components/string_matching/term_break_iterator.h @@ -31,6 +31,10 @@ class TermBreakIterator { public: // Note that |word| must out live this iterator. explicit TermBreakIterator(const std::u16string& word); + + TermBreakIterator(const TermBreakIterator&) = delete; + TermBreakIterator& operator=(const TermBreakIterator&) = delete; + ~TermBreakIterator(); // Advance to the next term. Returns false if at the end of the word. @@ -64,8 +68,6 @@ class TermBreakIterator { std::unique_ptr iter_; State state_; - - DISALLOW_COPY_AND_ASSIGN(TermBreakIterator); }; } // namespace string_matching diff --git a/chromeos/components/string_matching/tokenized_string.h b/chromeos/components/string_matching/tokenized_string.h index 79a8bfc81392bd..a3c1c03ca3bc94 100644 --- a/chromeos/components/string_matching/tokenized_string.h +++ b/chromeos/components/string_matching/tokenized_string.h @@ -29,6 +29,10 @@ class TokenizedString { explicit TokenizedString(const std::u16string& text, Mode mode = Mode::kCamelCase); + + TokenizedString(const TokenizedString&) = delete; + TokenizedString& operator=(const TokenizedString&) = delete; + ~TokenizedString(); const std::u16string& text() const { return text_; } @@ -45,8 +49,6 @@ class TokenizedString { // Broken down tokens and the index mapping of tokens in original string. Tokens tokens_; Mappings mappings_; - - DISALLOW_COPY_AND_ASSIGN(TokenizedString); }; } // namespace string_matching diff --git a/chromeos/components/string_matching/tokenized_string_char_iterator.h b/chromeos/components/string_matching/tokenized_string_char_iterator.h index dc9abfa8535510..8dcda8a3b9dc2c 100644 --- a/chromeos/components/string_matching/tokenized_string_char_iterator.h +++ b/chromeos/components/string_matching/tokenized_string_char_iterator.h @@ -35,6 +35,11 @@ class TokenizedStringCharIterator { // Requires |tokenized| out-lives this iterator. explicit TokenizedStringCharIterator(const TokenizedString& tokenized); + + TokenizedStringCharIterator(const TokenizedStringCharIterator&) = delete; + TokenizedStringCharIterator& operator=(const TokenizedStringCharIterator&) = + delete; + ~TokenizedStringCharIterator(); // Advances to the next char. Returns false if there is no next char. @@ -72,8 +77,6 @@ class TokenizedStringCharIterator { size_t current_token_; std::unique_ptr current_token_iter_; - - DISALLOW_COPY_AND_ASSIGN(TokenizedStringCharIterator); }; } // namespace string_matching diff --git a/chromeos/components/string_matching/tokenized_string_match.h b/chromeos/components/string_matching/tokenized_string_match.h index e4453ef6994738..52b7fdd8398a2d 100644 --- a/chromeos/components/string_matching/tokenized_string_match.h +++ b/chromeos/components/string_matching/tokenized_string_match.h @@ -27,6 +27,10 @@ class TokenizedStringMatch { typedef std::vector Hits; TokenizedStringMatch(); + + TokenizedStringMatch(const TokenizedStringMatch&) = delete; + TokenizedStringMatch& operator=(const TokenizedStringMatch&) = delete; + ~TokenizedStringMatch(); // Calculates the relevance and hits. Returns true if the two strings are @@ -45,8 +49,6 @@ class TokenizedStringMatch { // Char index ranges in |text| of where matches are found. Hits hits_; - - DISALLOW_COPY_AND_ASSIGN(TokenizedStringMatch); }; } // namespace string_matching diff --git a/chromeos/components/sync_wifi/fake_local_network_collector.h b/chromeos/components/sync_wifi/fake_local_network_collector.h index 6b13e1fec1114d..e6c8092e1f2d4f 100644 --- a/chromeos/components/sync_wifi/fake_local_network_collector.h +++ b/chromeos/components/sync_wifi/fake_local_network_collector.h @@ -19,6 +19,11 @@ namespace sync_wifi { class FakeLocalNetworkCollector : public LocalNetworkCollector { public: FakeLocalNetworkCollector(); + + FakeLocalNetworkCollector(const FakeLocalNetworkCollector&) = delete; + FakeLocalNetworkCollector& operator=(const FakeLocalNetworkCollector&) = + delete; + ~FakeLocalNetworkCollector() override; // sync_wifi::LocalNetworkCollector:: @@ -44,8 +49,6 @@ class FakeLocalNetworkCollector : public LocalNetworkCollector { private: std::vector networks_; bool has_fixed_autoconnect_ = false; - - DISALLOW_COPY_AND_ASSIGN(FakeLocalNetworkCollector); }; } // namespace sync_wifi diff --git a/chromeos/components/sync_wifi/fake_one_shot_timer.h b/chromeos/components/sync_wifi/fake_one_shot_timer.h index 0b94f188ff9595..9cdb5006086d9e 100644 --- a/chromeos/components/sync_wifi/fake_one_shot_timer.h +++ b/chromeos/components/sync_wifi/fake_one_shot_timer.h @@ -21,6 +21,10 @@ class FakeOneShotTimer : public base::MockOneShotTimer { public: FakeOneShotTimer(base::OnceCallback destructor_callback); + + FakeOneShotTimer(const FakeOneShotTimer&) = delete; + FakeOneShotTimer& operator=(const FakeOneShotTimer&) = delete; + ~FakeOneShotTimer() override; const base::UnguessableToken& id() const { return id_; } @@ -28,8 +32,6 @@ class FakeOneShotTimer : public base::MockOneShotTimer { private: base::OnceCallback destructor_callback_; base::UnguessableToken id_; - - DISALLOW_COPY_AND_ASSIGN(FakeOneShotTimer); }; } // namespace sync_wifi diff --git a/chromeos/components/sync_wifi/fake_pending_network_configuration_tracker.h b/chromeos/components/sync_wifi/fake_pending_network_configuration_tracker.h index d6bdffff59de27..0c0d30e2693924 100644 --- a/chromeos/components/sync_wifi/fake_pending_network_configuration_tracker.h +++ b/chromeos/components/sync_wifi/fake_pending_network_configuration_tracker.h @@ -19,6 +19,12 @@ class FakePendingNetworkConfigurationTracker : public PendingNetworkConfigurationTracker { public: FakePendingNetworkConfigurationTracker(); + + FakePendingNetworkConfigurationTracker( + const FakePendingNetworkConfigurationTracker&) = delete; + FakePendingNetworkConfigurationTracker& operator=( + const FakePendingNetworkConfigurationTracker&) = delete; + ~FakePendingNetworkConfigurationTracker() override; // sync_wifi::PendingNetworkConfigurationtracker:: @@ -51,8 +57,6 @@ class FakePendingNetworkConfigurationTracker // This map is not cleared when MarkComplete is called to allow tests to // verify that the expected number of retries were performed before removal. std::map id_to_completed_attempts_map_; - - DISALLOW_COPY_AND_ASSIGN(FakePendingNetworkConfigurationTracker); }; } // namespace sync_wifi diff --git a/chromeos/components/sync_wifi/fake_timer_factory.h b/chromeos/components/sync_wifi/fake_timer_factory.h index 0fcce0ec3983e3..c5881b54974f36 100644 --- a/chromeos/components/sync_wifi/fake_timer_factory.h +++ b/chromeos/components/sync_wifi/fake_timer_factory.h @@ -26,6 +26,10 @@ namespace sync_wifi { class FakeTimerFactory : public TimerFactory { public: FakeTimerFactory(); + + FakeTimerFactory(const FakeTimerFactory&) = delete; + FakeTimerFactory& operator=(const FakeTimerFactory&) = delete; + ~FakeTimerFactory() override; // TimerFactory: @@ -38,8 +42,6 @@ class FakeTimerFactory : public TimerFactory { base::flat_map id_to_timer_map_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FakeTimerFactory); }; } // namespace sync_wifi diff --git a/chromeos/components/sync_wifi/local_network_collector_impl_unittest.cc b/chromeos/components/sync_wifi/local_network_collector_impl_unittest.cc index bc70221aa74387..5656130eb7a384 100644 --- a/chromeos/components/sync_wifi/local_network_collector_impl_unittest.cc +++ b/chromeos/components/sync_wifi/local_network_collector_impl_unittest.cc @@ -57,6 +57,11 @@ class LocalNetworkCollectorImplTest : public testing::Test { ash::GetNetworkConfigService( remote_cros_network_config_.BindNewPipeAndPassReceiver()); } + + LocalNetworkCollectorImplTest(const LocalNetworkCollectorImplTest&) = delete; + LocalNetworkCollectorImplTest& operator=( + const LocalNetworkCollectorImplTest&) = delete; + ~LocalNetworkCollectorImplTest() override = default; void SetUp() override { @@ -137,8 +142,6 @@ class LocalNetworkCollectorImplTest : public testing::Test { remote_cros_network_config_; size_t on_get_all_syncable_networks_count_; - - DISALLOW_COPY_AND_ASSIGN(LocalNetworkCollectorImplTest); }; TEST_F(LocalNetworkCollectorImplTest, TestGetAllSyncableNetworks) { diff --git a/chromeos/components/sync_wifi/pending_network_configuration_tracker.h b/chromeos/components/sync_wifi/pending_network_configuration_tracker.h index fa989c30df10e2..9c5986e8eaabf4 100644 --- a/chromeos/components/sync_wifi/pending_network_configuration_tracker.h +++ b/chromeos/components/sync_wifi/pending_network_configuration_tracker.h @@ -23,6 +23,12 @@ class NetworkIdentifier; class PendingNetworkConfigurationTracker { public: PendingNetworkConfigurationTracker() = default; + + PendingNetworkConfigurationTracker( + const PendingNetworkConfigurationTracker&) = delete; + PendingNetworkConfigurationTracker& operator=( + const PendingNetworkConfigurationTracker&) = delete; + virtual ~PendingNetworkConfigurationTracker() = default; // Adds an update to the list of in flight changes. |change_uuid| is a @@ -50,9 +56,6 @@ class PendingNetworkConfigurationTracker { // that the |change_guid| and |ssid| exist in the tracker before calling. virtual void IncrementCompletedAttempts(const std::string& change_guid, const NetworkIdentifier& id) = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(PendingNetworkConfigurationTracker); }; } // namespace sync_wifi diff --git a/chromeos/components/sync_wifi/pending_network_configuration_tracker_impl.h b/chromeos/components/sync_wifi/pending_network_configuration_tracker_impl.h index c36ac8a0ad92b5..56a62e275ef947 100644 --- a/chromeos/components/sync_wifi/pending_network_configuration_tracker_impl.h +++ b/chromeos/components/sync_wifi/pending_network_configuration_tracker_impl.h @@ -22,6 +22,12 @@ class PendingNetworkConfigurationTrackerImpl : public PendingNetworkConfigurationTracker { public: explicit PendingNetworkConfigurationTrackerImpl(PrefService* pref_service); + + PendingNetworkConfigurationTrackerImpl( + const PendingNetworkConfigurationTrackerImpl&) = delete; + PendingNetworkConfigurationTrackerImpl& operator=( + const PendingNetworkConfigurationTrackerImpl&) = delete; + ~PendingNetworkConfigurationTrackerImpl() override; // Registers preferences used by this class in the provided |registry|. @@ -44,8 +50,6 @@ class PendingNetworkConfigurationTrackerImpl private: PrefService* pref_service_; base::Value dict_; - - DISALLOW_COPY_AND_ASSIGN(PendingNetworkConfigurationTrackerImpl); }; } // namespace sync_wifi diff --git a/chromeos/components/sync_wifi/synced_network_metrics_logger_unittest.cc b/chromeos/components/sync_wifi/synced_network_metrics_logger_unittest.cc index abf7d318b8684c..5429874735beec 100644 --- a/chromeos/components/sync_wifi/synced_network_metrics_logger_unittest.cc +++ b/chromeos/components/sync_wifi/synced_network_metrics_logger_unittest.cc @@ -30,6 +30,12 @@ class SyncedNetworkMetricsLoggerTest : public testing::Test { : task_environment_(base::test::TaskEnvironment::TimeSource::MOCK_TIME) { network_test_helper_ = std::make_unique(); } + + SyncedNetworkMetricsLoggerTest(const SyncedNetworkMetricsLoggerTest&) = + delete; + SyncedNetworkMetricsLoggerTest& operator=( + const SyncedNetworkMetricsLoggerTest&) = delete; + ~SyncedNetworkMetricsLoggerTest() override = default; void SetUp() override { @@ -106,8 +112,6 @@ class SyncedNetworkMetricsLoggerTest : public testing::Test { private: std::unique_ptr network_test_helper_; std::unique_ptr synced_network_metrics_logger_; - - DISALLOW_COPY_AND_ASSIGN(SyncedNetworkMetricsLoggerTest); }; TEST_F(SyncedNetworkMetricsLoggerTest, diff --git a/chromeos/components/sync_wifi/synced_network_updater.h b/chromeos/components/sync_wifi/synced_network_updater.h index 843ddeb10da4a1..6d67836b14e53b 100644 --- a/chromeos/components/sync_wifi/synced_network_updater.h +++ b/chromeos/components/sync_wifi/synced_network_updater.h @@ -22,6 +22,9 @@ class NetworkIdentifier; // Applies updates to synced networks to the local networking stack. class SyncedNetworkUpdater { public: + SyncedNetworkUpdater(const SyncedNetworkUpdater&) = delete; + SyncedNetworkUpdater& operator=(const SyncedNetworkUpdater&) = delete; + virtual ~SyncedNetworkUpdater() = default; virtual void AddOrUpdateNetwork( @@ -31,9 +34,6 @@ class SyncedNetworkUpdater { protected: SyncedNetworkUpdater() = default; - - private: - DISALLOW_COPY_AND_ASSIGN(SyncedNetworkUpdater); }; } // namespace sync_wifi diff --git a/chromeos/components/sync_wifi/synced_network_updater_impl_unittest.cc b/chromeos/components/sync_wifi/synced_network_updater_impl_unittest.cc index b8bcf3637696c7..470bb67e43b9ac 100644 --- a/chromeos/components/sync_wifi/synced_network_updater_impl_unittest.cc +++ b/chromeos/components/sync_wifi/synced_network_updater_impl_unittest.cc @@ -74,6 +74,10 @@ class SyncedNetworkUpdaterImplTest : public testing::Test { remote_cros_network_config_.BindNewPipeAndPassReceiver()); } + SyncedNetworkUpdaterImplTest(const SyncedNetworkUpdaterImplTest&) = delete; + SyncedNetworkUpdaterImplTest& operator=(const SyncedNetworkUpdaterImplTest&) = + delete; + ~SyncedNetworkUpdaterImplTest() override { local_test_helper_.reset(); } void SetUp() override { @@ -132,8 +136,6 @@ class SyncedNetworkUpdaterImplTest : public testing::Test { NetworkIdentifier fred_network_id_ = GeneratePskNetworkId(kFredSsid); NetworkIdentifier mango_network_id_ = GeneratePskNetworkId(kMangoSsid); - - DISALLOW_COPY_AND_ASSIGN(SyncedNetworkUpdaterImplTest); }; TEST_F(SyncedNetworkUpdaterImplTest, TestAdd_OneNetwork) { diff --git a/chromeos/components/sync_wifi/wifi_configuration_bridge.h b/chromeos/components/sync_wifi/wifi_configuration_bridge.h index a24c7ead72bf80..4fb4985e7a9b27 100644 --- a/chromeos/components/sync_wifi/wifi_configuration_bridge.h +++ b/chromeos/components/sync_wifi/wifi_configuration_bridge.h @@ -58,6 +58,10 @@ class WifiConfigurationBridge : public syncer::ModelTypeSyncBridge, PrefService* pref_service, std::unique_ptr change_processor, syncer::OnceModelTypeStoreFactory create_store_callback); + + WifiConfigurationBridge(const WifiConfigurationBridge&) = delete; + WifiConfigurationBridge& operator=(const WifiConfigurationBridge&) = delete; + ~WifiConfigurationBridge() override; static void RegisterPrefs(PrefRegistrySimple* registry); @@ -163,8 +167,6 @@ class WifiConfigurationBridge : public syncer::ModelTypeSyncBridge, base::WeakPtr network_metadata_store_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(WifiConfigurationBridge); }; } // namespace sync_wifi diff --git a/chromeos/components/sync_wifi/wifi_configuration_sync_service.h b/chromeos/components/sync_wifi/wifi_configuration_sync_service.h index 58743ac657522f..968b6baf6c719c 100644 --- a/chromeos/components/sync_wifi/wifi_configuration_sync_service.h +++ b/chromeos/components/sync_wifi/wifi_configuration_sync_service.h @@ -41,6 +41,11 @@ class WifiConfigurationSyncService : public KeyedService { version_info::Channel channel, PrefService* pref_service, syncer::OnceModelTypeStoreFactory create_store_callback); + + WifiConfigurationSyncService(const WifiConfigurationSyncService&) = delete; + WifiConfigurationSyncService& operator=(const WifiConfigurationSyncService&) = + delete; + ~WifiConfigurationSyncService() override; base::WeakPtr GetControllerDelegate(); @@ -55,8 +60,6 @@ class WifiConfigurationSyncService : public KeyedService { std::unique_ptr updater_; std::unique_ptr collector_; std::unique_ptr bridge_; - - DISALLOW_COPY_AND_ASSIGN(WifiConfigurationSyncService); }; } // namespace sync_wifi diff --git a/chromeos/components/tether/active_host.h b/chromeos/components/tether/active_host.h index 79d38c3e82bf4c..ba39575456108d 100644 --- a/chromeos/components/tether/active_host.h +++ b/chromeos/components/tether/active_host.h @@ -80,6 +80,10 @@ class ActiveHost { }; ActiveHost(TetherHostFetcher* tether_host_fetcher, PrefService* pref_service); + + ActiveHost(const ActiveHost&) = delete; + ActiveHost& operator=(const ActiveHost&) = delete; + virtual ~ActiveHost(); // Registers the prefs used by this class to the given |registry|. @@ -156,8 +160,6 @@ class ActiveHost { base::ObserverList::Unchecked observer_list_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ActiveHost); }; } // namespace tether diff --git a/chromeos/components/tether/active_host_network_state_updater.h b/chromeos/components/tether/active_host_network_state_updater.h index 87ae0b806beb4d..8ed85807383eb0 100644 --- a/chromeos/components/tether/active_host_network_state_updater.h +++ b/chromeos/components/tether/active_host_network_state_updater.h @@ -21,6 +21,11 @@ class ActiveHostNetworkStateUpdater final : public ActiveHost::Observer { public: ActiveHostNetworkStateUpdater(ActiveHost* active_host, NetworkStateHandler* network_state_handler); + + ActiveHostNetworkStateUpdater(const ActiveHostNetworkStateUpdater&) = delete; + ActiveHostNetworkStateUpdater& operator=( + const ActiveHostNetworkStateUpdater&) = delete; + ~ActiveHostNetworkStateUpdater(); // ActiveHost::Observer: @@ -30,8 +35,6 @@ class ActiveHostNetworkStateUpdater final : public ActiveHost::Observer { private: ActiveHost* active_host_; NetworkStateHandler* network_state_handler_; - - DISALLOW_COPY_AND_ASSIGN(ActiveHostNetworkStateUpdater); }; } // namespace tether diff --git a/chromeos/components/tether/asynchronous_shutdown_object_container.h b/chromeos/components/tether/asynchronous_shutdown_object_container.h index d3e9a3e5e340e6..77a2800e7e36fc 100644 --- a/chromeos/components/tether/asynchronous_shutdown_object_container.h +++ b/chromeos/components/tether/asynchronous_shutdown_object_container.h @@ -23,6 +23,12 @@ class WifiHotspotDisconnector; class AsynchronousShutdownObjectContainer { public: AsynchronousShutdownObjectContainer() {} + + AsynchronousShutdownObjectContainer( + const AsynchronousShutdownObjectContainer&) = delete; + AsynchronousShutdownObjectContainer& operator=( + const AsynchronousShutdownObjectContainer&) = delete; + virtual ~AsynchronousShutdownObjectContainer() {} // Shuts down the objects contained by this class and invokes @@ -35,9 +41,6 @@ class AsynchronousShutdownObjectContainer { disconnect_tethering_request_sender() = 0; virtual NetworkConfigurationRemover* network_configuration_remover() = 0; virtual WifiHotspotDisconnector* wifi_hotspot_disconnector() = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(AsynchronousShutdownObjectContainer); }; } // namespace tether diff --git a/chromeos/components/tether/connect_tethering_operation.h b/chromeos/components/tether/connect_tethering_operation.h index 9ac6c5f55b67b2..c8c30e8994b6d2 100644 --- a/chromeos/components/tether/connect_tethering_operation.h +++ b/chromeos/components/tether/connect_tethering_operation.h @@ -92,6 +92,10 @@ class ConnectTetheringOperation : public MessageTransferOperation { HostResponseErrorCode error_code) = 0; }; + ConnectTetheringOperation(const ConnectTetheringOperation&) = delete; + ConnectTetheringOperation& operator=(const ConnectTetheringOperation&) = + delete; + ~ConnectTetheringOperation() override; void AddObserver(Observer* observer); @@ -159,8 +163,6 @@ class ConnectTetheringOperation : public MessageTransferOperation { base::Time connect_tethering_request_start_time_; base::ObserverList::Unchecked observer_list_; - - DISALLOW_COPY_AND_ASSIGN(ConnectTetheringOperation); }; } // namespace tether diff --git a/chromeos/components/tether/connect_tethering_operation_unittest.cc b/chromeos/components/tether/connect_tethering_operation_unittest.cc index 35a0c263d12bf4..62836e6fa29350 100644 --- a/chromeos/components/tether/connect_tethering_operation_unittest.cc +++ b/chromeos/components/tether/connect_tethering_operation_unittest.cc @@ -44,6 +44,10 @@ constexpr base::TimeDelta kConnectTetheringResponseTimeSeconds = class MockOperationObserver : public ConnectTetheringOperation::Observer { public: MockOperationObserver() = default; + + MockOperationObserver(const MockOperationObserver&) = delete; + MockOperationObserver& operator=(const MockOperationObserver&) = delete; + ~MockOperationObserver() = default; MOCK_METHOD1(OnConnectTetheringRequestSent, @@ -55,9 +59,6 @@ class MockOperationObserver : public ConnectTetheringOperation::Observer { MOCK_METHOD2(OnConnectTetheringFailure, void(multidevice::RemoteDeviceRef, ConnectTetheringOperation::HostResponseErrorCode)); - - private: - DISALLOW_COPY_AND_ASSIGN(MockOperationObserver); }; } // namespace diff --git a/chromeos/components/tether/connection_preserver.h b/chromeos/components/tether/connection_preserver.h index c5d2c9ff34fbbd..40e623e56782c2 100644 --- a/chromeos/components/tether/connection_preserver.h +++ b/chromeos/components/tether/connection_preserver.h @@ -20,15 +20,16 @@ namespace tether { class ConnectionPreserver { public: ConnectionPreserver(); + + ConnectionPreserver(const ConnectionPreserver&) = delete; + ConnectionPreserver& operator=(const ConnectionPreserver&) = delete; + virtual ~ConnectionPreserver(); // Should be called after each successful host scan result, to request that // the Connection with that device be preserved. virtual void HandleSuccessfulTetherAvailabilityResponse( const std::string& device_id) = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(ConnectionPreserver); }; } // namespace tether diff --git a/chromeos/components/tether/connection_preserver_impl.h b/chromeos/components/tether/connection_preserver_impl.h index fec74705244a26..5abe35ac53c353 100644 --- a/chromeos/components/tether/connection_preserver_impl.h +++ b/chromeos/components/tether/connection_preserver_impl.h @@ -46,6 +46,10 @@ class ConnectionPreserverImpl NetworkStateHandler* network_state_handler, ActiveHost* active_host, TetherHostResponseRecorder* tether_host_response_recorder); + + ConnectionPreserverImpl(const ConnectionPreserverImpl&) = delete; + ConnectionPreserverImpl& operator=(const ConnectionPreserverImpl&) = delete; + ~ConnectionPreserverImpl() override; // ConnectionPreserver: @@ -96,8 +100,6 @@ class ConnectionPreserverImpl std::unique_ptr client_channel_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ConnectionPreserverImpl); }; } // namespace tether diff --git a/chromeos/components/tether/crash_recovery_manager.h b/chromeos/components/tether/crash_recovery_manager.h index c7df7cd7f19183..cf31a7db81e956 100644 --- a/chromeos/components/tether/crash_recovery_manager.h +++ b/chromeos/components/tether/crash_recovery_manager.h @@ -16,6 +16,10 @@ namespace tether { class CrashRecoveryManager { public: CrashRecoveryManager() {} + + CrashRecoveryManager(const CrashRecoveryManager&) = delete; + CrashRecoveryManager& operator=(const CrashRecoveryManager&) = delete; + virtual ~CrashRecoveryManager() {} // Restores state which was lost by a browser crash. If a crash did not occur @@ -27,9 +31,6 @@ class CrashRecoveryManager { // TetherComponent. virtual void RestorePreCrashStateIfNecessary( base::OnceClosure on_restoration_finished) = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(CrashRecoveryManager); }; } // namespace tether diff --git a/chromeos/components/tether/device_id_tether_network_guid_map.h b/chromeos/components/tether/device_id_tether_network_guid_map.h index 2d78ca24ffc748..5803aa9983a74d 100644 --- a/chromeos/components/tether/device_id_tether_network_guid_map.h +++ b/chromeos/components/tether/device_id_tether_network_guid_map.h @@ -21,6 +21,11 @@ namespace tether { class DeviceIdTetherNetworkGuidMap { public: DeviceIdTetherNetworkGuidMap(); + + DeviceIdTetherNetworkGuidMap(const DeviceIdTetherNetworkGuidMap&) = delete; + DeviceIdTetherNetworkGuidMap& operator=(const DeviceIdTetherNetworkGuidMap&) = + delete; + virtual ~DeviceIdTetherNetworkGuidMap(); // Returns the device ID for a given tether network GUID. @@ -30,9 +35,6 @@ class DeviceIdTetherNetworkGuidMap { // Returns the tether network GUID for a given device ID. virtual std::string GetTetherNetworkGuidForDeviceId( const std::string& device_id); - - private: - DISALLOW_COPY_AND_ASSIGN(DeviceIdTetherNetworkGuidMap); }; } // namespace tether diff --git a/chromeos/components/tether/disconnect_tethering_operation.h b/chromeos/components/tether/disconnect_tethering_operation.h index 39570a26957c15..57f7556f960955 100644 --- a/chromeos/components/tether/disconnect_tethering_operation.h +++ b/chromeos/components/tether/disconnect_tethering_operation.h @@ -54,6 +54,10 @@ class DisconnectTetheringOperation : public MessageTransferOperation { bool success) = 0; }; + DisconnectTetheringOperation(const DisconnectTetheringOperation&) = delete; + DisconnectTetheringOperation& operator=(const DisconnectTetheringOperation&) = + delete; + ~DisconnectTetheringOperation() override; void AddObserver(Observer* observer); @@ -90,8 +94,6 @@ class DisconnectTetheringOperation : public MessageTransferOperation { base::Clock* clock_; base::Time disconnect_start_time_; - - DISALLOW_COPY_AND_ASSIGN(DisconnectTetheringOperation); }; } // namespace tether diff --git a/chromeos/components/tether/disconnect_tethering_operation_unittest.cc b/chromeos/components/tether/disconnect_tethering_operation_unittest.cc index c3aedf6b2e5efe..80debc15c40f13 100644 --- a/chromeos/components/tether/disconnect_tethering_operation_unittest.cc +++ b/chromeos/components/tether/disconnect_tethering_operation_unittest.cc @@ -38,12 +38,13 @@ constexpr base::TimeDelta kDisconnectTetheringRequestTime = class MockOperationObserver : public DisconnectTetheringOperation::Observer { public: MockOperationObserver() = default; + + MockOperationObserver(const MockOperationObserver&) = delete; + MockOperationObserver& operator=(const MockOperationObserver&) = delete; + ~MockOperationObserver() = default; MOCK_METHOD2(OnOperationFinished, void(const std::string&, bool)); - - private: - DISALLOW_COPY_AND_ASSIGN(MockOperationObserver); }; } // namespace diff --git a/chromeos/components/tether/disconnect_tethering_request_sender.h b/chromeos/components/tether/disconnect_tethering_request_sender.h index 1b7af13e902068..576e6145771fef 100644 --- a/chromeos/components/tether/disconnect_tethering_request_sender.h +++ b/chromeos/components/tether/disconnect_tethering_request_sender.h @@ -25,6 +25,12 @@ class DisconnectTetheringRequestSender { }; DisconnectTetheringRequestSender(); + + DisconnectTetheringRequestSender(const DisconnectTetheringRequestSender&) = + delete; + DisconnectTetheringRequestSender& operator=( + const DisconnectTetheringRequestSender&) = delete; + virtual ~DisconnectTetheringRequestSender(); // Sends a DisconnectTetheringRequest to the device with the given ID. @@ -42,8 +48,6 @@ class DisconnectTetheringRequestSender { private: base::ObserverList::Unchecked observer_list_; - - DISALLOW_COPY_AND_ASSIGN(DisconnectTetheringRequestSender); }; } // namespace tether diff --git a/chromeos/components/tether/disconnect_tethering_request_sender_impl_unittest.cc b/chromeos/components/tether/disconnect_tethering_request_sender_impl_unittest.cc index b5451daea45b31..efff6b5a6a4ca5 100644 --- a/chromeos/components/tether/disconnect_tethering_request_sender_impl_unittest.cc +++ b/chromeos/components/tether/disconnect_tethering_request_sender_impl_unittest.cc @@ -98,6 +98,12 @@ class DisconnectTetheringRequestSenderTest : public testing::Test { public: DisconnectTetheringRequestSenderTest() : test_devices_(multidevice::CreateRemoteDeviceRefListForTest(2u)) {} + + DisconnectTetheringRequestSenderTest( + const DisconnectTetheringRequestSenderTest&) = delete; + DisconnectTetheringRequestSenderTest& operator=( + const DisconnectTetheringRequestSenderTest&) = delete; + ~DisconnectTetheringRequestSenderTest() override = default; void SetUp() override { @@ -196,9 +202,6 @@ class DisconnectTetheringRequestSenderTest : public testing::Test { disconnect_tethering_request_sender_; std::unique_ptr fake_disconnect_tethering_request_sender_observer_; - - private: - DISALLOW_COPY_AND_ASSIGN(DisconnectTetheringRequestSenderTest); }; TEST_F(DisconnectTetheringRequestSenderTest, DISABLED_SendRequest_Success) { diff --git a/chromeos/components/tether/fake_active_host.h b/chromeos/components/tether/fake_active_host.h index d4111169b3f8ec..28132488f7744e 100644 --- a/chromeos/components/tether/fake_active_host.h +++ b/chromeos/components/tether/fake_active_host.h @@ -20,6 +20,10 @@ namespace tether { class FakeActiveHost : public ActiveHost { public: FakeActiveHost(); + + FakeActiveHost(const FakeActiveHost&) = delete; + FakeActiveHost& operator=(const FakeActiveHost&) = delete; + ~FakeActiveHost() override; // ActiveHost: @@ -46,8 +50,6 @@ class FakeActiveHost : public ActiveHost { std::string active_host_device_id_; std::string tether_network_guid_; std::string wifi_network_guid_; - - DISALLOW_COPY_AND_ASSIGN(FakeActiveHost); }; } // namespace tether diff --git a/chromeos/components/tether/fake_asynchronous_shutdown_object_container.h b/chromeos/components/tether/fake_asynchronous_shutdown_object_container.h index 47f5da267519c8..0d7bb548f8e9fe 100644 --- a/chromeos/components/tether/fake_asynchronous_shutdown_object_container.h +++ b/chromeos/components/tether/fake_asynchronous_shutdown_object_container.h @@ -22,6 +22,12 @@ class FakeAsynchronousShutdownObjectContainer // |deletion_callback| will be invoked when the object is deleted. FakeAsynchronousShutdownObjectContainer( base::OnceClosure deletion_callback = base::DoNothing()); + + FakeAsynchronousShutdownObjectContainer( + const FakeAsynchronousShutdownObjectContainer&) = delete; + FakeAsynchronousShutdownObjectContainer& operator=( + const FakeAsynchronousShutdownObjectContainer&) = delete; + ~FakeAsynchronousShutdownObjectContainer() override; base::OnceClosure TakeShutdownCompleteCallback() { @@ -64,8 +70,6 @@ class FakeAsynchronousShutdownObjectContainer nullptr; NetworkConfigurationRemover* network_configuration_remover_ = nullptr; WifiHotspotDisconnector* wifi_hotspot_disconnector_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeAsynchronousShutdownObjectContainer); }; } // namespace tether diff --git a/chromeos/components/tether/fake_connection_preserver.h b/chromeos/components/tether/fake_connection_preserver.h index 95d175f0a9a807..20a8ecb3815d80 100644 --- a/chromeos/components/tether/fake_connection_preserver.h +++ b/chromeos/components/tether/fake_connection_preserver.h @@ -18,6 +18,10 @@ namespace tether { class FakeConnectionPreserver : public ConnectionPreserver { public: FakeConnectionPreserver(); + + FakeConnectionPreserver(const FakeConnectionPreserver&) = delete; + FakeConnectionPreserver& operator=(const FakeConnectionPreserver&) = delete; + ~FakeConnectionPreserver() override; void HandleSuccessfulTetherAvailabilityResponse( @@ -29,8 +33,6 @@ class FakeConnectionPreserver : public ConnectionPreserver { private: std::string last_requested_preserved_connection_device_id_; - - DISALLOW_COPY_AND_ASSIGN(FakeConnectionPreserver); }; } // namespace tether diff --git a/chromeos/components/tether/fake_crash_recovery_manager.h b/chromeos/components/tether/fake_crash_recovery_manager.h index 44846115beaacb..1fc559292fbe40 100644 --- a/chromeos/components/tether/fake_crash_recovery_manager.h +++ b/chromeos/components/tether/fake_crash_recovery_manager.h @@ -17,6 +17,10 @@ namespace tether { class FakeCrashRecoveryManager : public CrashRecoveryManager { public: FakeCrashRecoveryManager(); + + FakeCrashRecoveryManager(const FakeCrashRecoveryManager&) = delete; + FakeCrashRecoveryManager& operator=(const FakeCrashRecoveryManager&) = delete; + ~FakeCrashRecoveryManager() override; base::OnceClosure TakeOnRestorationFinishedCallback() { @@ -29,8 +33,6 @@ class FakeCrashRecoveryManager : public CrashRecoveryManager { private: base::OnceClosure on_restoration_finished_callback_; - - DISALLOW_COPY_AND_ASSIGN(FakeCrashRecoveryManager); }; } // namespace tether diff --git a/chromeos/components/tether/fake_disconnect_tethering_request_sender.h b/chromeos/components/tether/fake_disconnect_tethering_request_sender.h index e4b6d48c362e28..349ba1f49f2a7a 100644 --- a/chromeos/components/tether/fake_disconnect_tethering_request_sender.h +++ b/chromeos/components/tether/fake_disconnect_tethering_request_sender.h @@ -20,6 +20,12 @@ class FakeDisconnectTetheringRequestSender : public DisconnectTetheringRequestSender { public: FakeDisconnectTetheringRequestSender(); + + FakeDisconnectTetheringRequestSender( + const FakeDisconnectTetheringRequestSender&) = delete; + FakeDisconnectTetheringRequestSender& operator=( + const FakeDisconnectTetheringRequestSender&) = delete; + ~FakeDisconnectTetheringRequestSender() override; void NotifyPendingDisconnectRequestsComplete(); @@ -39,8 +45,6 @@ class FakeDisconnectTetheringRequestSender private: bool has_pending_requests_ = false; std::vector device_ids_sent_requests_; - - DISALLOW_COPY_AND_ASSIGN(FakeDisconnectTetheringRequestSender); }; } // namespace tether diff --git a/chromeos/components/tether/fake_gms_core_notifications_state_tracker.h b/chromeos/components/tether/fake_gms_core_notifications_state_tracker.h index f1dea7126946ba..39469dc3766f6a 100644 --- a/chromeos/components/tether/fake_gms_core_notifications_state_tracker.h +++ b/chromeos/components/tether/fake_gms_core_notifications_state_tracker.h @@ -20,6 +20,12 @@ class FakeGmsCoreNotificationsStateTracker : public GmsCoreNotificationsStateTracker { public: FakeGmsCoreNotificationsStateTracker(); + + FakeGmsCoreNotificationsStateTracker( + const FakeGmsCoreNotificationsStateTracker&) = delete; + FakeGmsCoreNotificationsStateTracker& operator=( + const FakeGmsCoreNotificationsStateTracker&) = delete; + ~FakeGmsCoreNotificationsStateTracker() override; void set_device_names(const std::vector& device_names) { @@ -34,8 +40,6 @@ class FakeGmsCoreNotificationsStateTracker private: std::vector device_names_; - - DISALLOW_COPY_AND_ASSIGN(FakeGmsCoreNotificationsStateTracker); }; } // namespace tether diff --git a/chromeos/components/tether/fake_host_scan_cache.h b/chromeos/components/tether/fake_host_scan_cache.h index 1ba3b6a35c9453..9a1b5b6fccd97c 100644 --- a/chromeos/components/tether/fake_host_scan_cache.h +++ b/chromeos/components/tether/fake_host_scan_cache.h @@ -20,6 +20,10 @@ namespace tether { class FakeHostScanCache : virtual public HostScanCache { public: FakeHostScanCache(); + + FakeHostScanCache(const FakeHostScanCache&) = delete; + FakeHostScanCache& operator=(const FakeHostScanCache&) = delete; + ~FakeHostScanCache() override; // Getters for contents of the cache. @@ -43,8 +47,6 @@ class FakeHostScanCache : virtual public HostScanCache { private: std::unordered_map cache_; - - DISALLOW_COPY_AND_ASSIGN(FakeHostScanCache); }; } // namespace tether diff --git a/chromeos/components/tether/fake_host_scan_scheduler.h b/chromeos/components/tether/fake_host_scan_scheduler.h index 4537509eacbf9c..bd4d4e4c94d3d0 100644 --- a/chromeos/components/tether/fake_host_scan_scheduler.h +++ b/chromeos/components/tether/fake_host_scan_scheduler.h @@ -16,6 +16,10 @@ namespace tether { class FakeHostScanScheduler : public HostScanScheduler { public: FakeHostScanScheduler(); + + FakeHostScanScheduler(const FakeHostScanScheduler&) = delete; + FakeHostScanScheduler& operator=(const FakeHostScanScheduler&) = delete; + ~FakeHostScanScheduler() override; int num_attempted_scans() { return num_attempted_scans_; } @@ -25,8 +29,6 @@ class FakeHostScanScheduler : public HostScanScheduler { private: int num_attempted_scans_ = 0; - - DISALLOW_COPY_AND_ASSIGN(FakeHostScanScheduler); }; } // namespace tether diff --git a/chromeos/components/tether/fake_host_scanner.h b/chromeos/components/tether/fake_host_scanner.h index 711df2501fa0a6..ffc8fb77382cd2 100644 --- a/chromeos/components/tether/fake_host_scanner.h +++ b/chromeos/components/tether/fake_host_scanner.h @@ -15,6 +15,10 @@ namespace tether { class FakeHostScanner : public HostScanner { public: FakeHostScanner(); + + FakeHostScanner(const FakeHostScanner&) = delete; + FakeHostScanner& operator=(const FakeHostScanner&) = delete; + ~FakeHostScanner() override; size_t num_scans_started() { return num_scans_started_; } @@ -29,8 +33,6 @@ class FakeHostScanner : public HostScanner { private: size_t num_scans_started_ = 0u; bool is_active_ = false; - - DISALLOW_COPY_AND_ASSIGN(FakeHostScanner); }; } // namespace tether diff --git a/chromeos/components/tether/fake_network_configuration_remover.h b/chromeos/components/tether/fake_network_configuration_remover.h index 2a2781b59db1f9..5282fa08935cd8 100644 --- a/chromeos/components/tether/fake_network_configuration_remover.h +++ b/chromeos/components/tether/fake_network_configuration_remover.h @@ -18,6 +18,12 @@ namespace tether { class FakeNetworkConfigurationRemover : public NetworkConfigurationRemover { public: FakeNetworkConfigurationRemover(); + + FakeNetworkConfigurationRemover(const FakeNetworkConfigurationRemover&) = + delete; + FakeNetworkConfigurationRemover& operator=( + const FakeNetworkConfigurationRemover&) = delete; + ~FakeNetworkConfigurationRemover() override; std::string last_removed_wifi_network_path() { @@ -30,8 +36,6 @@ class FakeNetworkConfigurationRemover : public NetworkConfigurationRemover { private: std::string last_removed_wifi_network_path_; - - DISALLOW_COPY_AND_ASSIGN(FakeNetworkConfigurationRemover); }; } // namespace tether diff --git a/chromeos/components/tether/fake_notification_presenter.h b/chromeos/components/tether/fake_notification_presenter.h index 0f54d4aed7f6bd..d0570d8297480b 100644 --- a/chromeos/components/tether/fake_notification_presenter.h +++ b/chromeos/components/tether/fake_notification_presenter.h @@ -19,6 +19,11 @@ namespace tether { class FakeNotificationPresenter : public NotificationPresenter { public: FakeNotificationPresenter(); + + FakeNotificationPresenter(const FakeNotificationPresenter&) = delete; + FakeNotificationPresenter& operator=(const FakeNotificationPresenter&) = + delete; + ~FakeNotificationPresenter() override; // Note: This function fails a test if potential_hotspot_state() is not @@ -52,8 +57,6 @@ class FakeNotificationPresenter : public NotificationPresenter { absl::optional potential_hotspot_remote_device_; bool is_setup_required_notification_shown_; bool is_connection_failed_notification_shown_; - - DISALLOW_COPY_AND_ASSIGN(FakeNotificationPresenter); }; } // namespace tether diff --git a/chromeos/components/tether/fake_synchronous_shutdown_object_container.h b/chromeos/components/tether/fake_synchronous_shutdown_object_container.h index afdfb395231f0f..07fd930e4a52de 100644 --- a/chromeos/components/tether/fake_synchronous_shutdown_object_container.h +++ b/chromeos/components/tether/fake_synchronous_shutdown_object_container.h @@ -22,6 +22,12 @@ class FakeSynchronousShutdownObjectContainer // |deletion_callback| will be invoked when the object is deleted. FakeSynchronousShutdownObjectContainer( base::OnceClosure deletion_callback = base::DoNothing()); + + FakeSynchronousShutdownObjectContainer( + const FakeSynchronousShutdownObjectContainer&) = delete; + FakeSynchronousShutdownObjectContainer& operator=( + const FakeSynchronousShutdownObjectContainer&) = delete; + ~FakeSynchronousShutdownObjectContainer() override; void set_active_host(ActiveHost* active_host) { active_host_ = active_host; } @@ -51,8 +57,6 @@ class FakeSynchronousShutdownObjectContainer HostScanCache* host_scan_cache_ = nullptr; HostScanScheduler* host_scan_scheduler_ = nullptr; TetherDisconnector* tether_disconnector_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeSynchronousShutdownObjectContainer); }; } // namespace tether diff --git a/chromeos/components/tether/fake_tether_component.h b/chromeos/components/tether/fake_tether_component.h index f7efa9fb650b13..9c171a9bb198ec 100644 --- a/chromeos/components/tether/fake_tether_component.h +++ b/chromeos/components/tether/fake_tether_component.h @@ -17,6 +17,10 @@ namespace tether { class FakeTetherComponent : public TetherComponent { public: explicit FakeTetherComponent(bool has_asynchronous_shutdown); + + FakeTetherComponent(const FakeTetherComponent&) = delete; + FakeTetherComponent& operator=(const FakeTetherComponent&) = delete; + ~FakeTetherComponent() override; void set_has_asynchronous_shutdown(bool has_asynchronous_shutdown) { @@ -34,8 +38,6 @@ class FakeTetherComponent : public TetherComponent { private: bool has_asynchronous_shutdown_; std::unique_ptr last_shutdown_reason_; - - DISALLOW_COPY_AND_ASSIGN(FakeTetherComponent); }; } // namespace tether diff --git a/chromeos/components/tether/fake_tether_connector.h b/chromeos/components/tether/fake_tether_connector.h index 935f905bc852d1..e1bf672b62ba32 100644 --- a/chromeos/components/tether/fake_tether_connector.h +++ b/chromeos/components/tether/fake_tether_connector.h @@ -18,6 +18,10 @@ namespace tether { class FakeTetherConnector : public TetherConnector { public: FakeTetherConnector(); + + FakeTetherConnector(const FakeTetherConnector&) = delete; + FakeTetherConnector& operator=(const FakeTetherConnector&) = delete; + ~FakeTetherConnector() override; std::string last_connected_tether_network_guid() { @@ -48,8 +52,6 @@ class FakeTetherConnector : public TetherConnector { std::string last_canceled_tether_network_guid_; bool should_cancel_successfully_; - - DISALLOW_COPY_AND_ASSIGN(FakeTetherConnector); }; } // namespace tether diff --git a/chromeos/components/tether/fake_tether_disconnector.h b/chromeos/components/tether/fake_tether_disconnector.h index d0752a4593bfac..78b2fd9737b68b 100644 --- a/chromeos/components/tether/fake_tether_disconnector.h +++ b/chromeos/components/tether/fake_tether_disconnector.h @@ -19,6 +19,10 @@ namespace tether { class FakeTetherDisconnector : public TetherDisconnector { public: FakeTetherDisconnector(); + + FakeTetherDisconnector(const FakeTetherDisconnector&) = delete; + FakeTetherDisconnector& operator=(const FakeTetherDisconnector&) = delete; + ~FakeTetherDisconnector() override; std::string last_disconnected_tether_network_guid() { @@ -48,8 +52,6 @@ class FakeTetherDisconnector : public TetherDisconnector { std::string disconnection_error_name_; std::unique_ptr last_session_completion_reason_; - - DISALLOW_COPY_AND_ASSIGN(FakeTetherDisconnector); }; } // namespace tether diff --git a/chromeos/components/tether/fake_tether_host_fetcher.h b/chromeos/components/tether/fake_tether_host_fetcher.h index 0894ed8e370f08..e5fb83e24afcb4 100644 --- a/chromeos/components/tether/fake_tether_host_fetcher.h +++ b/chromeos/components/tether/fake_tether_host_fetcher.h @@ -21,6 +21,10 @@ class FakeTetherHostFetcher : public TetherHostFetcher { explicit FakeTetherHostFetcher( const multidevice::RemoteDeviceRefList& tether_hosts); FakeTetherHostFetcher(); + + FakeTetherHostFetcher(const FakeTetherHostFetcher&) = delete; + FakeTetherHostFetcher& operator=(const FakeTetherHostFetcher&) = delete; + ~FakeTetherHostFetcher() override; void set_tether_hosts(const multidevice::RemoteDeviceRefList& tether_hosts) { @@ -38,8 +42,6 @@ class FakeTetherHostFetcher : public TetherHostFetcher { private: multidevice::RemoteDeviceRefList tether_hosts_; - - DISALLOW_COPY_AND_ASSIGN(FakeTetherHostFetcher); }; } // namespace tether diff --git a/chromeos/components/tether/fake_tether_session_completion_logger.h b/chromeos/components/tether/fake_tether_session_completion_logger.h index f70ef03d5e92bb..fa35c6c68ba185 100644 --- a/chromeos/components/tether/fake_tether_session_completion_logger.h +++ b/chromeos/components/tether/fake_tether_session_completion_logger.h @@ -18,6 +18,12 @@ namespace tether { class FakeTetherSessionCompletionLogger : public TetherSessionCompletionLogger { public: FakeTetherSessionCompletionLogger(); + + FakeTetherSessionCompletionLogger(const FakeTetherSessionCompletionLogger&) = + delete; + FakeTetherSessionCompletionLogger& operator=( + const FakeTetherSessionCompletionLogger&) = delete; + ~FakeTetherSessionCompletionLogger() override; TetherSessionCompletionLogger::SessionCompletionReason* @@ -32,8 +38,6 @@ class FakeTetherSessionCompletionLogger : public TetherSessionCompletionLogger { private: std::unique_ptr last_session_completion_reason_; - - DISALLOW_COPY_AND_ASSIGN(FakeTetherSessionCompletionLogger); }; } // namespace tether diff --git a/chromeos/components/tether/fake_wifi_hotspot_connector.h b/chromeos/components/tether/fake_wifi_hotspot_connector.h index dbcce10f0e4868..ff4f306238b323 100644 --- a/chromeos/components/tether/fake_wifi_hotspot_connector.h +++ b/chromeos/components/tether/fake_wifi_hotspot_connector.h @@ -18,6 +18,10 @@ namespace tether { class FakeWifiHotspotConnector : public WifiHotspotConnector { public: FakeWifiHotspotConnector(NetworkStateHandler* network_state_handler); + + FakeWifiHotspotConnector(const FakeWifiHotspotConnector&) = delete; + FakeWifiHotspotConnector& operator=(const FakeWifiHotspotConnector&) = delete; + ~FakeWifiHotspotConnector() override; // Pass an empty string for |wifi_guid| to signify a failed connection. @@ -43,8 +47,6 @@ class FakeWifiHotspotConnector : public WifiHotspotConnector { std::string most_recent_password_; std::string most_recent_tether_network_guid_; WifiHotspotConnector::WifiConnectionCallback most_recent_callback_; - - DISALLOW_COPY_AND_ASSIGN(FakeWifiHotspotConnector); }; } // namespace tether diff --git a/chromeos/components/tether/fake_wifi_hotspot_disconnector.h b/chromeos/components/tether/fake_wifi_hotspot_disconnector.h index 2d693ad1e47523..ff2c65fa9f42ed 100644 --- a/chromeos/components/tether/fake_wifi_hotspot_disconnector.h +++ b/chromeos/components/tether/fake_wifi_hotspot_disconnector.h @@ -17,6 +17,11 @@ namespace tether { class FakeWifiHotspotDisconnector : public WifiHotspotDisconnector { public: FakeWifiHotspotDisconnector(); + + FakeWifiHotspotDisconnector(const FakeWifiHotspotDisconnector&) = delete; + FakeWifiHotspotDisconnector& operator=(const FakeWifiHotspotDisconnector&) = + delete; + ~FakeWifiHotspotDisconnector() override; std::string last_disconnected_wifi_network_guid() { @@ -36,8 +41,6 @@ class FakeWifiHotspotDisconnector : public WifiHotspotDisconnector { private: std::string last_disconnected_wifi_network_guid_; std::string disconnection_error_name_; - - DISALLOW_COPY_AND_ASSIGN(FakeWifiHotspotDisconnector); }; } // namespace tether diff --git a/chromeos/components/tether/gms_core_notifications_state_tracker.h b/chromeos/components/tether/gms_core_notifications_state_tracker.h index 604f692065cb01..fa091fbe80bf66 100644 --- a/chromeos/components/tether/gms_core_notifications_state_tracker.h +++ b/chromeos/components/tether/gms_core_notifications_state_tracker.h @@ -26,6 +26,12 @@ class GmsCoreNotificationsStateTracker { }; GmsCoreNotificationsStateTracker(); + + GmsCoreNotificationsStateTracker(const GmsCoreNotificationsStateTracker&) = + delete; + GmsCoreNotificationsStateTracker& operator=( + const GmsCoreNotificationsStateTracker&) = delete; + virtual ~GmsCoreNotificationsStateTracker(); // Returns a list of names of all potential Tether hosts which replied that @@ -42,8 +48,6 @@ class GmsCoreNotificationsStateTracker { private: base::ObserverList::Unchecked observer_list_; - - DISALLOW_COPY_AND_ASSIGN(GmsCoreNotificationsStateTracker); }; } // namespace tether diff --git a/chromeos/components/tether/gms_core_notifications_state_tracker_impl.h b/chromeos/components/tether/gms_core_notifications_state_tracker_impl.h index ac183b7659fa2f..0dc981fe49bed9 100644 --- a/chromeos/components/tether/gms_core_notifications_state_tracker_impl.h +++ b/chromeos/components/tether/gms_core_notifications_state_tracker_impl.h @@ -24,6 +24,12 @@ class GmsCoreNotificationsStateTrackerImpl public HostScannerOperation::Observer { public: GmsCoreNotificationsStateTrackerImpl(); + + GmsCoreNotificationsStateTrackerImpl( + const GmsCoreNotificationsStateTrackerImpl&) = delete; + GmsCoreNotificationsStateTrackerImpl& operator=( + const GmsCoreNotificationsStateTrackerImpl&) = delete; + ~GmsCoreNotificationsStateTrackerImpl() override; // GmsCoreNotificationsStateTracker: @@ -45,8 +51,6 @@ class GmsCoreNotificationsStateTrackerImpl void SendDeviceNamesChangeEvent(); std::map device_id_to_name_map_; - - DISALLOW_COPY_AND_ASSIGN(GmsCoreNotificationsStateTrackerImpl); }; } // namespace tether diff --git a/chromeos/components/tether/gms_core_notifications_state_tracker_impl_unittest.cc b/chromeos/components/tether/gms_core_notifications_state_tracker_impl_unittest.cc index 5d07c353fb68e2..dfd3f23f4da61b 100644 --- a/chromeos/components/tether/gms_core_notifications_state_tracker_impl_unittest.cc +++ b/chromeos/components/tether/gms_core_notifications_state_tracker_impl_unittest.cc @@ -42,6 +42,9 @@ class TestObserver final : public GmsCoreNotificationsStateTracker::Observer { explicit TestObserver(GmsCoreNotificationsStateTrackerImpl* tracker) : tracker_(tracker) {} + TestObserver(const TestObserver&) = delete; + TestObserver& operator=(const TestObserver&) = delete; + ~TestObserver() = default; uint32_t change_count() const { return change_count_; } @@ -62,8 +65,6 @@ class TestObserver final : public GmsCoreNotificationsStateTracker::Observer { uint32_t change_count_ = 0; std::vector names_from_last_update_; - - DISALLOW_COPY_AND_ASSIGN(TestObserver); }; } // namespace diff --git a/chromeos/components/tether/host_connection_metrics_logger.h b/chromeos/components/tether/host_connection_metrics_logger.h index fc9a612ff6ace1..64281c852b6f5d 100644 --- a/chromeos/components/tether/host_connection_metrics_logger.h +++ b/chromeos/components/tether/host_connection_metrics_logger.h @@ -49,6 +49,11 @@ class HostConnectionMetricsLogger : public ActiveHost::Observer { const std::string& device_id); HostConnectionMetricsLogger(ActiveHost* active_host); + + HostConnectionMetricsLogger(const HostConnectionMetricsLogger&) = delete; + HostConnectionMetricsLogger& operator=(const HostConnectionMetricsLogger&) = + delete; + virtual ~HostConnectionMetricsLogger(); protected: @@ -202,8 +207,6 @@ class HostConnectionMetricsLogger : public ActiveHost::Observer { base::Time connect_to_host_start_time_; std::string active_host_device_id_; - - DISALLOW_COPY_AND_ASSIGN(HostConnectionMetricsLogger); }; } // namespace tether diff --git a/chromeos/components/tether/host_scan_cache.h b/chromeos/components/tether/host_scan_cache.h index 4bc0d98ecf6fc4..19891a71fa2e4c 100644 --- a/chromeos/components/tether/host_scan_cache.h +++ b/chromeos/components/tether/host_scan_cache.h @@ -20,6 +20,10 @@ namespace tether { class HostScanCache { public: HostScanCache(); + + HostScanCache(const HostScanCache&) = delete; + HostScanCache& operator=(const HostScanCache&) = delete; + virtual ~HostScanCache(); class Observer { @@ -59,8 +63,6 @@ class HostScanCache { private: base::ObserverList::Unchecked observer_list_; - - DISALLOW_COPY_AND_ASSIGN(HostScanCache); }; } // namespace tether diff --git a/chromeos/components/tether/host_scan_device_prioritizer.h b/chromeos/components/tether/host_scan_device_prioritizer.h index b40eee4010f357..37ca623af02873 100644 --- a/chromeos/components/tether/host_scan_device_prioritizer.h +++ b/chromeos/components/tether/host_scan_device_prioritizer.h @@ -23,14 +23,16 @@ namespace tether { class HostScanDevicePrioritizer { public: HostScanDevicePrioritizer() {} + + HostScanDevicePrioritizer(const HostScanDevicePrioritizer&) = delete; + HostScanDevicePrioritizer& operator=(const HostScanDevicePrioritizer&) = + delete; + virtual ~HostScanDevicePrioritizer() {} // Prioritizes |remote_devices| using the rules described above. virtual void SortByHostScanOrder( multidevice::RemoteDeviceRefList* remote_devices) const = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(HostScanDevicePrioritizer); }; } // namespace tether diff --git a/chromeos/components/tether/host_scan_device_prioritizer_impl.h b/chromeos/components/tether/host_scan_device_prioritizer_impl.h index 585fede0ee6657..3a00bea35c82f0 100644 --- a/chromeos/components/tether/host_scan_device_prioritizer_impl.h +++ b/chromeos/components/tether/host_scan_device_prioritizer_impl.h @@ -20,6 +20,11 @@ class HostScanDevicePrioritizerImpl : public HostScanDevicePrioritizer { public: HostScanDevicePrioritizerImpl( TetherHostResponseRecorder* tether_host_response_recorder); + + HostScanDevicePrioritizerImpl(const HostScanDevicePrioritizerImpl&) = delete; + HostScanDevicePrioritizerImpl& operator=( + const HostScanDevicePrioritizerImpl&) = delete; + ~HostScanDevicePrioritizerImpl() override; // HostScanDevicePrioritizer: @@ -28,8 +33,6 @@ class HostScanDevicePrioritizerImpl : public HostScanDevicePrioritizer { private: TetherHostResponseRecorder* tether_host_response_recorder_; - - DISALLOW_COPY_AND_ASSIGN(HostScanDevicePrioritizerImpl); }; } // namespace tether diff --git a/chromeos/components/tether/host_scan_scheduler.h b/chromeos/components/tether/host_scan_scheduler.h index 7505685c7136b0..8949f7f89ce0b2 100644 --- a/chromeos/components/tether/host_scan_scheduler.h +++ b/chromeos/components/tether/host_scan_scheduler.h @@ -15,15 +15,16 @@ namespace tether { class HostScanScheduler { public: HostScanScheduler() {} + + HostScanScheduler(const HostScanScheduler&) = delete; + HostScanScheduler& operator=(const HostScanScheduler&) = delete; + virtual ~HostScanScheduler() {} // Attempts to perform a Tether host scan. If the device is already connected // to the internet, a scan will not be performed. If a scan is already active, // this function is a no-op. virtual void AttemptScanIfOffline() = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(HostScanScheduler); }; } // namespace tether diff --git a/chromeos/components/tether/host_scan_scheduler_impl.h b/chromeos/components/tether/host_scan_scheduler_impl.h index c88e96ad917d57..d7a533e30fc0dd 100644 --- a/chromeos/components/tether/host_scan_scheduler_impl.h +++ b/chromeos/components/tether/host_scan_scheduler_impl.h @@ -45,6 +45,10 @@ class HostScanSchedulerImpl : public HostScanScheduler, HostScanSchedulerImpl(NetworkStateHandler* network_state_handler, HostScanner* host_scanner, session_manager::SessionManager* session_manager); + + HostScanSchedulerImpl(const HostScanSchedulerImpl&) = delete; + HostScanSchedulerImpl& operator=(const HostScanSchedulerImpl&) = delete; + ~HostScanSchedulerImpl() override; // HostScanScheduler: @@ -87,8 +91,6 @@ class HostScanSchedulerImpl : public HostScanScheduler, bool is_screen_locked_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(HostScanSchedulerImpl); }; } // namespace tether diff --git a/chromeos/components/tether/host_scanner_impl.h b/chromeos/components/tether/host_scanner_impl.h index 1af1258550a9c0..6723ec72c91ff0 100644 --- a/chromeos/components/tether/host_scanner_impl.h +++ b/chromeos/components/tether/host_scanner_impl.h @@ -73,6 +73,10 @@ class HostScannerImpl : public HostScanner, HostScanCache* host_scan_cache, ConnectionPreserver* connection_preserver, base::Clock* clock); + + HostScannerImpl(const HostScannerImpl&) = delete; + HostScannerImpl& operator=(const HostScannerImpl&) = delete; + ~HostScannerImpl() override; // HostScanner: @@ -138,8 +142,6 @@ class HostScannerImpl : public HostScanner, base::ObserverList::Unchecked observer_list_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(HostScannerImpl); }; } // namespace tether diff --git a/chromeos/components/tether/host_scanner_operation.h b/chromeos/components/tether/host_scanner_operation.h index a98d393aec579c..11ea110552c8af 100644 --- a/chromeos/components/tether/host_scanner_operation.h +++ b/chromeos/components/tether/host_scanner_operation.h @@ -92,6 +92,9 @@ class HostScannerOperation : public MessageTransferOperation { bool is_final_scan_result) = 0; }; + HostScannerOperation(const HostScannerOperation&) = delete; + HostScannerOperation& operator=(const HostScannerOperation&) = delete; + ~HostScannerOperation() override; void AddObserver(Observer* observer); @@ -149,8 +152,6 @@ class HostScannerOperation : public MessageTransferOperation { device_id_to_tether_availability_request_start_time_map_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(HostScannerOperation); }; } // namespace tether diff --git a/chromeos/components/tether/host_scanner_operation_unittest.cc b/chromeos/components/tether/host_scanner_operation_unittest.cc index c2d4d2866790f4..79434017ab79fc 100644 --- a/chromeos/components/tether/host_scanner_operation_unittest.cc +++ b/chromeos/components/tether/host_scanner_operation_unittest.cc @@ -50,15 +50,16 @@ class FakeHostScanDevicePrioritizer : public HostScanDevicePrioritizer { class MockOperationObserver : public HostScannerOperation::Observer { public: MockOperationObserver() = default; + + MockOperationObserver(const MockOperationObserver&) = delete; + MockOperationObserver& operator=(const MockOperationObserver&) = delete; + ~MockOperationObserver() = default; MOCK_METHOD3(OnTetherAvailabilityResponse, void(const std::vector&, const multidevice::RemoteDeviceRefList&, bool)); - - private: - DISALLOW_COPY_AND_ASSIGN(MockOperationObserver); }; DeviceStatus CreateFakeDeviceStatus() { diff --git a/chromeos/components/tether/hotspot_usage_duration_tracker.h b/chromeos/components/tether/hotspot_usage_duration_tracker.h index 3616cf1a9a466c..a103102c9abfbf 100644 --- a/chromeos/components/tether/hotspot_usage_duration_tracker.h +++ b/chromeos/components/tether/hotspot_usage_duration_tracker.h @@ -23,6 +23,11 @@ class HotspotUsageDurationTracker : public ActiveHost::Observer { public: explicit HotspotUsageDurationTracker(ActiveHost* active_host, base::Clock* clock); + + HotspotUsageDurationTracker(const HotspotUsageDurationTracker&) = delete; + HotspotUsageDurationTracker& operator=(const HotspotUsageDurationTracker&) = + delete; + virtual ~HotspotUsageDurationTracker(); protected: @@ -38,8 +43,6 @@ class HotspotUsageDurationTracker : public ActiveHost::Observer { base::Clock* clock_; base::Time last_connection_start_; - - DISALLOW_COPY_AND_ASSIGN(HotspotUsageDurationTracker); }; } // namespace tether diff --git a/chromeos/components/tether/keep_alive_operation.h b/chromeos/components/tether/keep_alive_operation.h index 6e0474a283c11f..af4358e449ccf5 100644 --- a/chromeos/components/tether/keep_alive_operation.h +++ b/chromeos/components/tether/keep_alive_operation.h @@ -55,6 +55,9 @@ class KeepAliveOperation : public MessageTransferOperation { std::unique_ptr device_status) = 0; }; + KeepAliveOperation(const KeepAliveOperation&) = delete; + KeepAliveOperation& operator=(const KeepAliveOperation&) = delete; + ~KeepAliveOperation() override; void AddObserver(Observer* observer); @@ -90,8 +93,6 @@ class KeepAliveOperation : public MessageTransferOperation { base::ObserverList::Unchecked observer_list_; base::Time keep_alive_tickle_request_start_time_; - - DISALLOW_COPY_AND_ASSIGN(KeepAliveOperation); }; } // namespace tether diff --git a/chromeos/components/tether/keep_alive_operation_unittest.cc b/chromeos/components/tether/keep_alive_operation_unittest.cc index 4158f0ef600732..92b8c30cc80d00 100644 --- a/chromeos/components/tether/keep_alive_operation_unittest.cc +++ b/chromeos/components/tether/keep_alive_operation_unittest.cc @@ -36,6 +36,10 @@ namespace { class MockOperationObserver : public KeepAliveOperation::Observer { public: MockOperationObserver() = default; + + MockOperationObserver(const MockOperationObserver&) = delete; + MockOperationObserver& operator=(const MockOperationObserver&) = delete; + ~MockOperationObserver() = default; MOCK_METHOD2(OnOperationFinishedRaw, @@ -45,9 +49,6 @@ class MockOperationObserver : public KeepAliveOperation::Observer { std::unique_ptr device_status) { OnOperationFinishedRaw(remote_device, device_status.get()); } - - private: - DISALLOW_COPY_AND_ASSIGN(MockOperationObserver); }; } // namespace diff --git a/chromeos/components/tether/keep_alive_scheduler.h b/chromeos/components/tether/keep_alive_scheduler.h index ca41f191eb82b1..954b3beaff6fd4 100644 --- a/chromeos/components/tether/keep_alive_scheduler.h +++ b/chromeos/components/tether/keep_alive_scheduler.h @@ -43,6 +43,10 @@ class KeepAliveScheduler : public ActiveHost::Observer, ActiveHost* active_host, HostScanCache* host_scan_cache, DeviceIdTetherNetworkGuidMap* device_id_tether_network_guid_map); + + KeepAliveScheduler(const KeepAliveScheduler&) = delete; + KeepAliveScheduler& operator=(const KeepAliveScheduler&) = delete; + virtual ~KeepAliveScheduler(); // ActiveHost::Observer: @@ -80,8 +84,6 @@ class KeepAliveScheduler : public ActiveHost::Observer, std::unique_ptr keep_alive_operation_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(KeepAliveScheduler); }; } // namespace tether diff --git a/chromeos/components/tether/message_transfer_operation.h b/chromeos/components/tether/message_transfer_operation.h index 4c74422fd392a6..548eff503abb21 100644 --- a/chromeos/components/tether/message_transfer_operation.h +++ b/chromeos/components/tether/message_transfer_operation.h @@ -36,6 +36,10 @@ class MessageTransferOperation { secure_channel::ConnectionPriority connection_priority, device_sync::DeviceSyncClient* device_sync_client, secure_channel::SecureChannelClient* secure_channel_client); + + MessageTransferOperation(const MessageTransferOperation&) = delete; + MessageTransferOperation& operator=(const MessageTransferOperation&) = delete; + virtual ~MessageTransferOperation(); // Initializes the operation by registering device connection listeners with @@ -201,8 +205,6 @@ class MessageTransferOperation { std::unique_ptr> remote_device_to_timer_map_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(MessageTransferOperation); }; } // namespace tether diff --git a/chromeos/components/tether/message_wrapper.h b/chromeos/components/tether/message_wrapper.h index 81b7f72f460212..3578bcf0d2fd9d 100644 --- a/chromeos/components/tether/message_wrapper.h +++ b/chromeos/components/tether/message_wrapper.h @@ -38,6 +38,9 @@ class MessageWrapper { MessageWrapper(const TetherAvailabilityRequest& request); MessageWrapper(const TetherAvailabilityResponse& response); + MessageWrapper(const MessageWrapper&) = delete; + MessageWrapper& operator=(const MessageWrapper&) = delete; + ~MessageWrapper(); std::shared_ptr GetProto() const; @@ -54,8 +57,6 @@ class MessageWrapper { private: MessageType type_; std::shared_ptr proto_; - - DISALLOW_COPY_AND_ASSIGN(MessageWrapper); }; } // namespace tether diff --git a/chromeos/components/tether/mock_host_connection_metrics_logger.h b/chromeos/components/tether/mock_host_connection_metrics_logger.h index d5a38bc4343aed..6702a182f0181f 100644 --- a/chromeos/components/tether/mock_host_connection_metrics_logger.h +++ b/chromeos/components/tether/mock_host_connection_metrics_logger.h @@ -19,14 +19,17 @@ class ActiveHost; class MockHostConnectionMetricsLogger : public HostConnectionMetricsLogger { public: MockHostConnectionMetricsLogger(ActiveHost* active_host); + + MockHostConnectionMetricsLogger(const MockHostConnectionMetricsLogger&) = + delete; + MockHostConnectionMetricsLogger& operator=( + const MockHostConnectionMetricsLogger&) = delete; + ~MockHostConnectionMetricsLogger() override; MOCK_METHOD2(RecordConnectionToHostResult, void(HostConnectionMetricsLogger::ConnectionToHostResult, const std::string&)); - - private: - DISALLOW_COPY_AND_ASSIGN(MockHostConnectionMetricsLogger); }; } // namespace tether diff --git a/chromeos/components/tether/mock_tether_host_response_recorder.h b/chromeos/components/tether/mock_tether_host_response_recorder.h index d47d956cff5f26..a25be2c8573621 100644 --- a/chromeos/components/tether/mock_tether_host_response_recorder.h +++ b/chromeos/components/tether/mock_tether_host_response_recorder.h @@ -20,6 +20,12 @@ namespace tether { class MockTetherHostResponseRecorder : public TetherHostResponseRecorder { public: MockTetherHostResponseRecorder(); + + MockTetherHostResponseRecorder(const MockTetherHostResponseRecorder&) = + delete; + MockTetherHostResponseRecorder& operator=( + const MockTetherHostResponseRecorder&) = delete; + ~MockTetherHostResponseRecorder() override; MOCK_METHOD1(RecordSuccessfulTetherAvailabilityResponse, @@ -28,9 +34,6 @@ class MockTetherHostResponseRecorder : public TetherHostResponseRecorder { void(multidevice::RemoteDeviceRef)); MOCK_CONST_METHOD0(GetPreviouslyAvailableHostIds, std::vector()); MOCK_CONST_METHOD0(GetPreviouslyConnectedHostIds, std::vector()); - - private: - DISALLOW_COPY_AND_ASSIGN(MockTetherHostResponseRecorder); }; } // namespace tether diff --git a/chromeos/components/tether/network_configuration_remover.h b/chromeos/components/tether/network_configuration_remover.h index e589d6d56328eb..99473715d49be9 100644 --- a/chromeos/components/tether/network_configuration_remover.h +++ b/chromeos/components/tether/network_configuration_remover.h @@ -20,6 +20,11 @@ class NetworkConfigurationRemover { public: NetworkConfigurationRemover(ManagedNetworkConfigurationHandler* managed_network_configuration_handler); + + NetworkConfigurationRemover(const NetworkConfigurationRemover&) = delete; + NetworkConfigurationRemover& operator=(const NetworkConfigurationRemover&) = + delete; + virtual ~NetworkConfigurationRemover(); // Remove the network configuration of the Wi-Fi hotspot referenced by @@ -31,8 +36,6 @@ class NetworkConfigurationRemover { friend class NetworkConfigurationRemoverTest; ManagedNetworkConfigurationHandler* managed_network_configuration_handler_; - - DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationRemover); }; } // namespace tether diff --git a/chromeos/components/tether/network_connection_handler_tether_delegate.h b/chromeos/components/tether/network_connection_handler_tether_delegate.h index 16f4758c81b386..0dc6915cb8ad7c 100644 --- a/chromeos/components/tether/network_connection_handler_tether_delegate.h +++ b/chromeos/components/tether/network_connection_handler_tether_delegate.h @@ -30,6 +30,12 @@ class NetworkConnectionHandlerTetherDelegate ActiveHost* active_host, TetherConnector* tether_connector, TetherDisconnector* tether_disconnector); + + NetworkConnectionHandlerTetherDelegate( + const NetworkConnectionHandlerTetherDelegate&) = delete; + NetworkConnectionHandlerTetherDelegate& operator=( + const NetworkConnectionHandlerTetherDelegate&) = delete; + ~NetworkConnectionHandlerTetherDelegate() override; // NetworkConnectionHandler::TetherDelegate: @@ -67,8 +73,6 @@ class NetworkConnectionHandlerTetherDelegate base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(NetworkConnectionHandlerTetherDelegate); }; } // namespace tether diff --git a/chromeos/components/tether/network_host_scan_cache.h b/chromeos/components/tether/network_host_scan_cache.h index 15b45a1b7cbd86..c3a0bf56a3d7ee 100644 --- a/chromeos/components/tether/network_host_scan_cache.h +++ b/chromeos/components/tether/network_host_scan_cache.h @@ -32,6 +32,10 @@ class NetworkHostScanCache : public HostScanCache, NetworkStateHandler* network_state_handler, TetherHostResponseRecorder* tether_host_response_recorder, DeviceIdTetherNetworkGuidMap* device_id_tether_network_guid_map); + + NetworkHostScanCache(const NetworkHostScanCache&) = delete; + NetworkHostScanCache& operator=(const NetworkHostScanCache&) = delete; + ~NetworkHostScanCache() override; // HostScanCache: @@ -55,8 +59,6 @@ class NetworkHostScanCache : public HostScanCache, NetworkStateHandler* network_state_handler_; TetherHostResponseRecorder* tether_host_response_recorder_; DeviceIdTetherNetworkGuidMap* device_id_tether_network_guid_map_; - - DISALLOW_COPY_AND_ASSIGN(NetworkHostScanCache); }; } // namespace tether diff --git a/chromeos/components/tether/network_list_sorter.h b/chromeos/components/tether/network_list_sorter.h index abc93099ed4c21..2272b3b36248de 100644 --- a/chromeos/components/tether/network_list_sorter.h +++ b/chromeos/components/tether/network_list_sorter.h @@ -22,14 +22,15 @@ namespace tether { class NetworkListSorter : public NetworkStateHandler::TetherSortDelegate { public: NetworkListSorter(); + + NetworkListSorter(const NetworkListSorter&) = delete; + NetworkListSorter& operator=(const NetworkListSorter&) = delete; + virtual ~NetworkListSorter(); // NetworkStateHandler::TetherNetworkListSorter: void SortTetherNetworkList( NetworkStateHandler::ManagedStateList* tether_networks) const override; - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkListSorter); }; } // namespace tether diff --git a/chromeos/components/tether/notification_presenter.h b/chromeos/components/tether/notification_presenter.h index 17817a5da2c67f..4620e5b143adc8 100644 --- a/chromeos/components/tether/notification_presenter.h +++ b/chromeos/components/tether/notification_presenter.h @@ -22,6 +22,10 @@ class NotificationPresenter { }; NotificationPresenter() {} + + NotificationPresenter(const NotificationPresenter&) = delete; + NotificationPresenter& operator=(const NotificationPresenter&) = delete; + virtual ~NotificationPresenter() {} // Notifies the user that a nearby device can potentially provide a tether @@ -58,9 +62,6 @@ class NotificationPresenter { // Removes the notification created by NotifyConnectionToHostFailed(), or does // nothing if that notification is not currently displayed. virtual void RemoveConnectionToHostFailedNotification() = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(NotificationPresenter); }; } // namespace tether diff --git a/chromeos/components/tether/notification_remover.h b/chromeos/components/tether/notification_remover.h index dcbe8d89d4a899..bf7cecc5560d17 100644 --- a/chromeos/components/tether/notification_remover.h +++ b/chromeos/components/tether/notification_remover.h @@ -31,6 +31,9 @@ class NotificationRemover : public HostScanCache::Observer, HostScanCache* host_scan_cache, ActiveHost* active_host); + NotificationRemover(const NotificationRemover&) = delete; + NotificationRemover& operator=(const NotificationRemover&) = delete; + ~NotificationRemover() override; // HostScanCache::Observer: @@ -48,8 +51,6 @@ class NotificationRemover : public HostScanCache::Observer, NotificationPresenter* notification_presenter_; HostScanCache* host_scan_cache_; ActiveHost* active_host_; - - DISALLOW_COPY_AND_ASSIGN(NotificationRemover); }; } // namespace tether diff --git a/chromeos/components/tether/persistent_host_scan_cache.h b/chromeos/components/tether/persistent_host_scan_cache.h index 066a163f5bf5a9..5cd428dafcee5f 100644 --- a/chromeos/components/tether/persistent_host_scan_cache.h +++ b/chromeos/components/tether/persistent_host_scan_cache.h @@ -17,15 +17,16 @@ namespace tether { class PersistentHostScanCache : virtual public HostScanCache { public: PersistentHostScanCache() {} + + PersistentHostScanCache(const PersistentHostScanCache&) = delete; + PersistentHostScanCache& operator=(const PersistentHostScanCache&) = delete; + ~PersistentHostScanCache() override {} // Returns the cache entries that are currently stored in user prefs as a map // from Tether network GUID to entry. virtual std::unordered_map GetStoredCacheEntries() = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(PersistentHostScanCache); }; } // namespace tether diff --git a/chromeos/components/tether/persistent_host_scan_cache_impl.h b/chromeos/components/tether/persistent_host_scan_cache_impl.h index 1ac580a249aeef..9d93711171eb88 100644 --- a/chromeos/components/tether/persistent_host_scan_cache_impl.h +++ b/chromeos/components/tether/persistent_host_scan_cache_impl.h @@ -27,6 +27,11 @@ class PersistentHostScanCacheImpl : public PersistentHostScanCache { static void RegisterPrefs(PrefRegistrySimple* registry); PersistentHostScanCacheImpl(PrefService* pref_service); + + PersistentHostScanCacheImpl(const PersistentHostScanCacheImpl&) = delete; + PersistentHostScanCacheImpl& operator=(const PersistentHostScanCacheImpl&) = + delete; + ~PersistentHostScanCacheImpl() override; // HostScanCache: @@ -48,8 +53,6 @@ class PersistentHostScanCacheImpl : public PersistentHostScanCache { const std::unordered_map& entries); PrefService* pref_service_; - - DISALLOW_COPY_AND_ASSIGN(PersistentHostScanCacheImpl); }; } // namespace tether diff --git a/chromeos/components/tether/synchronous_shutdown_object_container.h b/chromeos/components/tether/synchronous_shutdown_object_container.h index 90dead64c4c121..4e9693d95f1208 100644 --- a/chromeos/components/tether/synchronous_shutdown_object_container.h +++ b/chromeos/components/tether/synchronous_shutdown_object_container.h @@ -23,15 +23,18 @@ class TetherDisconnector; class SynchronousShutdownObjectContainer { public: SynchronousShutdownObjectContainer() {} + + SynchronousShutdownObjectContainer( + const SynchronousShutdownObjectContainer&) = delete; + SynchronousShutdownObjectContainer& operator=( + const SynchronousShutdownObjectContainer&) = delete; + virtual ~SynchronousShutdownObjectContainer() {} virtual ActiveHost* active_host() = 0; virtual HostScanCache* host_scan_cache() = 0; virtual HostScanScheduler* host_scan_scheduler() = 0; virtual TetherDisconnector* tether_disconnector() = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(SynchronousShutdownObjectContainer); }; } // namespace tether diff --git a/chromeos/components/tether/tether_component.h b/chromeos/components/tether/tether_component.h index 3f5789e31d74e5..8964db39a69b27 100644 --- a/chromeos/components/tether/tether_component.h +++ b/chromeos/components/tether/tether_component.h @@ -38,6 +38,10 @@ class TetherComponent { }; TetherComponent(); + + TetherComponent(const TetherComponent&) = delete; + TetherComponent& operator=(const TetherComponent&) = delete; + virtual ~TetherComponent(); // Requests that the Tether component shuts down. If the component can be shut @@ -57,8 +61,6 @@ class TetherComponent { private: Status status_ = Status::ACTIVE; base::ObserverList::Unchecked observer_list_; - - DISALLOW_COPY_AND_ASSIGN(TetherComponent); }; } // namespace tether diff --git a/chromeos/components/tether/tether_connector.h b/chromeos/components/tether/tether_connector.h index 52c9efaff8929b..d8437d8d6c1574 100644 --- a/chromeos/components/tether/tether_connector.h +++ b/chromeos/components/tether/tether_connector.h @@ -24,6 +24,10 @@ class TetherConnector { NetworkConnectionHandler::TetherDelegate::StringErrorCallback; TetherConnector() {} + + TetherConnector(const TetherConnector&) = delete; + TetherConnector& operator=(const TetherConnector&) = delete; + virtual ~TetherConnector() {} virtual void ConnectToNetwork(const std::string& tether_network_guid, @@ -33,9 +37,6 @@ class TetherConnector { // Returns whether the connection attempt was successfully canceled. virtual bool CancelConnectionAttempt( const std::string& tether_network_guid) = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(TetherConnector); }; } // namespace tether diff --git a/chromeos/components/tether/tether_connector_impl.h b/chromeos/components/tether/tether_connector_impl.h index 2f012e297b7365..495e7f843e89f7 100644 --- a/chromeos/components/tether/tether_connector_impl.h +++ b/chromeos/components/tether/tether_connector_impl.h @@ -59,6 +59,10 @@ class TetherConnectorImpl : public TetherConnector, HostConnectionMetricsLogger* host_connection_metrics_logger, DisconnectTetheringRequestSender* disconnect_tethering_request_sender, WifiHotspotDisconnector* wifi_hotspot_disconnector); + + TetherConnectorImpl(const TetherConnectorImpl&) = delete; + TetherConnectorImpl& operator=(const TetherConnectorImpl&) = delete; + ~TetherConnectorImpl() override; void ConnectToNetwork(const std::string& tether_network_guid, @@ -120,8 +124,6 @@ class TetherConnectorImpl : public TetherConnector, std::unique_ptr connect_tethering_operation_; base::Time connect_to_host_start_time_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(TetherConnectorImpl); }; } // namespace tether diff --git a/chromeos/components/tether/tether_connector_impl_unittest.cc b/chromeos/components/tether/tether_connector_impl_unittest.cc index a8b7ad5697f758..d7d35dad55158c 100644 --- a/chromeos/components/tether/tether_connector_impl_unittest.cc +++ b/chromeos/components/tether/tether_connector_impl_unittest.cc @@ -137,6 +137,10 @@ class TetherConnectorImplTest : public testing::Test { public: TetherConnectorImplTest() : test_devices_(multidevice::CreateRemoteDeviceRefListForTest(2u)) {} + + TetherConnectorImplTest(const TetherConnectorImplTest&) = delete; + TetherConnectorImplTest& operator=(const TetherConnectorImplTest&) = delete; + ~TetherConnectorImplTest() override = default; void SetUp() override { @@ -340,9 +344,6 @@ class TetherConnectorImplTest : public testing::Test { base::HistogramTester histogram_tester_; std::unique_ptr tether_connector_; - - private: - DISALLOW_COPY_AND_ASSIGN(TetherConnectorImplTest); }; TEST_F(TetherConnectorImplTest, DISABLED_TestCannotFetchDevice) { diff --git a/chromeos/components/tether/tether_disconnector.h b/chromeos/components/tether/tether_disconnector.h index 9de63d5fe5dbab..708d41434dbae9 100644 --- a/chromeos/components/tether/tether_disconnector.h +++ b/chromeos/components/tether/tether_disconnector.h @@ -25,6 +25,10 @@ class TetherDisconnector { NetworkConnectionHandler::TetherDelegate::StringErrorCallback; TetherDisconnector() {} + + TetherDisconnector(const TetherDisconnector&) = delete; + TetherDisconnector& operator=(const TetherDisconnector&) = delete; + virtual ~TetherDisconnector() {} // Disconnects from the network with GUID |tether_network_guid|. This GUID @@ -37,9 +41,6 @@ class TetherDisconnector { StringErrorCallback error_callback, const TetherSessionCompletionLogger::SessionCompletionReason& session_completion_reason) = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(TetherDisconnector); }; } // namespace tether diff --git a/chromeos/components/tether/tether_disconnector_impl.h b/chromeos/components/tether/tether_disconnector_impl.h index 3e5793a1eb38e9..159fab9ec96669 100644 --- a/chromeos/components/tether/tether_disconnector_impl.h +++ b/chromeos/components/tether/tether_disconnector_impl.h @@ -33,6 +33,10 @@ class TetherDisconnectorImpl : public TetherDisconnector { TetherConnector* tether_connector, DeviceIdTetherNetworkGuidMap* device_id_tether_network_guid_map, TetherSessionCompletionLogger* tether_session_completion_logger); + + TetherDisconnectorImpl(const TetherDisconnectorImpl&) = delete; + TetherDisconnectorImpl& operator=(const TetherDisconnectorImpl&) = delete; + ~TetherDisconnectorImpl() override; void DisconnectFromNetwork( @@ -58,8 +62,6 @@ class TetherDisconnectorImpl : public TetherDisconnector { TetherSessionCompletionLogger* tether_session_completion_logger_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(TetherDisconnectorImpl); }; } // namespace tether diff --git a/chromeos/components/tether/tether_disconnector_impl_unittest.cc b/chromeos/components/tether/tether_disconnector_impl_unittest.cc index 18f32c3d05a7ec..cfa667d1c9795d 100644 --- a/chromeos/components/tether/tether_disconnector_impl_unittest.cc +++ b/chromeos/components/tether/tether_disconnector_impl_unittest.cc @@ -33,6 +33,11 @@ class TetherDisconnectorImplTest : public testing::Test { public: TetherDisconnectorImplTest() : test_devices_(multidevice::CreateRemoteDeviceRefListForTest(2u)) {} + + TetherDisconnectorImplTest(const TetherDisconnectorImplTest&) = delete; + TetherDisconnectorImplTest& operator=(const TetherDisconnectorImplTest&) = + delete; + ~TetherDisconnectorImplTest() override = default; void SetUp() override { @@ -124,9 +129,6 @@ class TetherDisconnectorImplTest : public testing::Test { std::string disconnection_result_; std::unique_ptr tether_disconnector_; - - private: - DISALLOW_COPY_AND_ASSIGN(TetherDisconnectorImplTest); }; TEST_F(TetherDisconnectorImplTest, DisconnectWhenAlreadyDisconnected) { diff --git a/chromeos/components/tether/tether_host_fetcher.h b/chromeos/components/tether/tether_host_fetcher.h index 08907809515e35..e5461d5f612e97 100644 --- a/chromeos/components/tether/tether_host_fetcher.h +++ b/chromeos/components/tether/tether_host_fetcher.h @@ -31,6 +31,10 @@ class TetherHostFetcher { }; TetherHostFetcher(); + + TetherHostFetcher(const TetherHostFetcher&) = delete; + TetherHostFetcher& operator=(const TetherHostFetcher&) = delete; + virtual ~TetherHostFetcher(); void AddObserver(Observer* observer); @@ -62,8 +66,6 @@ class TetherHostFetcher { private: base::ObserverList::Unchecked observers_; - - DISALLOW_COPY_AND_ASSIGN(TetherHostFetcher); }; } // namespace tether diff --git a/chromeos/components/tether/tether_host_response_recorder.h b/chromeos/components/tether/tether_host_response_recorder.h index c1f7ab7d7c6244..65215c39780442 100644 --- a/chromeos/components/tether/tether_host_response_recorder.h +++ b/chromeos/components/tether/tether_host_response_recorder.h @@ -40,6 +40,11 @@ class TetherHostResponseRecorder { // Note: The PrefService* passed here must be created using the same registry // passed to RegisterPrefs(). explicit TetherHostResponseRecorder(PrefService* pref_service); + + TetherHostResponseRecorder(const TetherHostResponseRecorder&) = delete; + TetherHostResponseRecorder& operator=(const TetherHostResponseRecorder&) = + delete; + virtual ~TetherHostResponseRecorder(); void AddObserver(Observer* observer); @@ -84,8 +89,6 @@ class TetherHostResponseRecorder { PrefService* pref_service_; base::ObserverList::Unchecked observer_list_; - - DISALLOW_COPY_AND_ASSIGN(TetherHostResponseRecorder); }; } // namespace tether diff --git a/chromeos/components/tether/tether_network_disconnection_handler.h b/chromeos/components/tether/tether_network_disconnection_handler.h index 0cb5f553097169..5012b480f982a9 100644 --- a/chromeos/components/tether/tether_network_disconnection_handler.h +++ b/chromeos/components/tether/tether_network_disconnection_handler.h @@ -38,6 +38,12 @@ class TetherNetworkDisconnectionHandler : public NetworkStateHandlerObserver { NetworkConfigurationRemover* network_configuration_remover, DisconnectTetheringRequestSender* disconnect_tethering_request_sender, TetherSessionCompletionLogger* tether_session_completion_logger); + + TetherNetworkDisconnectionHandler(const TetherNetworkDisconnectionHandler&) = + delete; + TetherNetworkDisconnectionHandler& operator=( + const TetherNetworkDisconnectionHandler&) = delete; + ~TetherNetworkDisconnectionHandler() override; // NetworkStateHandlerObserver: @@ -61,8 +67,6 @@ class TetherNetworkDisconnectionHandler : public NetworkStateHandlerObserver { scoped_refptr task_runner_; base::WeakPtrFactory weak_ptr_factory_{ this}; - - DISALLOW_COPY_AND_ASSIGN(TetherNetworkDisconnectionHandler); }; } // namespace tether diff --git a/chromeos/components/tether/tether_session_completion_logger.h b/chromeos/components/tether/tether_session_completion_logger.h index 6ec7607d899b98..ace18c61e47f2b 100644 --- a/chromeos/components/tether/tether_session_completion_logger.h +++ b/chromeos/components/tether/tether_session_completion_logger.h @@ -31,6 +31,11 @@ class TetherSessionCompletionLogger { }; TetherSessionCompletionLogger(); + + TetherSessionCompletionLogger(const TetherSessionCompletionLogger&) = delete; + TetherSessionCompletionLogger& operator=( + const TetherSessionCompletionLogger&) = delete; + virtual ~TetherSessionCompletionLogger(); virtual void RecordTetherSessionCompletion( @@ -38,8 +43,6 @@ class TetherSessionCompletionLogger { private: friend class TetherSessionCompletionLoggerTest; - - DISALLOW_COPY_AND_ASSIGN(TetherSessionCompletionLogger); }; } // namespace tether diff --git a/chromeos/components/tether/top_level_host_scan_cache.h b/chromeos/components/tether/top_level_host_scan_cache.h index e3030e7b7a7a84..b14f20daeb312c 100644 --- a/chromeos/components/tether/top_level_host_scan_cache.h +++ b/chromeos/components/tether/top_level_host_scan_cache.h @@ -46,6 +46,10 @@ class TopLevelHostScanCache : public HostScanCache { ActiveHost* active_host, HostScanCache* network_host_scan_cache, PersistentHostScanCache* persistent_host_scan_cache); + + TopLevelHostScanCache(const TopLevelHostScanCache&) = delete; + TopLevelHostScanCache& operator=(const TopLevelHostScanCache&) = delete; + ~TopLevelHostScanCache() override; // HostScanCache: @@ -79,8 +83,6 @@ class TopLevelHostScanCache : public HostScanCache { std::unordered_map> tether_guid_to_timer_map_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(TopLevelHostScanCache); }; } // namespace tether diff --git a/chromeos/components/tether/wifi_hotspot_connector.h b/chromeos/components/tether/wifi_hotspot_connector.h index a6e4300c3ccd87..849f4e7a56f356 100644 --- a/chromeos/components/tether/wifi_hotspot_connector.h +++ b/chromeos/components/tether/wifi_hotspot_connector.h @@ -32,6 +32,10 @@ class WifiHotspotConnector : public NetworkStateHandlerObserver { public: WifiHotspotConnector(NetworkStateHandler* network_state_handler, NetworkConnect* network_connect); + + WifiHotspotConnector(const WifiHotspotConnector&) = delete; + WifiHotspotConnector& operator=(const WifiHotspotConnector&) = delete; + ~WifiHotspotConnector() override; // Function which receives the GUID of the connected Wi-Fi hotspot. If @@ -90,8 +94,6 @@ class WifiHotspotConnector : public NetworkStateHandlerObserver { scoped_refptr task_runner_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(WifiHotspotConnector); }; } // namespace tether diff --git a/chromeos/components/tether/wifi_hotspot_disconnector.h b/chromeos/components/tether/wifi_hotspot_disconnector.h index ca904bc072fc93..84ccc303204f25 100644 --- a/chromeos/components/tether/wifi_hotspot_disconnector.h +++ b/chromeos/components/tether/wifi_hotspot_disconnector.h @@ -20,6 +20,10 @@ class WifiHotspotDisconnector { NetworkConnectionHandler::TetherDelegate::StringErrorCallback; WifiHotspotDisconnector() {} + + WifiHotspotDisconnector(const WifiHotspotDisconnector&) = delete; + WifiHotspotDisconnector& operator=(const WifiHotspotDisconnector&) = delete; + virtual ~WifiHotspotDisconnector() {} // Disconnects from the Wi-Fi network with GUID |wifi_network_guid| and @@ -29,9 +33,6 @@ class WifiHotspotDisconnector { const std::string& wifi_network_guid, base::OnceClosure success_callback, StringErrorCallback error_callback) = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(WifiHotspotDisconnector); }; } // namespace tether diff --git a/chromeos/components/tether/wifi_hotspot_disconnector_impl.h b/chromeos/components/tether/wifi_hotspot_disconnector_impl.h index 6ba92d144fe4ab..5e5030cf1c00bc 100644 --- a/chromeos/components/tether/wifi_hotspot_disconnector_impl.h +++ b/chromeos/components/tether/wifi_hotspot_disconnector_impl.h @@ -32,6 +32,11 @@ class WifiHotspotDisconnectorImpl : public WifiHotspotDisconnector { NetworkStateHandler* network_state_handler, PrefService* pref_service, NetworkConfigurationRemover* network_configuration_remover); + + WifiHotspotDisconnectorImpl(const WifiHotspotDisconnectorImpl&) = delete; + WifiHotspotDisconnectorImpl& operator=(const WifiHotspotDisconnectorImpl&) = + delete; + ~WifiHotspotDisconnectorImpl() override; // WifiHotspotDisconnector: @@ -60,8 +65,6 @@ class WifiHotspotDisconnectorImpl : public WifiHotspotDisconnector { NetworkConfigurationRemover* network_configuration_remover_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(WifiHotspotDisconnectorImpl); }; } // namespace tether diff --git a/chromeos/components/tether/wifi_hotspot_disconnector_impl_unittest.cc b/chromeos/components/tether/wifi_hotspot_disconnector_impl_unittest.cc index 9dd488cc2ab732..6f4c2ad98efd71 100644 --- a/chromeos/components/tether/wifi_hotspot_disconnector_impl_unittest.cc +++ b/chromeos/components/tether/wifi_hotspot_disconnector_impl_unittest.cc @@ -94,6 +94,12 @@ class TestNetworkConnectionHandler : public NetworkConnectionHandler { class WifiHotspotDisconnectorImplTest : public testing::Test { public: WifiHotspotDisconnectorImplTest() = default; + + WifiHotspotDisconnectorImplTest(const WifiHotspotDisconnectorImplTest&) = + delete; + WifiHotspotDisconnectorImplTest& operator=( + const WifiHotspotDisconnectorImplTest&) = delete; + ~WifiHotspotDisconnectorImplTest() override = default; void SetUp() override { @@ -215,9 +221,6 @@ class WifiHotspotDisconnectorImplTest : public testing::Test { bool should_disconnect_successfully_; std::unique_ptr wifi_hotspot_disconnector_; - - private: - DISALLOW_COPY_AND_ASSIGN(WifiHotspotDisconnectorImplTest); }; TEST_F(WifiHotspotDisconnectorImplTest, NetworkDoesNotExist) { diff --git a/chromeos/components/trial_group/trial_group_checker.h b/chromeos/components/trial_group/trial_group_checker.h index 089801b539e32f..df7f6739c6fa36 100644 --- a/chromeos/components/trial_group/trial_group_checker.h +++ b/chromeos/components/trial_group/trial_group_checker.h @@ -41,6 +41,9 @@ class COMPONENT_EXPORT(TRIAL_GROUP_CHECKER) TrialGroupChecker { explicit TrialGroupChecker(GroupId group_id); + TrialGroupChecker(const TrialGroupChecker&) = delete; + TrialGroupChecker& operator=(const TrialGroupChecker&) = delete; + ~TrialGroupChecker(); // Checks user's membership and passes the result to a callback. The @@ -67,8 +70,6 @@ class COMPONENT_EXPORT(TRIAL_GROUP_CHECKER) TrialGroupChecker { std::unique_ptr loader_; base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(TrialGroupChecker); }; } // namespace trial_group diff --git a/chromeos/dbus/arc/arc_appfuse_provider_client.cc b/chromeos/dbus/arc/arc_appfuse_provider_client.cc index e427642c08631d..70ad0780dd619f 100644 --- a/chromeos/dbus/arc/arc_appfuse_provider_client.cc +++ b/chromeos/dbus/arc/arc_appfuse_provider_client.cc @@ -22,6 +22,11 @@ namespace { class ArcAppfuseProviderClientImpl : public ArcAppfuseProviderClient { public: ArcAppfuseProviderClientImpl() {} + + ArcAppfuseProviderClientImpl(const ArcAppfuseProviderClientImpl&) = delete; + ArcAppfuseProviderClientImpl& operator=(const ArcAppfuseProviderClientImpl&) = + delete; + ~ArcAppfuseProviderClientImpl() override = default; // ArcAppfuseProviderClient override: @@ -105,8 +110,6 @@ class ArcAppfuseProviderClientImpl : public ArcAppfuseProviderClient { dbus::ObjectProxy* proxy_ = nullptr; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ArcAppfuseProviderClientImpl); }; } // namespace diff --git a/chromeos/dbus/arc/arc_camera_client.cc b/chromeos/dbus/arc/arc_camera_client.cc index 30c19a0f971b52..6c398c4e93ebf7 100644 --- a/chromeos/dbus/arc/arc_camera_client.cc +++ b/chromeos/dbus/arc/arc_camera_client.cc @@ -28,6 +28,9 @@ class ArcCameraClientImpl : public ArcCameraClient { arc_camera::kArcCameraServiceName, dbus::ObjectPath(arc_camera::kArcCameraServicePath))) {} + ArcCameraClientImpl(const ArcCameraClientImpl&) = delete; + ArcCameraClientImpl& operator=(const ArcCameraClientImpl&) = delete; + ~ArcCameraClientImpl() override = default; // ArcCameraClient overrides: @@ -52,8 +55,6 @@ class ArcCameraClientImpl : public ArcCameraClient { dbus::ObjectProxy* proxy_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ArcCameraClientImpl); }; } // namespace diff --git a/chromeos/dbus/arc/arc_keymaster_client.cc b/chromeos/dbus/arc/arc_keymaster_client.cc index fcdd6808364aa3..4f02b6eee52651 100644 --- a/chromeos/dbus/arc/arc_keymaster_client.cc +++ b/chromeos/dbus/arc/arc_keymaster_client.cc @@ -26,6 +26,10 @@ void OnVoidDBusMethod(VoidDBusMethodCallback callback, class ArcKeymasterClientImpl : public ArcKeymasterClient { public: ArcKeymasterClientImpl() = default; + + ArcKeymasterClientImpl(const ArcKeymasterClientImpl&) = delete; + ArcKeymasterClientImpl& operator=(const ArcKeymasterClientImpl&) = delete; + ~ArcKeymasterClientImpl() override = default; void BootstrapMojoConnection(base::ScopedFD fd, @@ -50,8 +54,6 @@ class ArcKeymasterClientImpl : public ArcKeymasterClient { private: // Owned by the D-Bus implementation, who outlives this class. dbus::ObjectProxy* proxy_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(ArcKeymasterClientImpl); }; } // namespace diff --git a/chromeos/dbus/arc/arc_keymaster_client.h b/chromeos/dbus/arc/arc_keymaster_client.h index da082bc5d0eacc..48a80d4dce06d4 100644 --- a/chromeos/dbus/arc/arc_keymaster_client.h +++ b/chromeos/dbus/arc/arc_keymaster_client.h @@ -21,6 +21,9 @@ namespace chromeos { class COMPONENT_EXPORT(CHROMEOS_DBUS_ARC) ArcKeymasterClient : public DBusClient { public: + ArcKeymasterClient(const ArcKeymasterClient&) = delete; + ArcKeymasterClient& operator=(const ArcKeymasterClient&) = delete; + ~ArcKeymasterClient() override; // Factory function. @@ -34,9 +37,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_ARC) ArcKeymasterClient protected: // Create() should be used instead. ArcKeymasterClient(); - - private: - DISALLOW_COPY_AND_ASSIGN(ArcKeymasterClient); }; } // namespace chromeos diff --git a/chromeos/dbus/arc/arc_midis_client.cc b/chromeos/dbus/arc/arc_midis_client.cc index 9766452c54b762..1e2950ece238fe 100644 --- a/chromeos/dbus/arc/arc_midis_client.cc +++ b/chromeos/dbus/arc/arc_midis_client.cc @@ -26,6 +26,9 @@ class ArcMidisClientImpl : public ArcMidisClient { public: ArcMidisClientImpl() {} + ArcMidisClientImpl(const ArcMidisClientImpl&) = delete; + ArcMidisClientImpl& operator=(const ArcMidisClientImpl&) = delete; + ~ArcMidisClientImpl() override = default; void BootstrapMojoConnection(base::ScopedFD fd, @@ -58,8 +61,6 @@ class ArcMidisClientImpl : public ArcMidisClient { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ArcMidisClientImpl); }; } // namespace diff --git a/chromeos/dbus/arc/arc_midis_client.h b/chromeos/dbus/arc/arc_midis_client.h index e98664bd58e30d..e88a0c6fc17251 100644 --- a/chromeos/dbus/arc/arc_midis_client.h +++ b/chromeos/dbus/arc/arc_midis_client.h @@ -22,6 +22,9 @@ namespace chromeos { // initialization. class COMPONENT_EXPORT(CHROMEOS_DBUS_ARC) ArcMidisClient : public DBusClient { public: + ArcMidisClient(const ArcMidisClient&) = delete; + ArcMidisClient& operator=(const ArcMidisClient&) = delete; + ~ArcMidisClient() override = default; // Factory function. @@ -35,9 +38,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_ARC) ArcMidisClient : public DBusClient { protected: // Create() should be used instead. ArcMidisClient() = default; - - private: - DISALLOW_COPY_AND_ASSIGN(ArcMidisClient); }; } // namespace chromeos diff --git a/chromeos/dbus/arc/arc_obb_mounter_client.cc b/chromeos/dbus/arc/arc_obb_mounter_client.cc index 0dc53d959420f0..b93201108db051 100644 --- a/chromeos/dbus/arc/arc_obb_mounter_client.cc +++ b/chromeos/dbus/arc/arc_obb_mounter_client.cc @@ -21,6 +21,10 @@ namespace { class ArcObbMounterClientImpl : public ArcObbMounterClient { public: ArcObbMounterClientImpl() {} + + ArcObbMounterClientImpl(const ArcObbMounterClientImpl&) = delete; + ArcObbMounterClientImpl& operator=(const ArcObbMounterClientImpl&) = delete; + ~ArcObbMounterClientImpl() override = default; // ArcObbMounterClient override: @@ -70,8 +74,6 @@ class ArcObbMounterClientImpl : public ArcObbMounterClient { dbus::ObjectProxy* proxy_ = nullptr; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ArcObbMounterClientImpl); }; } // namespace diff --git a/chromeos/dbus/arc/fake_arc_appfuse_provider_client.h b/chromeos/dbus/arc/fake_arc_appfuse_provider_client.h index dab1a51697ec93..9c0425263fbcf8 100644 --- a/chromeos/dbus/arc/fake_arc_appfuse_provider_client.h +++ b/chromeos/dbus/arc/fake_arc_appfuse_provider_client.h @@ -14,6 +14,11 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_ARC) FakeArcAppfuseProviderClient : public ArcAppfuseProviderClient { public: FakeArcAppfuseProviderClient(); + + FakeArcAppfuseProviderClient(const FakeArcAppfuseProviderClient&) = delete; + FakeArcAppfuseProviderClient& operator=(const FakeArcAppfuseProviderClient&) = + delete; + ~FakeArcAppfuseProviderClient() override; // DBusClient override. @@ -31,9 +36,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_ARC) FakeArcAppfuseProviderClient int32_t file_id, int32_t flags, DBusMethodCallback callback) override; - - private: - DISALLOW_COPY_AND_ASSIGN(FakeArcAppfuseProviderClient); }; } // namespace chromeos diff --git a/chromeos/dbus/arc/fake_arc_keymaster_client.h b/chromeos/dbus/arc/fake_arc_keymaster_client.h index f304f99b9f2f99..e02a5c33dff76b 100644 --- a/chromeos/dbus/arc/fake_arc_keymaster_client.h +++ b/chromeos/dbus/arc/fake_arc_keymaster_client.h @@ -14,6 +14,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_ARC) FakeArcKeymasterClient : public ArcKeymasterClient { public: FakeArcKeymasterClient() = default; + + FakeArcKeymasterClient(const FakeArcKeymasterClient&) = delete; + FakeArcKeymasterClient& operator=(const FakeArcKeymasterClient&) = delete; + ~FakeArcKeymasterClient() override = default; // DBusClient override: @@ -22,9 +26,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_ARC) FakeArcKeymasterClient // ArcKeymasterClient override: void BootstrapMojoConnection(base::ScopedFD fd, VoidDBusMethodCallback callback) override; - - private: - DISALLOW_COPY_AND_ASSIGN(FakeArcKeymasterClient); }; } // namespace chromeos diff --git a/chromeos/dbus/arc/fake_arc_midis_client.h b/chromeos/dbus/arc/fake_arc_midis_client.h index 5ff0f866af2475..4d582c019b533a 100644 --- a/chromeos/dbus/arc/fake_arc_midis_client.h +++ b/chromeos/dbus/arc/fake_arc_midis_client.h @@ -14,6 +14,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_ARC) FakeArcMidisClient : public ArcMidisClient { public: FakeArcMidisClient() = default; + + FakeArcMidisClient(const FakeArcMidisClient&) = delete; + FakeArcMidisClient& operator=(const FakeArcMidisClient&) = delete; + ~FakeArcMidisClient() override = default; // DBusClient override: @@ -22,9 +26,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_ARC) FakeArcMidisClient // ArcMidisClient override: void BootstrapMojoConnection(base::ScopedFD fd, VoidDBusMethodCallback callback) override; - - private: - DISALLOW_COPY_AND_ASSIGN(FakeArcMidisClient); }; } // namespace chromeos diff --git a/chromeos/dbus/arc/fake_arc_obb_mounter_client.h b/chromeos/dbus/arc/fake_arc_obb_mounter_client.h index 0609d450383c30..01ec49d25f525c 100644 --- a/chromeos/dbus/arc/fake_arc_obb_mounter_client.h +++ b/chromeos/dbus/arc/fake_arc_obb_mounter_client.h @@ -16,6 +16,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_ARC) FakeArcObbMounterClient : public ArcObbMounterClient { public: FakeArcObbMounterClient(); + + FakeArcObbMounterClient(const FakeArcObbMounterClient&) = delete; + FakeArcObbMounterClient& operator=(const FakeArcObbMounterClient&) = delete; + ~FakeArcObbMounterClient() override; // DBusClient override. @@ -28,9 +32,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_ARC) FakeArcObbMounterClient VoidDBusMethodCallback callback) override; void UnmountObb(const std::string& mount_path, VoidDBusMethodCallback callback) override; - - private: - DISALLOW_COPY_AND_ASSIGN(FakeArcObbMounterClient); }; } // namespace chromeos diff --git a/chromeos/dbus/audio/cras_audio_client.cc b/chromeos/dbus/audio/cras_audio_client.cc index 313c2147c84b83..adc95c381ab83c 100644 --- a/chromeos/dbus/audio/cras_audio_client.cc +++ b/chromeos/dbus/audio/cras_audio_client.cc @@ -129,6 +129,9 @@ class CrasAudioClientImpl : public CrasAudioClient { weak_ptr_factory_.GetWeakPtr())); } + CrasAudioClientImpl(const CrasAudioClientImpl&) = delete; + CrasAudioClientImpl& operator=(const CrasAudioClientImpl&) = delete; + ~CrasAudioClientImpl() override = default; // CrasAudioClient overrides: @@ -1017,8 +1020,6 @@ class CrasAudioClientImpl : public CrasAudioClient { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(CrasAudioClientImpl); }; } // namespace diff --git a/chromeos/dbus/audio/fake_cras_audio_client.h b/chromeos/dbus/audio/fake_cras_audio_client.h index 25708a691b5450..0d7c6f09506b8b 100644 --- a/chromeos/dbus/audio/fake_cras_audio_client.h +++ b/chromeos/dbus/audio/fake_cras_audio_client.h @@ -23,6 +23,10 @@ class COMPONENT_EXPORT(DBUS_AUDIO) FakeCrasAudioClient using ClientTypeToInputStreamCount = base::flat_map; FakeCrasAudioClient(); + + FakeCrasAudioClient(const FakeCrasAudioClient&) = delete; + FakeCrasAudioClient& operator=(const FakeCrasAudioClient&) = delete; + ~FakeCrasAudioClient() override; static FakeCrasAudioClient* Get(); @@ -136,8 +140,6 @@ class COMPONENT_EXPORT(DBUS_AUDIO) FakeCrasAudioClient ClientTypeToInputStreamCount active_input_streams_; base::ObserverList::Unchecked observers_; - - DISALLOW_COPY_AND_ASSIGN(FakeCrasAudioClient); }; } // namespace chromeos diff --git a/chromeos/dbus/authpolicy/authpolicy_client.cc b/chromeos/dbus/authpolicy/authpolicy_client.cc index a3b13e14105577..15bda36115ed08 100644 --- a/chromeos/dbus/authpolicy/authpolicy_client.cc +++ b/chromeos/dbus/authpolicy/authpolicy_client.cc @@ -65,6 +65,9 @@ class AuthPolicyClientImpl : public AuthPolicyClient { public: AuthPolicyClientImpl() {} + AuthPolicyClientImpl(const AuthPolicyClientImpl&) = delete; + AuthPolicyClientImpl& operator=(const AuthPolicyClientImpl&) = delete; + ~AuthPolicyClientImpl() override = default; // AuthPolicyClient override. @@ -229,8 +232,6 @@ class AuthPolicyClientImpl : public AuthPolicyClient { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(AuthPolicyClientImpl); }; } // namespace diff --git a/chromeos/dbus/authpolicy/fake_authpolicy_client.h b/chromeos/dbus/authpolicy/fake_authpolicy_client.h index c2b4fd5c7991c9..2c31cfc8e9a8fc 100644 --- a/chromeos/dbus/authpolicy/fake_authpolicy_client.h +++ b/chromeos/dbus/authpolicy/fake_authpolicy_client.h @@ -27,6 +27,10 @@ class COMPONENT_EXPORT(AUTHPOLICY) FakeAuthPolicyClient : public AuthPolicyClient { public: FakeAuthPolicyClient(); + + FakeAuthPolicyClient(const FakeAuthPolicyClient&) = delete; + FakeAuthPolicyClient& operator=(const FakeAuthPolicyClient&) = delete; + ~FakeAuthPolicyClient() override; // Returns the fake global instance if initialized. May return null. @@ -185,8 +189,6 @@ class COMPONENT_EXPORT(AUTHPOLICY) FakeAuthPolicyClient absl::optional refresh_user_policy_error_; base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FakeAuthPolicyClient); }; } // namespace chromeos diff --git a/chromeos/dbus/biod/biod_client.cc b/chromeos/dbus/biod/biod_client.cc index d0c9e69eb20ebc..c573af25796428 100644 --- a/chromeos/dbus/biod/biod_client.cc +++ b/chromeos/dbus/biod/biod_client.cc @@ -40,6 +40,10 @@ void OnVoidResponse(VoidDBusMethodCallback callback, dbus::Response* response) { class BiodClientImpl : public BiodClient { public: BiodClientImpl() = default; + + BiodClientImpl(const BiodClientImpl&) = delete; + BiodClientImpl& operator=(const BiodClientImpl&) = delete; + ~BiodClientImpl() override = default; // BiodClient overrides: @@ -408,8 +412,6 @@ class BiodClientImpl : public BiodClient { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(BiodClientImpl); }; BiodClient::BiodClient() { diff --git a/chromeos/dbus/biod/biod_client_unittest.cc b/chromeos/dbus/biod/biod_client_unittest.cc index c323e950cb50c1..2d058fd9c7dee8 100644 --- a/chromeos/dbus/biod/biod_client_unittest.cc +++ b/chromeos/dbus/biod/biod_client_unittest.cc @@ -61,6 +61,10 @@ void RunResponseCallback(dbus::ObjectProxy::ResponseCallback callback, class BiodClientTest : public testing::Test { public: BiodClientTest() = default; + + BiodClientTest(const BiodClientTest&) = delete; + BiodClientTest& operator=(const BiodClientTest&) = delete; + ~BiodClientTest() override = default; void SetUp() override { @@ -201,8 +205,6 @@ class BiodClientTest : public testing::Test { FROM_HERE, base::BindOnce(&RunResponseCallback, std::move(*callback), std::move(pending_response))); } - - DISALLOW_COPY_AND_ASSIGN(BiodClientTest); }; TEST_F(BiodClientTest, TestStartEnrollSession) { diff --git a/chromeos/dbus/biod/fake_biod_client.h b/chromeos/dbus/biod/fake_biod_client.h index 5511a3faaa8053..9202e43c900031 100644 --- a/chromeos/dbus/biod/fake_biod_client.h +++ b/chromeos/dbus/biod/fake_biod_client.h @@ -27,6 +27,10 @@ namespace chromeos { class COMPONENT_EXPORT(BIOD_CLIENT) FakeBiodClient : public BiodClient { public: FakeBiodClient(); + + FakeBiodClient(const FakeBiodClient&) = delete; + FakeBiodClient& operator=(const FakeBiodClient&) = delete; + ~FakeBiodClient() override; // Checks that a FakeBiodClient instance was initialized and returns it. @@ -102,8 +106,6 @@ class COMPONENT_EXPORT(BIOD_CLIENT) FakeBiodClient : public BiodClient { FingerprintSession current_session_ = FingerprintSession::NONE; base::ObserverList::Unchecked observers_; - - DISALLOW_COPY_AND_ASSIGN(FakeBiodClient); }; } // namespace chromeos diff --git a/chromeos/dbus/biod/fake_biod_client_unittest.cc b/chromeos/dbus/biod/fake_biod_client_unittest.cc index 82a72fa4f33606..65f1c222e4248c 100644 --- a/chromeos/dbus/biod/fake_biod_client_unittest.cc +++ b/chromeos/dbus/biod/fake_biod_client_unittest.cc @@ -35,6 +35,10 @@ class FakeBiodClientTest : public testing::Test { FakeBiodClientTest() : task_runner_(new base::TestSimpleTaskRunner), task_runner_handle_(task_runner_) {} + + FakeBiodClientTest(const FakeBiodClientTest&) = delete; + FakeBiodClientTest& operator=(const FakeBiodClientTest&) = delete; + ~FakeBiodClientTest() override = default; // Returns the stored records for |user_id|. Verified to work in @@ -105,9 +109,6 @@ class FakeBiodClientTest : public testing::Test { // This number is incremented each time GenerateTestFingerprint is called to // ensure each fingerprint is unique. int num_test_fingerprints_ = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(FakeBiodClientTest); }; TEST_F(FakeBiodClientTest, TestEnrollSessionWorkflow) { diff --git a/chromeos/dbus/biod/test_utils.h b/chromeos/dbus/biod/test_utils.h index 28a39a23f0ce98..481bd80161304c 100644 --- a/chromeos/dbus/biod/test_utils.h +++ b/chromeos/dbus/biod/test_utils.h @@ -36,6 +36,10 @@ void CopyDBusMethodCallResult(bool* dest_result, bool src_result); class TestBiodObserver : public BiodClient::Observer { public: TestBiodObserver(); + + TestBiodObserver(const TestBiodObserver&) = delete; + TestBiodObserver& operator=(const TestBiodObserver&) = delete; + ~TestBiodObserver() override; int num_complete_enroll_scans_received() const { @@ -78,8 +82,6 @@ class TestBiodObserver : public BiodClient::Observer { // When auth scan is received, store the result. AuthScanMatches last_auth_scan_matches_; - - DISALLOW_COPY_AND_ASSIGN(TestBiodObserver); }; } // namespace test_utils diff --git a/chromeos/dbus/blocking_method_caller.h b/chromeos/dbus/blocking_method_caller.h index c41cd6d509733e..1e757e383a49a3 100644 --- a/chromeos/dbus/blocking_method_caller.h +++ b/chromeos/dbus/blocking_method_caller.h @@ -28,6 +28,10 @@ namespace chromeos { class COMPONENT_EXPORT(CHROMEOS_DBUS) BlockingMethodCaller { public: BlockingMethodCaller(dbus::Bus* bus, dbus::ObjectProxy* proxy); + + BlockingMethodCaller(const BlockingMethodCaller&) = delete; + BlockingMethodCaller& operator=(const BlockingMethodCaller&) = delete; + virtual ~BlockingMethodCaller(); // Calls the method and blocks until it returns. @@ -44,8 +48,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) BlockingMethodCaller { dbus::Bus* bus_; dbus::ObjectProxy* proxy_; base::WaitableEvent on_blocking_method_call_; - - DISALLOW_COPY_AND_ASSIGN(BlockingMethodCaller); }; } // namespace chromeos diff --git a/chromeos/dbus/cdm_factory_daemon/cdm_factory_daemon_client.cc b/chromeos/dbus/cdm_factory_daemon/cdm_factory_daemon_client.cc index 4b295f92f59668..022b10110a2e1c 100644 --- a/chromeos/dbus/cdm_factory_daemon/cdm_factory_daemon_client.cc +++ b/chromeos/dbus/cdm_factory_daemon/cdm_factory_daemon_client.cc @@ -26,6 +26,11 @@ CdmFactoryDaemonClient* g_instance = nullptr; class CdmFactoryDaemonClientImpl : public CdmFactoryDaemonClient { public: CdmFactoryDaemonClientImpl() = default; + + CdmFactoryDaemonClientImpl(const CdmFactoryDaemonClientImpl&) = delete; + CdmFactoryDaemonClientImpl& operator=(const CdmFactoryDaemonClientImpl&) = + delete; + ~CdmFactoryDaemonClientImpl() override = default; // CdmFactoryDaemonClient overrides: @@ -60,7 +65,6 @@ class CdmFactoryDaemonClientImpl : public CdmFactoryDaemonClient { dbus::ObjectProxy* proxy_ = nullptr; base::WeakPtrFactory weak_factory_{this}; - DISALLOW_COPY_AND_ASSIGN(CdmFactoryDaemonClientImpl); }; } // namespace diff --git a/chromeos/dbus/cdm_factory_daemon/fake_cdm_factory_daemon_client.h b/chromeos/dbus/cdm_factory_daemon/fake_cdm_factory_daemon_client.h index c059da5036fe59..54c2d49a83ceca 100644 --- a/chromeos/dbus/cdm_factory_daemon/fake_cdm_factory_daemon_client.h +++ b/chromeos/dbus/cdm_factory_daemon/fake_cdm_factory_daemon_client.h @@ -18,15 +18,17 @@ namespace chromeos { class FakeCdmFactoryDaemonClient : public CdmFactoryDaemonClient { public: FakeCdmFactoryDaemonClient(); + + FakeCdmFactoryDaemonClient(const FakeCdmFactoryDaemonClient&) = delete; + FakeCdmFactoryDaemonClient& operator=(const FakeCdmFactoryDaemonClient&) = + delete; + ~FakeCdmFactoryDaemonClient() override; // CdmFactoryDaemonClient: void BootstrapMojoConnection( base::ScopedFD fd, base::OnceCallback callback) override; - - private: - DISALLOW_COPY_AND_ASSIGN(FakeCdmFactoryDaemonClient); }; } // namespace chromeos diff --git a/chromeos/dbus/cec_service/cec_service_client.cc b/chromeos/dbus/cec_service/cec_service_client.cc index 33b9d4454055ff..f5063ab01c0c3d 100644 --- a/chromeos/dbus/cec_service/cec_service_client.cc +++ b/chromeos/dbus/cec_service/cec_service_client.cc @@ -83,6 +83,9 @@ class CecServiceClientImpl : public CecServiceClient { public: CecServiceClientImpl() = default; + CecServiceClientImpl(const CecServiceClientImpl&) = delete; + CecServiceClientImpl& operator=(const CecServiceClientImpl&) = delete; + ~CecServiceClientImpl() override = default; void SendStandBy() override { @@ -118,8 +121,6 @@ class CecServiceClientImpl : public CecServiceClient { private: scoped_refptr cec_service_proxy_; - - DISALLOW_COPY_AND_ASSIGN(CecServiceClientImpl); }; } // namespace diff --git a/chromeos/dbus/cec_service/cec_service_client.h b/chromeos/dbus/cec_service/cec_service_client.h index 1de62bc0ce808d..766b65450a43e8 100644 --- a/chromeos/dbus/cec_service/cec_service_client.h +++ b/chromeos/dbus/cec_service/cec_service_client.h @@ -24,6 +24,9 @@ namespace chromeos { class COMPONENT_EXPORT(CHROMEOS_DBUS_CEC_SERVICE) CecServiceClient : public DBusClient { public: + CecServiceClient(const CecServiceClient&) = delete; + CecServiceClient& operator=(const CecServiceClient&) = delete; + ~CecServiceClient() override; enum class PowerState { @@ -72,9 +75,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_CEC_SERVICE) CecServiceClient friend class CecServiceClientTest; CecServiceClient(); - - private: - DISALLOW_COPY_AND_ASSIGN(CecServiceClient); }; } // namespace chromeos diff --git a/chromeos/dbus/cec_service/fake_cec_service_client.h b/chromeos/dbus/cec_service/fake_cec_service_client.h index c59be421210257..5c97af572c4f7f 100644 --- a/chromeos/dbus/cec_service/fake_cec_service_client.h +++ b/chromeos/dbus/cec_service/fake_cec_service_client.h @@ -17,6 +17,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_CEC_SERVICE) FakeCecServiceClient : public CecServiceClient { public: FakeCecServiceClient(); + + FakeCecServiceClient(const FakeCecServiceClient&) = delete; + FakeCecServiceClient& operator=(const FakeCecServiceClient&) = delete; + ~FakeCecServiceClient() override; // CecServiceClient @@ -45,8 +49,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_CEC_SERVICE) FakeCecServiceClient int wake_up_call_count_ = 0; std::vector tv_power_states_; - - DISALLOW_COPY_AND_ASSIGN(FakeCecServiceClient); }; } // namespace chromeos diff --git a/chromeos/dbus/cicerone/cicerone_client.cc b/chromeos/dbus/cicerone/cicerone_client.cc index 89b4be15d38089..a9c1e1b893f0dc 100644 --- a/chromeos/dbus/cicerone/cicerone_client.cc +++ b/chromeos/dbus/cicerone/cicerone_client.cc @@ -41,6 +41,9 @@ class CiceroneClientImpl : public CiceroneClient { public: CiceroneClientImpl() = default; + CiceroneClientImpl(const CiceroneClientImpl&) = delete; + CiceroneClientImpl& operator=(const CiceroneClientImpl&) = delete; + ~CiceroneClientImpl() override = default; void AddObserver(Observer* observer) override { @@ -1100,8 +1103,6 @@ class CiceroneClientImpl : public CiceroneClient { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(CiceroneClientImpl); }; CiceroneClient::CiceroneClient() { diff --git a/chromeos/dbus/concierge/concierge_client.cc b/chromeos/dbus/concierge/concierge_client.cc index faa73f015429f2..f1d7dbe3e8694f 100644 --- a/chromeos/dbus/concierge/concierge_client.cc +++ b/chromeos/dbus/concierge/concierge_client.cc @@ -37,6 +37,9 @@ class ConciergeClientImpl : public ConciergeClient { public: ConciergeClientImpl() = default; + ConciergeClientImpl(const ConciergeClientImpl&) = delete; + ConciergeClientImpl& operator=(const ConciergeClientImpl&) = delete; + ~ConciergeClientImpl() override = default; void AddObserver(Observer* observer) override { @@ -460,8 +463,6 @@ class ConciergeClientImpl : public ConciergeClient { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ConciergeClientImpl); }; ConciergeClient::ConciergeClient() { diff --git a/chromeos/dbus/cros_disks/cros_disks_client.h b/chromeos/dbus/cros_disks/cros_disks_client.h index baa2e2eee53a92..ea09b33ee0eba8 100644 --- a/chromeos/dbus/cros_disks/cros_disks_client.h +++ b/chromeos/dbus/cros_disks/cros_disks_client.h @@ -335,6 +335,9 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_CROS_DISKS) CrosDisksClient const std::string& device_path) = 0; }; + CrosDisksClient(const CrosDisksClient&) = delete; + CrosDisksClient& operator=(const CrosDisksClient&) = delete; + ~CrosDisksClient() override; // Registers the given |observer| to listen D-Bus signals. @@ -419,9 +422,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_CROS_DISKS) CrosDisksClient protected: // Create() should be used instead. CrosDisksClient(); - - private: - DISALLOW_COPY_AND_ASSIGN(CrosDisksClient); }; } // namespace chromeos diff --git a/chromeos/dbus/cros_disks/fake_cros_disks_client.h b/chromeos/dbus/cros_disks/fake_cros_disks_client.h index 875f3c5745b322..aaee68b8623003 100644 --- a/chromeos/dbus/cros_disks/fake_cros_disks_client.h +++ b/chromeos/dbus/cros_disks/fake_cros_disks_client.h @@ -27,6 +27,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_CROS_DISKS) FakeCrosDisksClient base::RepeatingCallback&)>; FakeCrosDisksClient(); + + FakeCrosDisksClient(const FakeCrosDisksClient&) = delete; + FakeCrosDisksClient& operator=(const FakeCrosDisksClient&) = delete; + ~FakeCrosDisksClient() override; // CrosDisksClient overrides @@ -195,8 +199,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_CROS_DISKS) FakeCrosDisksClient bool block_mount_ = false; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FakeCrosDisksClient); }; } // namespace chromeos diff --git a/chromeos/dbus/cros_healthd/cros_healthd_client.cc b/chromeos/dbus/cros_healthd/cros_healthd_client.cc index 0ce8e39cd53c30..eee15d66b0fa71 100644 --- a/chromeos/dbus/cros_healthd/cros_healthd_client.cc +++ b/chromeos/dbus/cros_healthd/cros_healthd_client.cc @@ -26,6 +26,10 @@ CrosHealthdClient* g_instance = nullptr; class CrosHealthdClientImpl : public CrosHealthdClient { public: CrosHealthdClientImpl() = default; + + CrosHealthdClientImpl(const CrosHealthdClientImpl&) = delete; + CrosHealthdClientImpl& operator=(const CrosHealthdClientImpl&) = delete; + ~CrosHealthdClientImpl() override = default; // CrosHealthdClient overrides: @@ -107,8 +111,6 @@ class CrosHealthdClientImpl : public CrosHealthdClient { // Must be last class member. This WeakPtrFactory is specifically for the // bootstrapping callbacks. base::WeakPtrFactory bootstrap_weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(CrosHealthdClientImpl); }; } // namespace diff --git a/chromeos/dbus/cros_healthd/fake_cros_healthd_client.h b/chromeos/dbus/cros_healthd/fake_cros_healthd_client.h index 01fb45d1126053..a61d6cfbad815a 100644 --- a/chromeos/dbus/cros_healthd/fake_cros_healthd_client.h +++ b/chromeos/dbus/cros_healthd/fake_cros_healthd_client.h @@ -31,6 +31,10 @@ class COMPONENT_EXPORT(CROS_HEALTHD) FakeCrosHealthdClient // instance will set the global instance for the fake and for the base class, // so the static Get() accessor can be used with that pattern. FakeCrosHealthdClient(); + + FakeCrosHealthdClient(const FakeCrosHealthdClient&) = delete; + FakeCrosHealthdClient& operator=(const FakeCrosHealthdClient&) = delete; + ~FakeCrosHealthdClient() override; // Checks that a FakeCrosHealthdClient instance was initialized and returns @@ -144,8 +148,6 @@ class COMPONENT_EXPORT(CROS_HEALTHD) FakeCrosHealthdClient private: FakeCrosHealthdService fake_service_; mojo::Receiver receiver_{&fake_service_}; - - DISALLOW_COPY_AND_ASSIGN(FakeCrosHealthdClient); }; } // namespace cros_healthd diff --git a/chromeos/dbus/cros_healthd/fake_cros_healthd_service.h b/chromeos/dbus/cros_healthd/fake_cros_healthd_service.h index 21516035b3d9dc..935bdd91a8bfab 100644 --- a/chromeos/dbus/cros_healthd/fake_cros_healthd_service.h +++ b/chromeos/dbus/cros_healthd/fake_cros_healthd_service.h @@ -48,6 +48,10 @@ class FakeCrosHealthdService final }; FakeCrosHealthdService(); + + FakeCrosHealthdService(const FakeCrosHealthdService&) = delete; + FakeCrosHealthdService& operator=(const FakeCrosHealthdService&) = delete; + ~FakeCrosHealthdService() override; // CrosHealthdServiceFactory overrides: @@ -314,8 +318,6 @@ class FakeCrosHealthdService final network_diagnostics_routines_; base::TimeDelta callback_delay_; - - DISALLOW_COPY_AND_ASSIGN(FakeCrosHealthdService); }; } // namespace cros_healthd diff --git a/chromeos/dbus/cups_proxy/cups_proxy_client.cc b/chromeos/dbus/cups_proxy/cups_proxy_client.cc index b290520c8cc619..5c641f6eb38cd5 100644 --- a/chromeos/dbus/cups_proxy/cups_proxy_client.cc +++ b/chromeos/dbus/cups_proxy/cups_proxy_client.cc @@ -24,6 +24,10 @@ CupsProxyClient* g_instance = nullptr; class CupsProxyClientImpl : public CupsProxyClient { public: CupsProxyClientImpl() = default; + + CupsProxyClientImpl(const CupsProxyClientImpl&) = delete; + CupsProxyClientImpl& operator=(const CupsProxyClientImpl&) = delete; + ~CupsProxyClientImpl() override = default; // CupsProxyClient overrides. @@ -66,7 +70,6 @@ class CupsProxyClientImpl : public CupsProxyClient { // Must be last class member. base::WeakPtrFactory weak_ptr_factory_{this}; - DISALLOW_COPY_AND_ASSIGN(CupsProxyClientImpl); }; } // namespace diff --git a/chromeos/dbus/cups_proxy/fake_cups_proxy_client.h b/chromeos/dbus/cups_proxy/fake_cups_proxy_client.h index 0c9620fe7ba5a3..a806bfbec4ceae 100644 --- a/chromeos/dbus/cups_proxy/fake_cups_proxy_client.h +++ b/chromeos/dbus/cups_proxy/fake_cups_proxy_client.h @@ -17,6 +17,10 @@ namespace chromeos { class FakeCupsProxyClient : public CupsProxyClient { public: FakeCupsProxyClient(); + + FakeCupsProxyClient(const FakeCupsProxyClient&) = delete; + FakeCupsProxyClient& operator=(const FakeCupsProxyClient&) = delete; + ~FakeCupsProxyClient() override; // CupsProxyClient: @@ -25,9 +29,6 @@ class FakeCupsProxyClient : public CupsProxyClient { void BootstrapMojoConnection( base::ScopedFD fd, base::OnceCallback result_callback) override; - - private: - DISALLOW_COPY_AND_ASSIGN(FakeCupsProxyClient); }; } // namespace chromeos diff --git a/chromeos/dbus/dbus_clients_browser.h b/chromeos/dbus/dbus_clients_browser.h index e9c5a2eff02504..5c4e055c181384 100644 --- a/chromeos/dbus/dbus_clients_browser.h +++ b/chromeos/dbus/dbus_clients_browser.h @@ -47,6 +47,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) DBusClientsBrowser { // Creates real implementations if |use_real_clients| is true and fakes // otherwise. Fakes are used when running on Linux desktop and in tests. explicit DBusClientsBrowser(bool use_real_clients); + + DBusClientsBrowser(const DBusClientsBrowser&) = delete; + DBusClientsBrowser& operator=(const DBusClientsBrowser&) = delete; + ~DBusClientsBrowser(); void Initialize(dbus::Bus* system_bus); @@ -76,8 +80,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) DBusClientsBrowser { std::unique_ptr update_engine_client_; std::unique_ptr virtual_file_provider_client_; std::unique_ptr vm_plugin_dispatcher_client_; - - DISALLOW_COPY_AND_ASSIGN(DBusClientsBrowser); }; } // namespace chromeos diff --git a/chromeos/dbus/debug_daemon/debug_daemon_client.cc b/chromeos/dbus/debug_daemon/debug_daemon_client.cc index f97448ef5661b1..eb02376cc29338 100644 --- a/chromeos/dbus/debug_daemon/debug_daemon_client.cc +++ b/chromeos/dbus/debug_daemon/debug_daemon_client.cc @@ -137,6 +137,9 @@ class DebugDaemonClientImpl : public DebugDaemonClient { public: DebugDaemonClientImpl() : debugdaemon_proxy_(nullptr) {} + DebugDaemonClientImpl(const DebugDaemonClientImpl&) = delete; + DebugDaemonClientImpl& operator=(const DebugDaemonClientImpl&) = delete; + ~DebugDaemonClientImpl() override = default; // DebugDaemonClient override. @@ -1100,8 +1103,6 @@ class DebugDaemonClientImpl : public DebugDaemonClient { scoped_refptr stop_agent_tracing_task_runner_; base::ObserverList observers_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(DebugDaemonClientImpl); }; DebugDaemonClient::DebugDaemonClient() = default; diff --git a/chromeos/dbus/debug_daemon/debug_daemon_client.h b/chromeos/dbus/debug_daemon/debug_daemon_client.h index 009234c0a98fc4..b2513f74c944ca 100644 --- a/chromeos/dbus/debug_daemon/debug_daemon_client.h +++ b/chromeos/dbus/debug_daemon/debug_daemon_client.h @@ -43,6 +43,9 @@ class COMPONENT_EXPORT(DEBUG_DAEMON) DebugDaemonClient : public DBusClient, public base::trace_event::TracingAgent { public: + DebugDaemonClient(const DebugDaemonClient&) = delete; + DebugDaemonClient& operator=(const DebugDaemonClient&) = delete; + ~DebugDaemonClient() override; // Observes the signals that are received from D-Bus. @@ -332,9 +335,6 @@ class COMPONENT_EXPORT(DEBUG_DAEMON) DebugDaemonClient // Create() should be used instead. DebugDaemonClient(); - - private: - DISALLOW_COPY_AND_ASSIGN(DebugDaemonClient); }; } // namespace chromeos diff --git a/chromeos/dbus/debug_daemon/debug_daemon_client_provider.h b/chromeos/dbus/debug_daemon/debug_daemon_client_provider.h index 7d572a2e9721d3..e59c517e4b7103 100644 --- a/chromeos/dbus/debug_daemon/debug_daemon_client_provider.h +++ b/chromeos/dbus/debug_daemon/debug_daemon_client_provider.h @@ -33,6 +33,11 @@ class DebugDaemonClient; class COMPONENT_EXPORT(DEBUG_DAEMON) DebugDaemonClientProvider { public: DebugDaemonClientProvider(); + + DebugDaemonClientProvider(const DebugDaemonClientProvider&) = delete; + DebugDaemonClientProvider& operator=(const DebugDaemonClientProvider&) = + delete; + ~DebugDaemonClientProvider(); DebugDaemonClient* debug_daemon_client() const { @@ -44,8 +49,6 @@ class COMPONENT_EXPORT(DEBUG_DAEMON) DebugDaemonClientProvider { scoped_refptr dbus_bus_; scoped_refptr dbus_task_runner_; std::unique_ptr debug_daemon_client_; - - DISALLOW_COPY_AND_ASSIGN(DebugDaemonClientProvider); }; } // namespace chromeos diff --git a/chromeos/dbus/debug_daemon/fake_debug_daemon_client.h b/chromeos/dbus/debug_daemon/fake_debug_daemon_client.h index 50a7776595305d..f31f59af5b9da5 100644 --- a/chromeos/dbus/debug_daemon/fake_debug_daemon_client.h +++ b/chromeos/dbus/debug_daemon/fake_debug_daemon_client.h @@ -27,6 +27,10 @@ class COMPONENT_EXPORT(DEBUG_DAEMON) FakeDebugDaemonClient : public DebugDaemonClient { public: FakeDebugDaemonClient(); + + FakeDebugDaemonClient(const FakeDebugDaemonClient&) = delete; + FakeDebugDaemonClient& operator=(const FakeDebugDaemonClient&) = delete; + ~FakeDebugDaemonClient() override; void Init(dbus::Bus* bus) override; @@ -135,8 +139,6 @@ class COMPONENT_EXPORT(DEBUG_DAEMON) FakeDebugDaemonClient std::string scheduler_configuration_name_; std::set u2f_flags_; base::ObserverList observers_; - - DISALLOW_COPY_AND_ASSIGN(FakeDebugDaemonClient); }; } // namespace chromeos diff --git a/chromeos/dbus/dlcservice/dlcservice_client.cc b/chromeos/dbus/dlcservice/dlcservice_client.cc index 0fbc8858268b2e..a28366a2ac5d4f 100644 --- a/chromeos/dbus/dlcservice/dlcservice_client.cc +++ b/chromeos/dbus/dlcservice/dlcservice_client.cc @@ -52,6 +52,11 @@ class DlcserviceErrorResponseHandler { VLOG(1) << "Handling err=" << err_ << " err_msg=" << err_msg_; } + DlcserviceErrorResponseHandler(const DlcserviceErrorResponseHandler&) = + delete; + DlcserviceErrorResponseHandler& operator=( + const DlcserviceErrorResponseHandler&) = delete; + ~DlcserviceErrorResponseHandler() = default; std::string get_err() { return err_; } @@ -91,8 +96,6 @@ class DlcserviceErrorResponseHandler { // Holds the entire error message from error response. std::string err_msg_; - - DISALLOW_COPY_AND_ASSIGN(DlcserviceErrorResponseHandler); }; } // namespace @@ -102,6 +105,9 @@ class DlcserviceClientImpl : public DlcserviceClient { public: DlcserviceClientImpl() : dlcservice_proxy_(nullptr) {} + DlcserviceClientImpl(const DlcserviceClientImpl&) = delete; + DlcserviceClientImpl& operator=(const DlcserviceClientImpl&) = delete; + ~DlcserviceClientImpl() override = default; void Install(const std::string& dlc_id, @@ -454,8 +460,6 @@ class DlcserviceClientImpl : public DlcserviceClient { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(DlcserviceClientImpl); }; DlcserviceClient::DlcserviceClient() { diff --git a/chromeos/dbus/easy_unlock/fake_easy_unlock_client.h b/chromeos/dbus/easy_unlock/fake_easy_unlock_client.h index 73650a2aad969a..38474cab1ab325 100644 --- a/chromeos/dbus/easy_unlock/fake_easy_unlock_client.h +++ b/chromeos/dbus/easy_unlock/fake_easy_unlock_client.h @@ -23,6 +23,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_EASY_UNLOCK) FakeEasyUnlockClient const std::string& public_key); FakeEasyUnlockClient(); + + FakeEasyUnlockClient(const FakeEasyUnlockClient&) = delete; + FakeEasyUnlockClient& operator=(const FakeEasyUnlockClient&) = delete; + ~FakeEasyUnlockClient() override; // EasyUnlockClient overrides @@ -43,8 +47,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_EASY_UNLOCK) FakeEasyUnlockClient private: int generated_keys_count_; - - DISALLOW_COPY_AND_ASSIGN(FakeEasyUnlockClient); }; } // namespace chromeos diff --git a/chromeos/dbus/gnubby/fake_gnubby_client.h b/chromeos/dbus/gnubby/fake_gnubby_client.h index 32c32004e0e11b..60bcb98835dfe6 100644 --- a/chromeos/dbus/gnubby/fake_gnubby_client.h +++ b/chromeos/dbus/gnubby/fake_gnubby_client.h @@ -17,6 +17,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_GNUBBY) FakeGnubbyClient : public GnubbyClient { public: FakeGnubbyClient(); + + FakeGnubbyClient(const FakeGnubbyClient&) = delete; + FakeGnubbyClient& operator=(const FakeGnubbyClient&) = delete; + ~FakeGnubbyClient() override; // GnubbyClient overrides @@ -32,8 +36,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_GNUBBY) FakeGnubbyClient base::ObserverList::Unchecked observer_list_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FakeGnubbyClient); }; } // namespace chromeos diff --git a/chromeos/dbus/hammerd/fake_hammerd_client.h b/chromeos/dbus/hammerd/fake_hammerd_client.h index 6d5621775e3318..e90ae075469c07 100644 --- a/chromeos/dbus/hammerd/fake_hammerd_client.h +++ b/chromeos/dbus/hammerd/fake_hammerd_client.h @@ -17,6 +17,10 @@ namespace chromeos { class COMPONENT_EXPORT(HAMMERD) FakeHammerdClient : public HammerdClient { public: FakeHammerdClient(); + + FakeHammerdClient(const FakeHammerdClient&) = delete; + FakeHammerdClient& operator=(const FakeHammerdClient&) = delete; + ~FakeHammerdClient() override; // Checks that a FakeHammerdClient instance was initialized and returns it. @@ -37,8 +41,6 @@ class COMPONENT_EXPORT(HAMMERD) FakeHammerdClient : public HammerdClient { private: base::ObserverList::Unchecked observers_; - - DISALLOW_COPY_AND_ASSIGN(FakeHammerdClient); }; } // namespace chromeos diff --git a/chromeos/dbus/hammerd/hammerd_client.cc b/chromeos/dbus/hammerd/hammerd_client.cc index 07f01f4936fb0d..65e2af87fe16dc 100644 --- a/chromeos/dbus/hammerd/hammerd_client.cc +++ b/chromeos/dbus/hammerd/hammerd_client.cc @@ -27,6 +27,10 @@ HammerdClient* g_instance = nullptr; class HammerdClientImpl : public HammerdClient { public: HammerdClientImpl() = default; + + HammerdClientImpl(const HammerdClientImpl&) = delete; + HammerdClientImpl& operator=(const HammerdClientImpl&) = delete; + ~HammerdClientImpl() override = default; // HammerdClient: @@ -153,8 +157,6 @@ class HammerdClientImpl : public HammerdClient { base::ObserverList::Unchecked observers_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(HammerdClientImpl); }; } // namespace diff --git a/chromeos/dbus/image_burner/fake_image_burner_client.h b/chromeos/dbus/image_burner/fake_image_burner_client.h index 211aed423b9579..c5b9b9d6084cb0 100644 --- a/chromeos/dbus/image_burner/fake_image_burner_client.h +++ b/chromeos/dbus/image_burner/fake_image_burner_client.h @@ -18,6 +18,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_IMAGE_BURNER) FakeImageBurnerClient : public ImageBurnerClient { public: FakeImageBurnerClient(); + + FakeImageBurnerClient(const FakeImageBurnerClient&) = delete; + FakeImageBurnerClient& operator=(const FakeImageBurnerClient&) = delete; + ~FakeImageBurnerClient() override; // ImageBurnerClient overrides @@ -29,9 +33,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_IMAGE_BURNER) FakeImageBurnerClient BurnFinishedHandler burn_finished_handler, const BurnProgressUpdateHandler& burn_progress_update_handler) override; void ResetEventHandlers() override; - - private: - DISALLOW_COPY_AND_ASSIGN(FakeImageBurnerClient); }; } // namespace chromeos diff --git a/chromeos/dbus/image_burner/image_burner_client.cc b/chromeos/dbus/image_burner/image_burner_client.cc index 6367bf0cf62f41..49c60fc74ba561 100644 --- a/chromeos/dbus/image_burner/image_burner_client.cc +++ b/chromeos/dbus/image_burner/image_burner_client.cc @@ -25,6 +25,9 @@ class ImageBurnerClientImpl : public ImageBurnerClient { public: ImageBurnerClientImpl() : proxy_(nullptr) {} + ImageBurnerClientImpl(const ImageBurnerClientImpl&) = delete; + ImageBurnerClientImpl& operator=(const ImageBurnerClientImpl&) = delete; + ~ImageBurnerClientImpl() override = default; // ImageBurnerClient override. @@ -131,8 +134,6 @@ class ImageBurnerClientImpl : public ImageBurnerClient { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ImageBurnerClientImpl); }; } // namespace diff --git a/chromeos/dbus/image_burner/image_burner_client.h b/chromeos/dbus/image_burner/image_burner_client.h index c8764ed3639c5b..7174dcb026198f 100644 --- a/chromeos/dbus/image_burner/image_burner_client.h +++ b/chromeos/dbus/image_burner/image_burner_client.h @@ -23,6 +23,9 @@ namespace chromeos { class COMPONENT_EXPORT(CHROMEOS_DBUS_IMAGE_BURNER) ImageBurnerClient : public DBusClient { public: + ImageBurnerClient(const ImageBurnerClient&) = delete; + ImageBurnerClient& operator=(const ImageBurnerClient&) = delete; + ~ImageBurnerClient() override; // A callback to be called when DBus method call fails. @@ -64,9 +67,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_IMAGE_BURNER) ImageBurnerClient protected: // Create() should be used instead. ImageBurnerClient(); - - private: - DISALLOW_COPY_AND_ASSIGN(ImageBurnerClient); }; } // namespace chromeos diff --git a/chromeos/dbus/image_loader/fake_image_loader_client.h b/chromeos/dbus/image_loader/fake_image_loader_client.h index 9b4a7da8a0bb29..9e9ba4bf750bb4 100644 --- a/chromeos/dbus/image_loader/fake_image_loader_client.h +++ b/chromeos/dbus/image_loader/fake_image_loader_client.h @@ -24,6 +24,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_IMAGE_LOADER) FakeImageLoaderClient : public ImageLoaderClient { public: FakeImageLoaderClient(); + + FakeImageLoaderClient(const FakeImageLoaderClient&) = delete; + FakeImageLoaderClient& operator=(const FakeImageLoaderClient&) = delete; + ~FakeImageLoaderClient() override; // Sets intended mount path for a component. @@ -77,8 +81,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_IMAGE_LOADER) FakeImageLoaderClient // Maps a loaded component to the path from which it was loaded. std::map component_install_paths_; - - DISALLOW_COPY_AND_ASSIGN(FakeImageLoaderClient); }; } // namespace chromeos diff --git a/chromeos/dbus/image_loader/image_loader_client.cc b/chromeos/dbus/image_loader/image_loader_client.cc index c7073710d8b034..8aceed42fad9ed 100644 --- a/chromeos/dbus/image_loader/image_loader_client.cc +++ b/chromeos/dbus/image_loader/image_loader_client.cc @@ -24,6 +24,9 @@ class ImageLoaderClientImpl : public ImageLoaderClient { public: ImageLoaderClientImpl() = default; + ImageLoaderClientImpl(const ImageLoaderClientImpl&) = delete; + ImageLoaderClientImpl& operator=(const ImageLoaderClientImpl&) = delete; + ~ImageLoaderClientImpl() override = default; void RegisterComponent(const std::string& name, @@ -158,8 +161,6 @@ class ImageLoaderClientImpl : public ImageLoaderClient { } dbus::ObjectProxy* proxy_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(ImageLoaderClientImpl); }; } // namespace diff --git a/chromeos/dbus/image_loader/image_loader_client.h b/chromeos/dbus/image_loader/image_loader_client.h index 54af840aea70fa..160c3d000e7c6d 100644 --- a/chromeos/dbus/image_loader/image_loader_client.h +++ b/chromeos/dbus/image_loader/image_loader_client.h @@ -22,6 +22,9 @@ namespace chromeos { class COMPONENT_EXPORT(CHROMEOS_DBUS_IMAGE_LOADER) ImageLoaderClient : public DBusClient { public: + ImageLoaderClient(const ImageLoaderClient&) = delete; + ImageLoaderClient& operator=(const ImageLoaderClient&) = delete; + ~ImageLoaderClient() override; // Registers a component by copying from |component_folder_abs_path| into its @@ -63,9 +66,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_IMAGE_LOADER) ImageLoaderClient protected: // Create() should be used instead. ImageLoaderClient(); - - private: - DISALLOW_COPY_AND_ASSIGN(ImageLoaderClient); }; } // namespace chromeos diff --git a/chromeos/dbus/kerberos/fake_kerberos_client.h b/chromeos/dbus/kerberos/fake_kerberos_client.h index 944bafa13a3259..7471578516a630 100644 --- a/chromeos/dbus/kerberos/fake_kerberos_client.h +++ b/chromeos/dbus/kerberos/fake_kerberos_client.h @@ -22,6 +22,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) FakeKerberosClient public KerberosClient::TestInterface { public: FakeKerberosClient(); + + FakeKerberosClient(const FakeKerberosClient&) = delete; + FakeKerberosClient& operator=(const FakeKerberosClient&) = delete; + ~FakeKerberosClient() override; // KerberosClient: @@ -118,8 +122,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) FakeKerberosClient KerberosFilesChangedCallback kerberos_files_changed_callback_; KerberosTicketExpiringCallback kerberos_ticket_expiring_callback_; - - DISALLOW_COPY_AND_ASSIGN(FakeKerberosClient); }; } // namespace chromeos diff --git a/chromeos/dbus/kerberos/kerberos_client.cc b/chromeos/dbus/kerberos/kerberos_client.cc index ec304f547f7c01..dd3dfd8eef8624 100644 --- a/chromeos/dbus/kerberos/kerberos_client.cc +++ b/chromeos/dbus/kerberos/kerberos_client.cc @@ -52,6 +52,10 @@ void OnSignalConnected(const std::string& interface_name, class KerberosClientImpl : public KerberosClient { public: KerberosClientImpl() = default; + + KerberosClientImpl(const KerberosClientImpl&) = delete; + KerberosClientImpl& operator=(const KerberosClientImpl&) = delete; + ~KerberosClientImpl() override = default; // KerberosClient overrides: @@ -228,7 +232,6 @@ class KerberosClientImpl : public KerberosClient { KerberosTicketExpiringCallback kerberos_ticket_expiring_callback_; base::WeakPtrFactory weak_factory_{this}; - DISALLOW_COPY_AND_ASSIGN(KerberosClientImpl); }; } // namespace diff --git a/chromeos/dbus/machine_learning/fake_machine_learning_client.h b/chromeos/dbus/machine_learning/fake_machine_learning_client.h index 84576fb065c8e3..c2679c6d725eb6 100644 --- a/chromeos/dbus/machine_learning/fake_machine_learning_client.h +++ b/chromeos/dbus/machine_learning/fake_machine_learning_client.h @@ -16,15 +16,17 @@ namespace chromeos { class FakeMachineLearningClient : public MachineLearningClient { public: FakeMachineLearningClient(); + + FakeMachineLearningClient(const FakeMachineLearningClient&) = delete; + FakeMachineLearningClient& operator=(const FakeMachineLearningClient&) = + delete; + ~FakeMachineLearningClient() override; // MachineLearningClient: void BootstrapMojoConnection( base::ScopedFD fd, base::OnceCallback result_callback) override; - - private: - DISALLOW_COPY_AND_ASSIGN(FakeMachineLearningClient); }; } // namespace chromeos diff --git a/chromeos/dbus/machine_learning/machine_learning_client.cc b/chromeos/dbus/machine_learning/machine_learning_client.cc index eda6a5e20ef370..94fbb7456c92f1 100644 --- a/chromeos/dbus/machine_learning/machine_learning_client.cc +++ b/chromeos/dbus/machine_learning/machine_learning_client.cc @@ -29,6 +29,11 @@ MachineLearningClient* g_instance = nullptr; class MachineLearningClientImpl : public MachineLearningClient { public: MachineLearningClientImpl() = default; + + MachineLearningClientImpl(const MachineLearningClientImpl&) = delete; + MachineLearningClientImpl& operator=(const MachineLearningClientImpl&) = + delete; + ~MachineLearningClientImpl() override = default; // MachineLearningClient: @@ -65,8 +70,6 @@ class MachineLearningClientImpl : public MachineLearningClient { // Must be last class member. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(MachineLearningClientImpl); }; } // namespace diff --git a/chromeos/dbus/media_analytics/fake_media_analytics_client.h b/chromeos/dbus/media_analytics/fake_media_analytics_client.h index d85d53df1efae2..3c00628ddc634f 100644 --- a/chromeos/dbus/media_analytics/fake_media_analytics_client.h +++ b/chromeos/dbus/media_analytics/fake_media_analytics_client.h @@ -21,6 +21,10 @@ class COMPONENT_EXPORT(MEDIA_ANALYTICS_CLIENT) FakeMediaAnalyticsClient : public MediaAnalyticsClient { public: FakeMediaAnalyticsClient(); + + FakeMediaAnalyticsClient(const FakeMediaAnalyticsClient&) = delete; + FakeMediaAnalyticsClient& operator=(const FakeMediaAnalyticsClient&) = delete; + ~FakeMediaAnalyticsClient() override; // Checks that a FakeMediaAnalyticsClient instance was initialized and returns @@ -75,8 +79,6 @@ class COMPONENT_EXPORT(MEDIA_ANALYTICS_CLIENT) FakeMediaAnalyticsClient bool process_running_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FakeMediaAnalyticsClient); }; } // namespace chromeos diff --git a/chromeos/dbus/media_analytics/media_analytics_client.cc b/chromeos/dbus/media_analytics/media_analytics_client.cc index 5170e18c68db11..be919a4f5f59f8 100644 --- a/chromeos/dbus/media_analytics/media_analytics_client.cc +++ b/chromeos/dbus/media_analytics/media_analytics_client.cc @@ -32,6 +32,9 @@ class MediaAnalyticsClientImpl : public MediaAnalyticsClient { public: MediaAnalyticsClientImpl() = default; + MediaAnalyticsClientImpl(const MediaAnalyticsClientImpl&) = delete; + MediaAnalyticsClientImpl& operator=(const MediaAnalyticsClientImpl&) = delete; + ~MediaAnalyticsClientImpl() override = default; void AddObserver(Observer* observer) override { @@ -174,8 +177,6 @@ class MediaAnalyticsClientImpl : public MediaAnalyticsClient { dbus::ObjectProxy* dbus_proxy_ = nullptr; base::ObserverList::Unchecked observer_list_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(MediaAnalyticsClientImpl); }; MediaAnalyticsClient::MediaAnalyticsClient() { diff --git a/chromeos/dbus/native_timer_unittest.cc b/chromeos/dbus/native_timer_unittest.cc index e8df63994dab50..6e642f6d306f8f 100644 --- a/chromeos/dbus/native_timer_unittest.cc +++ b/chromeos/dbus/native_timer_unittest.cc @@ -22,6 +22,9 @@ class NativeTimerTest : public testing::Test { : task_environment_(base::test::TaskEnvironment::MainThreadType::IO, base::test::TaskEnvironment::TimeSource::MOCK_TIME) {} + NativeTimerTest(const NativeTimerTest&) = delete; + NativeTimerTest& operator=(const NativeTimerTest&) = delete; + ~NativeTimerTest() override = default; // testing::Test: @@ -56,9 +59,6 @@ class NativeTimerTest : public testing::Test { } base::test::TaskEnvironment task_environment_; - - private: - DISALLOW_COPY_AND_ASSIGN(NativeTimerTest); }; TEST_F(NativeTimerTest, CheckCreateFailure) { diff --git a/chromeos/dbus/oobe_config/fake_oobe_configuration_client.h b/chromeos/dbus/oobe_config/fake_oobe_configuration_client.h index 62660bfe6ce67a..d300a7f5506bcc 100644 --- a/chromeos/dbus/oobe_config/fake_oobe_configuration_client.h +++ b/chromeos/dbus/oobe_config/fake_oobe_configuration_client.h @@ -17,15 +17,17 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_OOBE_CONFIG) FakeOobeConfigurationClient : public OobeConfigurationClient { public: FakeOobeConfigurationClient(); + + FakeOobeConfigurationClient(const FakeOobeConfigurationClient&) = delete; + FakeOobeConfigurationClient& operator=(const FakeOobeConfigurationClient&) = + delete; + ~FakeOobeConfigurationClient() override; void Init(dbus::Bus* bus) override; // EasyUnlockClient overrides void CheckForOobeConfiguration(ConfigurationCallback callback) override; - - private: - DISALLOW_COPY_AND_ASSIGN(FakeOobeConfigurationClient); }; } // namespace chromeos diff --git a/chromeos/dbus/oobe_config/oobe_configuration_client.cc b/chromeos/dbus/oobe_config/oobe_configuration_client.cc index f09522992f64b7..2858a9042f4779 100644 --- a/chromeos/dbus/oobe_config/oobe_configuration_client.cc +++ b/chromeos/dbus/oobe_config/oobe_configuration_client.cc @@ -25,6 +25,10 @@ class OobeConfigurationClientImpl : public OobeConfigurationClient { public: OobeConfigurationClientImpl() {} + OobeConfigurationClientImpl(const OobeConfigurationClientImpl&) = delete; + OobeConfigurationClientImpl& operator=(const OobeConfigurationClientImpl&) = + delete; + ~OobeConfigurationClientImpl() override = default; // OobeConfigurationClient override: @@ -83,8 +87,6 @@ class OobeConfigurationClientImpl : public OobeConfigurationClient { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(OobeConfigurationClientImpl); }; // static diff --git a/chromeos/dbus/oobe_config/oobe_configuration_client.h b/chromeos/dbus/oobe_config/oobe_configuration_client.h index 7ce22fe840a0db..f2022325573b34 100644 --- a/chromeos/dbus/oobe_config/oobe_configuration_client.h +++ b/chromeos/dbus/oobe_config/oobe_configuration_client.h @@ -26,6 +26,9 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_OOBE_CONFIG) OobeConfigurationClient base::OnceCallback; + OobeConfigurationClient(const OobeConfigurationClient&) = delete; + OobeConfigurationClient& operator=(const OobeConfigurationClient&) = delete; + ~OobeConfigurationClient() override = default; // Factory function. @@ -39,9 +42,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_OOBE_CONFIG) OobeConfigurationClient // Create() should be used instead. OobeConfigurationClient() = default; - - private: - DISALLOW_COPY_AND_ASSIGN(OobeConfigurationClient); }; } // namespace chromeos diff --git a/chromeos/dbus/permission_broker/fake_permission_broker_client.h b/chromeos/dbus/permission_broker/fake_permission_broker_client.h index ffa9cdb6e22ef2..cff0675d3d83e3 100644 --- a/chromeos/dbus/permission_broker/fake_permission_broker_client.h +++ b/chromeos/dbus/permission_broker/fake_permission_broker_client.h @@ -21,6 +21,11 @@ class COMPONENT_EXPORT(PERMISSION_BROKER) FakePermissionBrokerClient : public PermissionBrokerClient { public: FakePermissionBrokerClient(); + + FakePermissionBrokerClient(const FakePermissionBrokerClient&) = delete; + FakePermissionBrokerClient& operator=(const FakePermissionBrokerClient&) = + delete; + ~FakePermissionBrokerClient() override; // Checks that a fake instance was initialized and returns it. @@ -104,8 +109,6 @@ class COMPONENT_EXPORT(PERMISSION_BROKER) FakePermissionBrokerClient RuleSet tcp_deny_rule_set_; RuleSet udp_deny_rule_set_; - - DISALLOW_COPY_AND_ASSIGN(FakePermissionBrokerClient); }; } // namespace chromeos diff --git a/chromeos/dbus/permission_broker/permission_broker_client.cc b/chromeos/dbus/permission_broker/permission_broker_client.cc index 2d724f9abf75af..b848cf82d28d50 100644 --- a/chromeos/dbus/permission_broker/permission_broker_client.cc +++ b/chromeos/dbus/permission_broker/permission_broker_client.cc @@ -45,6 +45,11 @@ PermissionBrokerClient* g_instance = nullptr; class PermissionBrokerClientImpl : public PermissionBrokerClient { public: PermissionBrokerClientImpl() = default; + + PermissionBrokerClientImpl(const PermissionBrokerClientImpl&) = delete; + PermissionBrokerClientImpl& operator=(const PermissionBrokerClientImpl&) = + delete; + ~PermissionBrokerClientImpl() override = default; void CheckPathAccess(const std::string& path, @@ -268,8 +273,6 @@ class PermissionBrokerClientImpl : public PermissionBrokerClient { // first, invalidating its weak pointers, before the other members are // destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(PermissionBrokerClientImpl); }; PermissionBrokerClient::PermissionBrokerClient() { diff --git a/chromeos/dbus/pipe_reader.h b/chromeos/dbus/pipe_reader.h index b43a0c956ad548..9ba082075e6ced 100644 --- a/chromeos/dbus/pipe_reader.h +++ b/chromeos/dbus/pipe_reader.h @@ -41,6 +41,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) PipeReader { base::OnceCallback data)>; explicit PipeReader(const scoped_refptr& task_runner); + + PipeReader(const PipeReader&) = delete; + PipeReader& operator=(const PipeReader&) = delete; + ~PipeReader(); // Starts data collection. @@ -68,8 +72,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) PipeReader { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(PipeReader); }; } // namespace chromeos diff --git a/chromeos/dbus/power/fake_power_manager_client.h b/chromeos/dbus/power/fake_power_manager_client.h index 22f4eb3d6976c9..ed4e38a3b0d56a 100644 --- a/chromeos/dbus/power/fake_power_manager_client.h +++ b/chromeos/dbus/power/fake_power_manager_client.h @@ -40,6 +40,10 @@ class COMPONENT_EXPORT(DBUS_POWER) FakePowerManagerClient : public PowerManagerClient { public: FakePowerManagerClient(); + + FakePowerManagerClient(const FakePowerManagerClient&) = delete; + FakePowerManagerClient& operator=(const FakePowerManagerClient&) = delete; + ~FakePowerManagerClient() override; // Checks that FakePowerManagerClient was initialized and returns it. @@ -326,8 +330,6 @@ class COMPONENT_EXPORT(DBUS_POWER) FakePowerManagerClient // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FakePowerManagerClient); }; } // namespace chromeos diff --git a/chromeos/dbus/power/fake_power_manager_client_unittest.cc b/chromeos/dbus/power/fake_power_manager_client_unittest.cc index 6b598dbf88bfa6..01857a20c63181 100644 --- a/chromeos/dbus/power/fake_power_manager_client_unittest.cc +++ b/chromeos/dbus/power/fake_power_manager_client_unittest.cc @@ -22,6 +22,10 @@ const power_manager::PowerSupplyProperties_ExternalPower kInitialExternalPower = class TestObserver : public PowerManagerClient::Observer { public: TestObserver() : num_power_changed_(0) {} + + TestObserver(const TestObserver&) = delete; + TestObserver& operator=(const TestObserver&) = delete; + ~TestObserver() override = default; const power_manager::PowerSupplyProperties& props() const { return props_; } @@ -38,8 +42,6 @@ class TestObserver : public PowerManagerClient::Observer { private: int num_power_changed_; power_manager::PowerSupplyProperties props_; - - DISALLOW_COPY_AND_ASSIGN(TestObserver); }; void SetTestProperties(power_manager::PowerSupplyProperties* props) { diff --git a/chromeos/dbus/power/native_timer.h b/chromeos/dbus/power/native_timer.h index 14bcab70352325..0bcb20147757e0 100644 --- a/chromeos/dbus/power/native_timer.h +++ b/chromeos/dbus/power/native_timer.h @@ -31,6 +31,9 @@ class COMPONENT_EXPORT(DBUS_POWER) NativeTimer { public: explicit NativeTimer(const std::string& tag); + NativeTimer(const NativeTimer&) = delete; + NativeTimer& operator=(const NativeTimer&) = delete; + ~NativeTimer(); // Starts a timer to expire at |absolute_expiration_time|. Runs @@ -93,8 +96,6 @@ class COMPONENT_EXPORT(DBUS_POWER) NativeTimer { SEQUENCE_CHECKER(sequence_checker_); base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(NativeTimer); }; } // namespace chromeos diff --git a/chromeos/dbus/power/power_manager_client.cc b/chromeos/dbus/power/power_manager_client.cc index bb6207b4983e0e..5c7dda9d78955f 100644 --- a/chromeos/dbus/power/power_manager_client.cc +++ b/chromeos/dbus/power/power_manager_client.cc @@ -171,6 +171,9 @@ class PowerManagerClientImpl : public PowerManagerClient { PowerManagerClientImpl() : origin_thread_id_(base::PlatformThread::CurrentId()) {} + PowerManagerClientImpl(const PowerManagerClientImpl&) = delete; + PowerManagerClientImpl& operator=(const PowerManagerClientImpl&) = delete; + ~PowerManagerClientImpl() override { // Here we should unregister suspend notifications from powerd, // however: @@ -1385,8 +1388,6 @@ class PowerManagerClientImpl : public PowerManagerClient { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(PowerManagerClientImpl); }; PowerManagerClient::PowerManagerClient() { diff --git a/chromeos/dbus/power/power_manager_client.h b/chromeos/dbus/power/power_manager_client.h index 4c4e447507a6b4..2e4a757b1eaa34 100644 --- a/chromeos/dbus/power/power_manager_client.h +++ b/chromeos/dbus/power/power_manager_client.h @@ -370,6 +370,10 @@ class COMPONENT_EXPORT(DBUS_POWER) PowerManagerClient { DBusMethodCallback callback) = 0; PowerManagerClient(); + + PowerManagerClient(const PowerManagerClient&) = delete; + PowerManagerClient& operator=(const PowerManagerClient&) = delete; + virtual ~PowerManagerClient(); // Creates and initializes the global instance. |bus| must not be null. @@ -383,9 +387,6 @@ class COMPONENT_EXPORT(DBUS_POWER) PowerManagerClient { // Returns the global instance if initialized. May return null. static PowerManagerClient* Get(); - - private: - DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); }; } // namespace chromeos diff --git a/chromeos/dbus/power/power_manager_client_unittest.cc b/chromeos/dbus/power/power_manager_client_unittest.cc index 4a82fe0e0df05a..f01953b1a3c89f 100644 --- a/chromeos/dbus/power/power_manager_client_unittest.cc +++ b/chromeos/dbus/power/power_manager_client_unittest.cc @@ -91,6 +91,10 @@ class TestObserver : public PowerManagerClient::Observer { explicit TestObserver(PowerManagerClient* client) : client_(client) { client_->AddObserver(this); } + + TestObserver(const TestObserver&) = delete; + TestObserver& operator=(const TestObserver&) = delete; + ~TestObserver() override { client_->RemoveObserver(this); } int num_suspend_imminent() const { return num_suspend_imminent_; } @@ -168,7 +172,6 @@ class TestObserver : public PowerManagerClient::Observer { // Ambient color temperature int32_t ambient_color_temperature_ = 0; - DISALLOW_COPY_AND_ASSIGN(TestObserver); }; // Stub implementation of PowerManagerClient::RenderProcessManagerDelegate. @@ -177,6 +180,10 @@ class TestDelegate : public PowerManagerClient::RenderProcessManagerDelegate { explicit TestDelegate(PowerManagerClient* client) { client->SetRenderProcessManagerDelegate(weak_ptr_factory_.GetWeakPtr()); } + + TestDelegate(const TestDelegate&) = delete; + TestDelegate& operator=(const TestDelegate&) = delete; + ~TestDelegate() override = default; int num_suspend_imminent() const { return num_suspend_imminent_; } @@ -192,8 +199,6 @@ class TestDelegate : public PowerManagerClient::RenderProcessManagerDelegate { int num_suspend_done_ = 0; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(TestDelegate); }; // Local implementation of base::test::PowerMonitorTestObserver to add callback @@ -225,6 +230,10 @@ class PowerMonitorTestObserverLocal class PowerManagerClientTest : public testing::Test { public: PowerManagerClientTest() = default; + + PowerManagerClientTest(const PowerManagerClientTest&) = delete; + PowerManagerClientTest& operator=(const PowerManagerClientTest&) = delete; + ~PowerManagerClientTest() override = default; void SetUp() override { @@ -392,8 +401,6 @@ class PowerManagerClientTest : public testing::Test { FROM_HERE, base::BindOnce(&RunResponseCallback, std::move(*callback), std::move(response))); } - - DISALLOW_COPY_AND_ASSIGN(PowerManagerClientTest); }; // Tests that suspend readiness is reported immediately when there are no diff --git a/chromeos/dbus/power/power_policy_controller_unittest.cc b/chromeos/dbus/power/power_policy_controller_unittest.cc index bf22809f14bc9f..d237a1f64331c4 100644 --- a/chromeos/dbus/power/power_policy_controller_unittest.cc +++ b/chromeos/dbus/power/power_policy_controller_unittest.cc @@ -17,6 +17,11 @@ namespace chromeos { class PowerPolicyControllerTest : public testing::Test { public: PowerPolicyControllerTest() = default; + + PowerPolicyControllerTest(const PowerPolicyControllerTest&) = delete; + PowerPolicyControllerTest& operator=(const PowerPolicyControllerTest&) = + delete; + ~PowerPolicyControllerTest() override = default; void SetUp() override { @@ -39,9 +44,6 @@ class PowerPolicyControllerTest : public testing::Test { PowerPolicyController* policy_controller_; base::test::SingleThreadTaskEnvironment task_environment_; - - private: - DISALLOW_COPY_AND_ASSIGN(PowerPolicyControllerTest); }; TEST_F(PowerPolicyControllerTest, Prefs) { diff --git a/chromeos/dbus/runtime_probe/fake_runtime_probe_client.h b/chromeos/dbus/runtime_probe/fake_runtime_probe_client.h index 6bdefc28b03d72..2aa9bf6a8a3e2e 100644 --- a/chromeos/dbus/runtime_probe/fake_runtime_probe_client.h +++ b/chromeos/dbus/runtime_probe/fake_runtime_probe_client.h @@ -18,6 +18,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_RUNTIME_PROBE) FakeRuntimeProbeClient : public RuntimeProbeClient { public: FakeRuntimeProbeClient(); + + FakeRuntimeProbeClient(const FakeRuntimeProbeClient&) = delete; + FakeRuntimeProbeClient& operator=(const FakeRuntimeProbeClient&) = delete; + ~FakeRuntimeProbeClient() override; // RuntimeProbeClient overrides: @@ -36,8 +40,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_RUNTIME_PROBE) FakeRuntimeProbeClient // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FakeRuntimeProbeClient); }; } // namespace chromeos diff --git a/chromeos/dbus/runtime_probe/runtime_probe_client.cc b/chromeos/dbus/runtime_probe/runtime_probe_client.cc index 9e6738d60f6681..125e46bdf6c5cf 100644 --- a/chromeos/dbus/runtime_probe/runtime_probe_client.cc +++ b/chromeos/dbus/runtime_probe/runtime_probe_client.cc @@ -23,6 +23,9 @@ class RuntimeProbeClientImpl : public RuntimeProbeClient { public: RuntimeProbeClientImpl() {} + RuntimeProbeClientImpl(const RuntimeProbeClientImpl&) = delete; + RuntimeProbeClientImpl& operator=(const RuntimeProbeClientImpl&) = delete; + ~RuntimeProbeClientImpl() override = default; // RuntimeProbeClient override: @@ -76,8 +79,6 @@ class RuntimeProbeClientImpl : public RuntimeProbeClient { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(RuntimeProbeClientImpl); }; RuntimeProbeClient::RuntimeProbeClient() = default; diff --git a/chromeos/dbus/runtime_probe/runtime_probe_client.h b/chromeos/dbus/runtime_probe/runtime_probe_client.h index a4633036ae3d22..e6879b776d2ef2 100644 --- a/chromeos/dbus/runtime_probe/runtime_probe_client.h +++ b/chromeos/dbus/runtime_probe/runtime_probe_client.h @@ -25,6 +25,9 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_RUNTIME_PROBE) RuntimeProbeClient // Creates an instance of RuntimeProbeClient. static std::unique_ptr Create(); + RuntimeProbeClient(const RuntimeProbeClient&) = delete; + RuntimeProbeClient& operator=(const RuntimeProbeClient&) = delete; + ~RuntimeProbeClient() override; // Probes categories. @@ -34,9 +37,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_RUNTIME_PROBE) RuntimeProbeClient protected: // Create() should be used instead. RuntimeProbeClient(); - - private: - DISALLOW_COPY_AND_ASSIGN(RuntimeProbeClient); }; } // namespace chromeos diff --git a/chromeos/dbus/seneschal/seneschal_client.cc b/chromeos/dbus/seneschal/seneschal_client.cc index 45da71aa2f7e60..01333339d83eba 100644 --- a/chromeos/dbus/seneschal/seneschal_client.cc +++ b/chromeos/dbus/seneschal/seneschal_client.cc @@ -29,6 +29,9 @@ class SeneschalClientImpl : public SeneschalClient { public: SeneschalClientImpl() = default; + SeneschalClientImpl(const SeneschalClientImpl&) = delete; + SeneschalClientImpl& operator=(const SeneschalClientImpl&) = delete; + ~SeneschalClientImpl() override = default; void AddObserver(Observer* observer) override { @@ -135,8 +138,6 @@ class SeneschalClientImpl : public SeneschalClient { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(SeneschalClientImpl); }; SeneschalClient::SeneschalClient() { diff --git a/chromeos/dbus/seneschal/seneschal_client.h b/chromeos/dbus/seneschal/seneschal_client.h index 0fa0b49ba3865b..120dca716ca19b 100644 --- a/chromeos/dbus/seneschal/seneschal_client.h +++ b/chromeos/dbus/seneschal/seneschal_client.h @@ -32,6 +32,9 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) SeneschalClient : public DBusClient { // Removes an observer if added. virtual void RemoveObserver(Observer* observer) = 0; + SeneschalClient(const SeneschalClient&) = delete; + SeneschalClient& operator=(const SeneschalClient&) = delete; + ~SeneschalClient() override; // Factory function, creates a new instance and returns ownership. @@ -74,9 +77,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) SeneschalClient : public DBusClient { protected: // Initialize() should be used instead. SeneschalClient(); - - private: - DISALLOW_COPY_AND_ASSIGN(SeneschalClient); }; } // namespace chromeos diff --git a/chromeos/dbus/services/cros_dbus_service.cc b/chromeos/dbus/services/cros_dbus_service.cc index 2a84742a03929f..001240fc34b25f 100644 --- a/chromeos/dbus/services/cros_dbus_service.cc +++ b/chromeos/dbus/services/cros_dbus_service.cc @@ -36,6 +36,9 @@ class CrosDBusServiceImpl : public CrosDBusService { DCHECK(object_path_.IsValid()); } + CrosDBusServiceImpl(const CrosDBusServiceImpl&) = delete; + CrosDBusServiceImpl& operator=(const CrosDBusServiceImpl&) = delete; + ~CrosDBusServiceImpl() override = default; // Starts the D-Bus service. @@ -88,8 +91,6 @@ class CrosDBusServiceImpl : public CrosDBusService { // Service providers that form CrosDBusService. ServiceProviderList service_providers_; - - DISALLOW_COPY_AND_ASSIGN(CrosDBusServiceImpl); }; // The stub CrosDBusService implementation used on Linux desktop, @@ -97,10 +98,11 @@ class CrosDBusServiceImpl : public CrosDBusService { class CrosDBusServiceStubImpl : public CrosDBusService { public: CrosDBusServiceStubImpl() = default; - ~CrosDBusServiceStubImpl() override = default; - private: - DISALLOW_COPY_AND_ASSIGN(CrosDBusServiceStubImpl); + CrosDBusServiceStubImpl(const CrosDBusServiceStubImpl&) = delete; + CrosDBusServiceStubImpl& operator=(const CrosDBusServiceStubImpl&) = delete; + + ~CrosDBusServiceStubImpl() override = default; }; // static diff --git a/chromeos/dbus/services/cros_dbus_service.h b/chromeos/dbus/services/cros_dbus_service.h index 1ea51c1f59641c..a912c637713309 100644 --- a/chromeos/dbus/services/cros_dbus_service.h +++ b/chromeos/dbus/services/cros_dbus_service.h @@ -55,6 +55,9 @@ class CrosDBusService { static ServiceProviderList CreateServiceProviderList( std::unique_ptr provider); + CrosDBusService(const CrosDBusService&) = delete; + CrosDBusService& operator=(const CrosDBusService&) = delete; + virtual ~CrosDBusService(); protected: @@ -71,8 +74,6 @@ class CrosDBusService { const std::string& service_name, const dbus::ObjectPath& object_path, ServiceProviderList service_providers); - - DISALLOW_COPY_AND_ASSIGN(CrosDBusService); }; } // namespace chromeos diff --git a/chromeos/dbus/session_manager/fake_session_manager_client.h b/chromeos/dbus/session_manager/fake_session_manager_client.h index 17e1e7d5cc302b..cae47e5cfa2efc 100644 --- a/chromeos/dbus/session_manager/fake_session_manager_client.h +++ b/chromeos/dbus/session_manager/fake_session_manager_client.h @@ -46,6 +46,9 @@ class COMPONENT_EXPORT(SESSION_MANAGER) FakeSessionManagerClient explicit FakeSessionManagerClient(PolicyStorageType policy_storage); + FakeSessionManagerClient(const FakeSessionManagerClient&) = delete; + FakeSessionManagerClient& operator=(const FakeSessionManagerClient&) = delete; + ~FakeSessionManagerClient() override; // Returns the fake global instance if initialized. May return null. @@ -390,7 +393,6 @@ class COMPONENT_EXPORT(SESSION_MANAGER) FakeSessionManagerClient absl::optional primary_user_id_; base::WeakPtrFactory weak_ptr_factory_{this}; - DISALLOW_COPY_AND_ASSIGN(FakeSessionManagerClient); }; class COMPONENT_EXPORT(SESSION_MANAGER) ScopedFakeSessionManagerClient { diff --git a/chromeos/dbus/session_manager/session_manager_client.cc b/chromeos/dbus/session_manager/session_manager_client.cc index 690540a2ddc967..912b45644d3ef8 100644 --- a/chromeos/dbus/session_manager/session_manager_client.cc +++ b/chromeos/dbus/session_manager/session_manager_client.cc @@ -166,6 +166,10 @@ bool ReadSecretFromSharedMemory(base::ScopedFD fd, class SessionManagerClientImpl : public SessionManagerClient { public: SessionManagerClientImpl() = default; + + SessionManagerClientImpl(const SessionManagerClientImpl&) = delete; + SessionManagerClientImpl& operator=(const SessionManagerClientImpl&) = delete; + ~SessionManagerClientImpl() override = default; // SessionManagerClient overrides: @@ -1100,8 +1104,6 @@ class SessionManagerClientImpl : public SessionManagerClient { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(SessionManagerClientImpl); }; SessionManagerClient::SessionManagerClient() { diff --git a/chromeos/dbus/shill/fake_modem_messaging_client.h b/chromeos/dbus/shill/fake_modem_messaging_client.h index e3aeebde856d80..ae75dedd85b3a0 100644 --- a/chromeos/dbus/shill/fake_modem_messaging_client.h +++ b/chromeos/dbus/shill/fake_modem_messaging_client.h @@ -21,6 +21,10 @@ class COMPONENT_EXPORT(SHILL_CLIENT) FakeModemMessagingClient public ModemMessagingClient::TestInterface { public: FakeModemMessagingClient(); + + FakeModemMessagingClient(const FakeModemMessagingClient&) = delete; + FakeModemMessagingClient& operator=(const FakeModemMessagingClient&) = delete; + ~FakeModemMessagingClient() override; void SetSmsReceivedHandler(const std::string& service_name, @@ -45,8 +49,6 @@ class COMPONENT_EXPORT(SHILL_CLIENT) FakeModemMessagingClient private: std::map sms_received_handlers_; std::map> message_paths_map_; - - DISALLOW_COPY_AND_ASSIGN(FakeModemMessagingClient); }; } // namespace chromeos diff --git a/chromeos/dbus/shill/fake_shill_device_client.h b/chromeos/dbus/shill/fake_shill_device_client.h index d88c3ad9162eee..a7377e34f5d5ed 100644 --- a/chromeos/dbus/shill/fake_shill_device_client.h +++ b/chromeos/dbus/shill/fake_shill_device_client.h @@ -26,6 +26,10 @@ class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillDeviceClient public ShillDeviceClient::TestInterface { public: FakeShillDeviceClient(); + + FakeShillDeviceClient(const FakeShillDeviceClient&) = delete; + FakeShillDeviceClient& operator=(const FakeShillDeviceClient&) = delete; + ~FakeShillDeviceClient() override; // ShillDeviceClient overrides @@ -166,8 +170,6 @@ class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillDeviceClient // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FakeShillDeviceClient); }; } // namespace chromeos diff --git a/chromeos/dbus/shill/fake_shill_ipconfig_client.h b/chromeos/dbus/shill/fake_shill_ipconfig_client.h index 9b7df20d747014..143757019405fa 100644 --- a/chromeos/dbus/shill/fake_shill_ipconfig_client.h +++ b/chromeos/dbus/shill/fake_shill_ipconfig_client.h @@ -20,6 +20,10 @@ class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillIPConfigClient public ShillIPConfigClient::TestInterface { public: FakeShillIPConfigClient(); + + FakeShillIPConfigClient(const FakeShillIPConfigClient&) = delete; + FakeShillIPConfigClient& operator=(const FakeShillIPConfigClient&) = delete; + ~FakeShillIPConfigClient() override; // ShillIPConfigClient overrides @@ -53,8 +57,6 @@ class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillIPConfigClient // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FakeShillIPConfigClient); }; } // namespace chromeos diff --git a/chromeos/dbus/shill/fake_shill_manager_client.h b/chromeos/dbus/shill/fake_shill_manager_client.h index 0cca1ec30400eb..a3014afd3a775a 100644 --- a/chromeos/dbus/shill/fake_shill_manager_client.h +++ b/chromeos/dbus/shill/fake_shill_manager_client.h @@ -25,6 +25,10 @@ class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillManagerClient public ShillManagerClient::TestInterface { public: FakeShillManagerClient(); + + FakeShillManagerClient(const FakeShillManagerClient&) = delete; + FakeShillManagerClient& operator=(const FakeShillManagerClient&) = delete; + ~FakeShillManagerClient() override; // ShillManagerClient overrides @@ -168,8 +172,6 @@ class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillManagerClient // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FakeShillManagerClient); }; } // namespace chromeos diff --git a/chromeos/dbus/shill/fake_shill_profile_client.h b/chromeos/dbus/shill/fake_shill_profile_client.h index cdd92e73f3131a..0c0261424c35e7 100644 --- a/chromeos/dbus/shill/fake_shill_profile_client.h +++ b/chromeos/dbus/shill/fake_shill_profile_client.h @@ -22,6 +22,10 @@ class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillProfileClient public ShillProfileClient::TestInterface { public: FakeShillProfileClient(); + + FakeShillProfileClient(const FakeShillProfileClient&) = delete; + FakeShillProfileClient& operator=(const FakeShillProfileClient&) = delete; + ~FakeShillProfileClient() override; // ShillProfileClient overrides @@ -91,8 +95,6 @@ class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillProfileClient FakeShillSimulatedResult simulate_delete_result_ = FakeShillSimulatedResult::kSuccess; - - DISALLOW_COPY_AND_ASSIGN(FakeShillProfileClient); }; } // namespace chromeos diff --git a/chromeos/dbus/shill/fake_shill_service_client.h b/chromeos/dbus/shill/fake_shill_service_client.h index 120824b47c12f6..a9921db4a023e1 100644 --- a/chromeos/dbus/shill/fake_shill_service_client.h +++ b/chromeos/dbus/shill/fake_shill_service_client.h @@ -27,6 +27,10 @@ class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillServiceClient public ShillServiceClient::TestInterface { public: FakeShillServiceClient(); + + FakeShillServiceClient(const FakeShillServiceClient&) = delete; + FakeShillServiceClient& operator=(const FakeShillServiceClient&) = delete; + ~FakeShillServiceClient() override; // ShillServiceClient overrides @@ -170,8 +174,6 @@ class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillServiceClient // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FakeShillServiceClient); }; } // namespace chromeos diff --git a/chromeos/dbus/shill/fake_shill_third_party_vpn_driver_client.h b/chromeos/dbus/shill/fake_shill_third_party_vpn_driver_client.h index 287486674f18ce..d7d7f06c640bbe 100644 --- a/chromeos/dbus/shill/fake_shill_third_party_vpn_driver_client.h +++ b/chromeos/dbus/shill/fake_shill_third_party_vpn_driver_client.h @@ -26,6 +26,12 @@ class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillThirdPartyVpnDriverClient public ShillThirdPartyVpnDriverClient::TestInterface { public: FakeShillThirdPartyVpnDriverClient(); + + FakeShillThirdPartyVpnDriverClient( + const FakeShillThirdPartyVpnDriverClient&) = delete; + FakeShillThirdPartyVpnDriverClient& operator=( + const FakeShillThirdPartyVpnDriverClient&) = delete; + ~FakeShillThirdPartyVpnDriverClient() override; // ShillThirdPartyVpnDriverClient overrides @@ -58,8 +64,6 @@ class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillThirdPartyVpnDriverClient using ObserverMap = std::map; ObserverMap observer_map_; - - DISALLOW_COPY_AND_ASSIGN(FakeShillThirdPartyVpnDriverClient); }; } // namespace chromeos diff --git a/chromeos/dbus/shill/fake_sms_client.h b/chromeos/dbus/shill/fake_sms_client.h index 54a32b2bde7f9a..f5ca21afb29537 100644 --- a/chromeos/dbus/shill/fake_sms_client.h +++ b/chromeos/dbus/shill/fake_sms_client.h @@ -15,15 +15,16 @@ namespace chromeos { class FakeSMSClient : public SMSClient { public: FakeSMSClient(); + + FakeSMSClient(const FakeSMSClient&) = delete; + FakeSMSClient& operator=(const FakeSMSClient&) = delete; + ~FakeSMSClient() override; // SMSClient overrides. void GetAll(const std::string& service_name, const dbus::ObjectPath& object_path, GetAllCallback callback) override; - - private: - DISALLOW_COPY_AND_ASSIGN(FakeSMSClient); }; } // namespace chromeos diff --git a/chromeos/dbus/shill/modem_messaging_client.cc b/chromeos/dbus/shill/modem_messaging_client.cc index 7458d127abb9a0..106f91419eda09 100644 --- a/chromeos/dbus/shill/modem_messaging_client.cc +++ b/chromeos/dbus/shill/modem_messaging_client.cc @@ -45,6 +45,10 @@ class ModemMessagingProxy { base::BindOnce(&ModemMessagingProxy::OnSignalConnected, weak_ptr_factory_.GetWeakPtr())); } + + ModemMessagingProxy(const ModemMessagingProxy&) = delete; + ModemMessagingProxy& operator=(const ModemMessagingProxy&) = delete; + virtual ~ModemMessagingProxy() = default; // Sets SmsReceived signal handler. @@ -130,14 +134,16 @@ class ModemMessagingProxy { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ModemMessagingProxy); }; class COMPONENT_EXPORT(CHROMEOS_DBUS) ModemMessagingClientImpl : public ModemMessagingClient { public: explicit ModemMessagingClientImpl(dbus::Bus* bus) : bus_(bus) {} + + ModemMessagingClientImpl(const ModemMessagingClientImpl&) = delete; + ModemMessagingClientImpl& operator=(const ModemMessagingClientImpl&) = delete; + ~ModemMessagingClientImpl() override = default; void SetSmsReceivedHandler(const std::string& service_name, @@ -188,8 +194,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) ModemMessagingClientImpl dbus::Bus* bus_; ProxyMap proxies_; - - DISALLOW_COPY_AND_ASSIGN(ModemMessagingClientImpl); }; } // namespace diff --git a/chromeos/dbus/shill/shill_client_helper.h b/chromeos/dbus/shill/shill_client_helper.h index d5077c64c0312a..7b03cd0d97b7b4 100644 --- a/chromeos/dbus/shill/shill_client_helper.h +++ b/chromeos/dbus/shill/shill_client_helper.h @@ -57,6 +57,9 @@ class ShillClientHelper { explicit ShillClientHelper(dbus::ObjectProxy* proxy); + ShillClientHelper(const ShillClientHelper&) = delete; + ShillClientHelper& operator=(const ShillClientHelper&) = delete; + virtual ~ShillClientHelper(); // Sets |released_callback_|. This is optional and should only be called at @@ -160,8 +163,6 @@ class ShillClientHelper { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ShillClientHelper); }; } // namespace chromeos diff --git a/chromeos/dbus/shill/shill_device_client.cc b/chromeos/dbus/shill/shill_device_client.cc index 21813de0125f98..e0c80e5543f5e9 100644 --- a/chromeos/dbus/shill/shill_device_client.cc +++ b/chromeos/dbus/shill/shill_device_client.cc @@ -32,6 +32,9 @@ class ShillDeviceClientImpl : public ShillDeviceClient { public: explicit ShillDeviceClientImpl(dbus::Bus* bus) : bus_(bus) {} + ShillDeviceClientImpl(const ShillDeviceClientImpl&) = delete; + ShillDeviceClientImpl& operator=(const ShillDeviceClientImpl&) = delete; + ~ShillDeviceClientImpl() override { for (HelperMap::iterator iter = helpers_.begin(); iter != helpers_.end(); ++iter) { @@ -214,8 +217,6 @@ class ShillDeviceClientImpl : public ShillDeviceClient { dbus::Bus* bus_; HelperMap helpers_; - - DISALLOW_COPY_AND_ASSIGN(ShillDeviceClientImpl); }; } // namespace diff --git a/chromeos/dbus/shill/shill_ipconfig_client.cc b/chromeos/dbus/shill/shill_ipconfig_client.cc index 4b20809f88b3d3..d18f48124573a2 100644 --- a/chromeos/dbus/shill/shill_ipconfig_client.cc +++ b/chromeos/dbus/shill/shill_ipconfig_client.cc @@ -31,6 +31,10 @@ ShillIPConfigClient* g_instance = nullptr; class ShillIPConfigClientImpl : public ShillIPConfigClient { public: explicit ShillIPConfigClientImpl(dbus::Bus* bus) : bus_(bus) {} + + ShillIPConfigClientImpl(const ShillIPConfigClientImpl&) = delete; + ShillIPConfigClientImpl& operator=(const ShillIPConfigClientImpl&) = delete; + ~ShillIPConfigClientImpl() override = default; //////////////////////////////////// @@ -81,8 +85,6 @@ class ShillIPConfigClientImpl : public ShillIPConfigClient { dbus::Bus* bus_; HelperMap helpers_; - - DISALLOW_COPY_AND_ASSIGN(ShillIPConfigClientImpl); }; void ShillIPConfigClientImpl::GetProperties( diff --git a/chromeos/dbus/shill/shill_manager_client.cc b/chromeos/dbus/shill/shill_manager_client.cc index 96b84e089453f1..e58aacd0a85c1c 100644 --- a/chromeos/dbus/shill/shill_manager_client.cc +++ b/chromeos/dbus/shill/shill_manager_client.cc @@ -31,6 +31,10 @@ ShillManagerClient* g_instance = nullptr; class ShillManagerClientImpl : public ShillManagerClient { public: ShillManagerClientImpl() = default; + + ShillManagerClientImpl(const ShillManagerClientImpl&) = delete; + ShillManagerClientImpl& operator=(const ShillManagerClientImpl&) = delete; + ~ShillManagerClientImpl() override = default; //////////////////////////////////// @@ -197,8 +201,6 @@ class ShillManagerClientImpl : public ShillManagerClient { dbus::ObjectProxy* proxy_ = nullptr; std::unique_ptr helper_; - - DISALLOW_COPY_AND_ASSIGN(ShillManagerClientImpl); }; } // namespace diff --git a/chromeos/dbus/shill/shill_profile_client.cc b/chromeos/dbus/shill/shill_profile_client.cc index 05d7b3112fccd0..b42a178997c4ef 100644 --- a/chromeos/dbus/shill/shill_profile_client.cc +++ b/chromeos/dbus/shill/shill_profile_client.cc @@ -30,6 +30,10 @@ ShillProfileClient* g_instance = nullptr; class ShillProfileClientImpl : public ShillProfileClient { public: explicit ShillProfileClientImpl(dbus::Bus* bus) : bus_(bus) {} + + ShillProfileClientImpl(const ShillProfileClientImpl&) = delete; + ShillProfileClientImpl& operator=(const ShillProfileClientImpl&) = delete; + ~ShillProfileClientImpl() override = default; void AddPropertyChangedObserver( @@ -76,8 +80,6 @@ class ShillProfileClientImpl : public ShillProfileClient { dbus::Bus* bus_; HelperMap helpers_; - - DISALLOW_COPY_AND_ASSIGN(ShillProfileClientImpl); }; ShillClientHelper* ShillProfileClientImpl::GetHelper( diff --git a/chromeos/dbus/shill/shill_service_client.cc b/chromeos/dbus/shill/shill_service_client.cc index e479c271a30dc6..65f0c62a847677 100644 --- a/chromeos/dbus/shill/shill_service_client.cc +++ b/chromeos/dbus/shill/shill_service_client.cc @@ -57,6 +57,9 @@ class ShillServiceClientImpl : public ShillServiceClient { public: explicit ShillServiceClientImpl(dbus::Bus* bus) : bus_(bus) {} + ShillServiceClientImpl(const ShillServiceClientImpl&) = delete; + ShillServiceClientImpl& operator=(const ShillServiceClientImpl&) = delete; + ~ShillServiceClientImpl() override { for (HelperMap::iterator iter = helpers_.begin(); iter != helpers_.end(); ++iter) { @@ -302,8 +305,6 @@ class ShillServiceClientImpl : public ShillServiceClient { dbus::Bus* bus_; HelperMap helpers_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ShillServiceClientImpl); }; } // namespace diff --git a/chromeos/dbus/shill/shill_third_party_vpn_driver_client.cc b/chromeos/dbus/shill/shill_third_party_vpn_driver_client.cc index 23d79e366c3bf0..154d562b7e6f94 100644 --- a/chromeos/dbus/shill/shill_third_party_vpn_driver_client.cc +++ b/chromeos/dbus/shill/shill_third_party_vpn_driver_client.cc @@ -44,6 +44,12 @@ class ShillThirdPartyVpnDriverClientImpl : public ShillThirdPartyVpnDriverClient { public: explicit ShillThirdPartyVpnDriverClientImpl(dbus::Bus* bus); + + ShillThirdPartyVpnDriverClientImpl( + const ShillThirdPartyVpnDriverClientImpl&) = delete; + ShillThirdPartyVpnDriverClientImpl& operator=( + const ShillThirdPartyVpnDriverClientImpl&) = delete; + ~ShillThirdPartyVpnDriverClientImpl() override; // ShillThirdPartyVpnDriverClient overrides @@ -121,8 +127,6 @@ class ShillThirdPartyVpnDriverClientImpl dbus::Bus* bus_; HelperMap helpers_; std::set valid_keys_; - - DISALLOW_COPY_AND_ASSIGN(ShillThirdPartyVpnDriverClientImpl); }; ShillThirdPartyVpnDriverClientImpl::HelperInfo::HelperInfo( diff --git a/chromeos/dbus/shill/sms_client.cc b/chromeos/dbus/shill/sms_client.cc index 4654098d955d95..8dcf9de9675ab0 100644 --- a/chromeos/dbus/shill/sms_client.cc +++ b/chromeos/dbus/shill/sms_client.cc @@ -45,6 +45,9 @@ class SMSReceiveHandler { property_set_->Get(&state_, dbus::PropertySet::GetCallback()); } + SMSReceiveHandler(const SMSReceiveHandler&) = delete; + SMSReceiveHandler& operator=(const SMSReceiveHandler&) = delete; + ~SMSReceiveHandler() = default; private: @@ -91,8 +94,6 @@ class SMSReceiveHandler { dbus::Property timestamp_; std::unique_ptr property_set_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(SMSReceiveHandler); }; // SMSClient is used to communicate with the @@ -102,6 +103,10 @@ class SMSReceiveHandler { class SMSClientImpl : public SMSClient { public: explicit SMSClientImpl(dbus::Bus* bus) : bus_(bus) {} + + SMSClientImpl(const SMSClientImpl&) = delete; + SMSClientImpl& operator=(const SMSClientImpl&) = delete; + ~SMSClientImpl() override = default; // Calls GetAll method. |callback| is called after the method call succeeds. @@ -131,8 +136,6 @@ class SMSClientImpl : public SMSClient { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(SMSClientImpl); }; } // namespace diff --git a/chromeos/dbus/smbprovider/fake_smb_provider_client.h b/chromeos/dbus/smbprovider/fake_smb_provider_client.h index c85d223e34616b..42d5a4348f684e 100644 --- a/chromeos/dbus/smbprovider/fake_smb_provider_client.h +++ b/chromeos/dbus/smbprovider/fake_smb_provider_client.h @@ -21,6 +21,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_SMBPROVIDER) FakeSmbProviderClient public: FakeSmbProviderClient(); explicit FakeSmbProviderClient(bool should_run_synchronously); + + FakeSmbProviderClient(const FakeSmbProviderClient&) = delete; + FakeSmbProviderClient& operator=(const FakeSmbProviderClient&) = delete; + ~FakeSmbProviderClient() override; // Adds an entry in the |netbios_parse_results_| map for shares_; - - DISALLOW_COPY_AND_ASSIGN(FakeSmbProviderClient); }; } // namespace chromeos diff --git a/chromeos/dbus/smbprovider/smb_provider_client.cc b/chromeos/dbus/smbprovider/smb_provider_client.cc index f4d4ee0e58573b..b1a27f5324a0c0 100644 --- a/chromeos/dbus/smbprovider/smb_provider_client.cc +++ b/chromeos/dbus/smbprovider/smb_provider_client.cc @@ -53,6 +53,9 @@ class SmbProviderClientImpl : public SmbProviderClient { public: SmbProviderClientImpl() = default; + SmbProviderClientImpl(const SmbProviderClientImpl&) = delete; + SmbProviderClientImpl& operator=(const SmbProviderClientImpl&) = delete; + ~SmbProviderClientImpl() override {} void GetShares(const base::FilePath& server_url, @@ -218,8 +221,6 @@ class SmbProviderClientImpl : public SmbProviderClient { } dbus::ObjectProxy* proxy_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(SmbProviderClientImpl); }; } // namespace diff --git a/chromeos/dbus/smbprovider/smb_provider_client.h b/chromeos/dbus/smbprovider/smb_provider_client.h index 232fe430d3418d..faf45175a0d601 100644 --- a/chromeos/dbus/smbprovider/smb_provider_client.h +++ b/chromeos/dbus/smbprovider/smb_provider_client.h @@ -36,6 +36,9 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_SMBPROVIDER) SmbProviderClient using ParseNetBiosPacketCallback = base::OnceCallback&)>; + SmbProviderClient(const SmbProviderClient&) = delete; + SmbProviderClient& operator=(const SmbProviderClient&) = delete; + ~SmbProviderClient() override; // Factory function, creates a new instance and returns ownership. @@ -65,9 +68,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_SMBPROVIDER) SmbProviderClient protected: // Create() should be used instead. SmbProviderClient(); - - private: - DISALLOW_COPY_AND_ASSIGN(SmbProviderClient); }; } // namespace chromeos diff --git a/chromeos/dbus/system_clock/fake_system_clock_client.h b/chromeos/dbus/system_clock/fake_system_clock_client.h index c14615d2d326b5..d1a203825c91fc 100644 --- a/chromeos/dbus/system_clock/fake_system_clock_client.h +++ b/chromeos/dbus/system_clock/fake_system_clock_client.h @@ -21,6 +21,10 @@ class COMPONENT_EXPORT(SYSTEM_CLOCK) FakeSystemClockClient public SystemClockClient::TestInterface { public: FakeSystemClockClient(); + + FakeSystemClockClient(const FakeSystemClockClient&) = delete; + FakeSystemClockClient& operator=(const FakeSystemClockClient&) = delete; + ~FakeSystemClockClient() override; // TestInterface @@ -46,8 +50,6 @@ class COMPONENT_EXPORT(SYSTEM_CLOCK) FakeSystemClockClient std::vector callbacks_; base::ObserverList::Unchecked observers_; - - DISALLOW_COPY_AND_ASSIGN(FakeSystemClockClient); }; } // namespace chromeos diff --git a/chromeos/dbus/system_clock/system_clock_client.cc b/chromeos/dbus/system_clock/system_clock_client.cc index f7b4772a896ca6..42293b8220eb7b 100644 --- a/chromeos/dbus/system_clock/system_clock_client.cc +++ b/chromeos/dbus/system_clock/system_clock_client.cc @@ -57,6 +57,9 @@ class SystemClockClientImpl : public SystemClockClient { InitDBus(bus); } + SystemClockClientImpl(const SystemClockClientImpl&) = delete; + SystemClockClientImpl& operator=(const SystemClockClientImpl&) = delete; + ~SystemClockClientImpl() override = default; void AddObserver(Observer* observer) override { @@ -187,8 +190,6 @@ class SystemClockClientImpl : public SystemClockClient { base::ObserverList::Unchecked observers_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(SystemClockClientImpl); }; SystemClockClient::SystemClockClient() { diff --git a/chromeos/dbus/update_engine/fake_update_engine_client.h b/chromeos/dbus/update_engine/fake_update_engine_client.h index b5277f896c769f..b15ed35b27a5cf 100644 --- a/chromeos/dbus/update_engine/fake_update_engine_client.h +++ b/chromeos/dbus/update_engine/fake_update_engine_client.h @@ -23,6 +23,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_UPDATE_ENGINE) FakeUpdateEngineClient : public UpdateEngineClient { public: FakeUpdateEngineClient(); + + FakeUpdateEngineClient(const FakeUpdateEngineClient&) = delete; + FakeUpdateEngineClient& operator=(const FakeUpdateEngineClient&) = delete; + ~FakeUpdateEngineClient() override; // UpdateEngineClient overrides @@ -115,8 +119,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_UPDATE_ENGINE) FakeUpdateEngineClient int update_over_cellular_permission_count_ = 0; int update_over_cellular_one_time_permission_count_ = 0; base::Time eol_date_; - - DISALLOW_COPY_AND_ASSIGN(FakeUpdateEngineClient); }; } // namespace chromeos diff --git a/chromeos/dbus/update_engine/update_engine_client.cc b/chromeos/dbus/update_engine/update_engine_client.cc index 5ba441b7de50ab..bcf9e682d1c989 100644 --- a/chromeos/dbus/update_engine/update_engine_client.cc +++ b/chromeos/dbus/update_engine/update_engine_client.cc @@ -67,6 +67,9 @@ class UpdateEngineClientImpl : public UpdateEngineClient { public: UpdateEngineClientImpl() : update_engine_proxy_(nullptr), last_status_() {} + UpdateEngineClientImpl(const UpdateEngineClientImpl&) = delete; + UpdateEngineClientImpl& operator=(const UpdateEngineClientImpl&) = delete; + ~UpdateEngineClientImpl() override = default; // UpdateEngineClient implementation: @@ -505,8 +508,6 @@ class UpdateEngineClientImpl : public UpdateEngineClient { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(UpdateEngineClientImpl); }; // The UpdateEngineClient implementation used on Linux desktop, diff --git a/chromeos/dbus/update_engine/update_engine_client.h b/chromeos/dbus/update_engine/update_engine_client.h index e27239568e2bd3..a164355cdae849 100644 --- a/chromeos/dbus/update_engine/update_engine_client.h +++ b/chromeos/dbus/update_engine/update_engine_client.h @@ -56,6 +56,9 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_UPDATE_ENGINE) UpdateEngineClient virtual void OnUpdateOverCellularOneTimePermissionGranted() {} }; + UpdateEngineClient(const UpdateEngineClient&) = delete; + UpdateEngineClient& operator=(const UpdateEngineClient&) = delete; + ~UpdateEngineClient() override; // Adds and removes the observer. @@ -165,9 +168,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_UPDATE_ENGINE) UpdateEngineClient protected: // Create() should be used instead. UpdateEngineClient(); - - private: - DISALLOW_COPY_AND_ASSIGN(UpdateEngineClient); }; } // namespace chromeos diff --git a/chromeos/dbus/upstart/fake_upstart_client.h b/chromeos/dbus/upstart/fake_upstart_client.h index 68b5a91177d61d..01d87a95b5055e 100644 --- a/chromeos/dbus/upstart/fake_upstart_client.h +++ b/chromeos/dbus/upstart/fake_upstart_client.h @@ -20,6 +20,10 @@ class COMPONENT_EXPORT(UPSTART_CLIENT) FakeUpstartClient const std::vector& upstart_env)>; FakeUpstartClient(); + + FakeUpstartClient(const FakeUpstartClient&) = delete; + FakeUpstartClient& operator=(const FakeUpstartClient&) = delete; + ~FakeUpstartClient() override; // Returns the fake global instance if initialized. May return null. @@ -54,8 +58,6 @@ class COMPONENT_EXPORT(UPSTART_CLIENT) FakeUpstartClient // callbacks decide the result StartJob() or StopJob() returns. StartStopJobCallback start_job_cb_; StartStopJobCallback stop_job_cb_; - - DISALLOW_COPY_AND_ASSIGN(FakeUpstartClient); }; } // namespace chromeos diff --git a/chromeos/dbus/upstart/upstart_client.cc b/chromeos/dbus/upstart/upstart_client.cc index dfc3155ad0ff87..90c03a2eeb8a76 100644 --- a/chromeos/dbus/upstart/upstart_client.cc +++ b/chromeos/dbus/upstart/upstart_client.cc @@ -44,6 +44,9 @@ class UpstartClientImpl : public UpstartClient { public: explicit UpstartClientImpl(dbus::Bus* bus) : bus_(bus) {} + UpstartClientImpl(const UpstartClientImpl&) = delete; + UpstartClientImpl& operator=(const UpstartClientImpl&) = delete; + ~UpstartClientImpl() override = default; // UpstartClient overrides: @@ -137,8 +140,6 @@ class UpstartClientImpl : public UpstartClient { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(UpstartClientImpl); }; } // namespace diff --git a/chromeos/dbus/upstart/upstart_client.h b/chromeos/dbus/upstart/upstart_client.h index 26a8a5f82246ad..16c2360e3ed87a 100644 --- a/chromeos/dbus/upstart/upstart_client.h +++ b/chromeos/dbus/upstart/upstart_client.h @@ -24,6 +24,9 @@ namespace chromeos { // initializes the DBusThreadManager instance. class COMPONENT_EXPORT(UPSTART_CLIENT) UpstartClient { public: + UpstartClient(const UpstartClient&) = delete; + UpstartClient& operator=(const UpstartClient&) = delete; + virtual ~UpstartClient(); // Creates and initializes the global instance. |bus| must not be null. @@ -100,9 +103,6 @@ class COMPONENT_EXPORT(UPSTART_CLIENT) UpstartClient { protected: // Initialize() should be used instead. UpstartClient(); - - private: - DISALLOW_COPY_AND_ASSIGN(UpstartClient); }; } // namespace chromeos diff --git a/chromeos/dbus/usb/fake_usbguard_client.h b/chromeos/dbus/usb/fake_usbguard_client.h index 0c447256ca6ac5..ddb4589e6d9ee1 100644 --- a/chromeos/dbus/usb/fake_usbguard_client.h +++ b/chromeos/dbus/usb/fake_usbguard_client.h @@ -19,6 +19,10 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) FakeUsbguardClient : public UsbguardClient { public: FakeUsbguardClient(); + + FakeUsbguardClient(const FakeUsbguardClient&) = delete; + FakeUsbguardClient& operator=(const FakeUsbguardClient&) = delete; + ~FakeUsbguardClient() override; // Returns the global instance if initialized. May return null. @@ -40,8 +44,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) FakeUsbguardClient private: base::ObserverList observers_; - - DISALLOW_COPY_AND_ASSIGN(FakeUsbguardClient); }; } // namespace chromeos diff --git a/chromeos/dbus/usb/usbguard_client.cc b/chromeos/dbus/usb/usbguard_client.cc index bf03b8f39bcc1e..4dd176dee4da21 100644 --- a/chromeos/dbus/usb/usbguard_client.cc +++ b/chromeos/dbus/usb/usbguard_client.cc @@ -26,6 +26,10 @@ UsbguardClient* g_instance = nullptr; class UsbguardClientImpl : public UsbguardClient { public: UsbguardClientImpl() = default; + + UsbguardClientImpl(const UsbguardClientImpl&) = delete; + UsbguardClientImpl& operator=(const UsbguardClientImpl&) = delete; + ~UsbguardClientImpl() override = default; // UsbguardClient: @@ -118,8 +122,6 @@ class UsbguardClientImpl : public UsbguardClient { // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(UsbguardClientImpl); }; UsbguardClient::UsbguardClient() { diff --git a/chromeos/dbus/usb/usbguard_client.h b/chromeos/dbus/usb/usbguard_client.h index 145670db64627b..7f231c934edf28 100644 --- a/chromeos/dbus/usb/usbguard_client.h +++ b/chromeos/dbus/usb/usbguard_client.h @@ -17,6 +17,9 @@ namespace chromeos { class COMPONENT_EXPORT(CHROMEOS_DBUS) UsbguardClient { public: + UsbguardClient(const UsbguardClient&) = delete; + UsbguardClient& operator=(const UsbguardClient&) = delete; + virtual ~UsbguardClient(); // Creates and initializes the global instance. |bus| must not be null. @@ -41,9 +44,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) UsbguardClient { protected: // Initialize/Shutdown should be used instead. UsbguardClient(); - - private: - DISALLOW_COPY_AND_ASSIGN(UsbguardClient); }; } // namespace chromeos diff --git a/chromeos/dbus/virtual_file_provider/fake_virtual_file_provider_client.h b/chromeos/dbus/virtual_file_provider/fake_virtual_file_provider_client.h index 7bd48cbf1bfdc5..ac5cb31717c924 100644 --- a/chromeos/dbus/virtual_file_provider/fake_virtual_file_provider_client.h +++ b/chromeos/dbus/virtual_file_provider/fake_virtual_file_provider_client.h @@ -18,6 +18,11 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_VIRTUAL_FILE_PROVIDER) FakeVirtualFileProviderClient : public VirtualFileProviderClient { public: FakeVirtualFileProviderClient(); + + FakeVirtualFileProviderClient(const FakeVirtualFileProviderClient&) = delete; + FakeVirtualFileProviderClient& operator=( + const FakeVirtualFileProviderClient&) = delete; + ~FakeVirtualFileProviderClient() override; // DBusClient override. @@ -37,8 +42,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_VIRTUAL_FILE_PROVIDER) int64_t expected_size_ = 0; // Expectation for GenerateVirtualFileId. std::string result_id_; // Returned by GenerateVirtualFileId. base::ScopedFD result_fd_; // Returned by OpenFileById. - - DISALLOW_COPY_AND_ASSIGN(FakeVirtualFileProviderClient); }; } // namespace chromeos diff --git a/chromeos/dbus/virtual_file_provider/virtual_file_provider_client.cc b/chromeos/dbus/virtual_file_provider/virtual_file_provider_client.cc index 171a1b20f71b82..ccf58fabbb3b5c 100644 --- a/chromeos/dbus/virtual_file_provider/virtual_file_provider_client.cc +++ b/chromeos/dbus/virtual_file_provider/virtual_file_provider_client.cc @@ -22,6 +22,11 @@ namespace { class VirtualFileProviderClientImpl : public VirtualFileProviderClient { public: VirtualFileProviderClientImpl() {} + + VirtualFileProviderClientImpl(const VirtualFileProviderClientImpl&) = delete; + VirtualFileProviderClientImpl& operator=( + const VirtualFileProviderClientImpl&) = delete; + ~VirtualFileProviderClientImpl() override = default; // VirtualFileProviderClient override: @@ -96,8 +101,6 @@ class VirtualFileProviderClientImpl : public VirtualFileProviderClient { dbus::ObjectProxy* proxy_ = nullptr; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(VirtualFileProviderClientImpl); }; } // namespace diff --git a/chromeos/dbus/vm_plugin_dispatcher/fake_vm_plugin_dispatcher_client.h b/chromeos/dbus/vm_plugin_dispatcher/fake_vm_plugin_dispatcher_client.h index 48863e75eafd5e..3da576459a7b27 100644 --- a/chromeos/dbus/vm_plugin_dispatcher/fake_vm_plugin_dispatcher_client.h +++ b/chromeos/dbus/vm_plugin_dispatcher/fake_vm_plugin_dispatcher_client.h @@ -16,6 +16,11 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_VM_PLUGIN_DISPATCHER) FakeVmPluginDispatcherClient : public VmPluginDispatcherClient { public: FakeVmPluginDispatcherClient(); + + FakeVmPluginDispatcherClient(const FakeVmPluginDispatcherClient&) = delete; + FakeVmPluginDispatcherClient& operator=(const FakeVmPluginDispatcherClient&) = + delete; + ~FakeVmPluginDispatcherClient() override; void AddObserver(Observer* observer) override; @@ -84,8 +89,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS_VM_PLUGIN_DISPATCHER) vm_tools::plugin_dispatcher::ListVmResponse list_vms_response_; base::ObserverList observer_list_; - - DISALLOW_COPY_AND_ASSIGN(FakeVmPluginDispatcherClient); }; } // namespace chromeos diff --git a/chromeos/dbus/vm_plugin_dispatcher/vm_plugin_dispatcher_client.cc b/chromeos/dbus/vm_plugin_dispatcher/vm_plugin_dispatcher_client.cc index 962063dfa44032..2bc1ab3322abba 100644 --- a/chromeos/dbus/vm_plugin_dispatcher/vm_plugin_dispatcher_client.cc +++ b/chromeos/dbus/vm_plugin_dispatcher/vm_plugin_dispatcher_client.cc @@ -25,6 +25,10 @@ class VmPluginDispatcherClientImpl : public VmPluginDispatcherClient { public: VmPluginDispatcherClientImpl() {} + VmPluginDispatcherClientImpl(const VmPluginDispatcherClientImpl&) = delete; + VmPluginDispatcherClientImpl& operator=(const VmPluginDispatcherClientImpl&) = + delete; + ~VmPluginDispatcherClientImpl() override = default; void AddObserver(Observer* observer) override { @@ -186,8 +190,6 @@ class VmPluginDispatcherClientImpl : public VmPluginDispatcherClient { base::ObserverList observer_list_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(VmPluginDispatcherClientImpl); }; VmPluginDispatcherClient::VmPluginDispatcherClient() = default; diff --git a/chromeos/disks/disk.h b/chromeos/disks/disk.h index eba17faca0fb64..5d3cb2a890a24d 100644 --- a/chromeos/disks/disk.h +++ b/chromeos/disks/disk.h @@ -180,6 +180,10 @@ class COMPONENT_EXPORT(CHROMEOS_DISKS) Disk { class COMPONENT_EXPORT(CHROMEOS_DISKS) Disk::Builder { public: Builder(); + + Builder(const Builder&) = delete; + Builder& operator=(const Builder&) = delete; + ~Builder(); Builder& SetDevicePath(const std::string& device_path); @@ -212,8 +216,6 @@ class COMPONENT_EXPORT(CHROMEOS_DISKS) Disk::Builder { private: std::unique_ptr disk_; - - DISALLOW_COPY_AND_ASSIGN(Builder); }; COMPONENT_EXPORT(CHROMEOS_DISKS) base::FilePath GetStatefulPartitionPath(); diff --git a/chromeos/disks/disk_mount_manager.cc b/chromeos/disks/disk_mount_manager.cc index 3efaa056affe8b..8a7e4ef0b240b7 100644 --- a/chromeos/disks/disk_mount_manager.cc +++ b/chromeos/disks/disk_mount_manager.cc @@ -78,6 +78,9 @@ class DiskMountManagerImpl : public DiskMountManager, cros_disks_client_->AddObserver(this); } + DiskMountManagerImpl(const DiskMountManagerImpl&) = delete; + DiskMountManagerImpl& operator=(const DiskMountManagerImpl&) = delete; + ~DiskMountManagerImpl() override { cros_disks_client_->RemoveObserver(this); } // DiskMountManager override. @@ -1065,8 +1068,6 @@ class DiskMountManagerImpl : public DiskMountManager, AccessModeMap access_modes_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(DiskMountManagerImpl); }; } // namespace diff --git a/chromeos/disks/mock_disk_mount_manager.h b/chromeos/disks/mock_disk_mount_manager.h index a4b4daf112db39..0e977d41dbecec 100644 --- a/chromeos/disks/mock_disk_mount_manager.h +++ b/chromeos/disks/mock_disk_mount_manager.h @@ -24,6 +24,10 @@ namespace disks { class MockDiskMountManager : public DiskMountManager { public: MockDiskMountManager(); + + MockDiskMountManager(const MockDiskMountManager&) = delete; + MockDiskMountManager& operator=(const MockDiskMountManager&) = delete; + virtual ~MockDiskMountManager(); // DiskMountManager override. @@ -128,8 +132,6 @@ class MockDiskMountManager : public DiskMountManager { // The list of existing mount points. DiskMountManager::MountPointMap mount_points_; - - DISALLOW_COPY_AND_ASSIGN(MockDiskMountManager); }; } // namespace disks diff --git a/chromeos/disks/suspend_unmount_manager.h b/chromeos/disks/suspend_unmount_manager.h index 3298b91dd24131..d1bc074c4d752f 100644 --- a/chromeos/disks/suspend_unmount_manager.h +++ b/chromeos/disks/suspend_unmount_manager.h @@ -26,6 +26,10 @@ class COMPONENT_EXPORT(CHROMEOS_DISKS) SuspendUnmountManager public: // The ownership of these raw pointers still remains with the caller. explicit SuspendUnmountManager(DiskMountManager* disk_mount_manager); + + SuspendUnmountManager(const SuspendUnmountManager&) = delete; + SuspendUnmountManager& operator=(const SuspendUnmountManager&) = delete; + ~SuspendUnmountManager() override; private: @@ -46,8 +50,6 @@ class COMPONENT_EXPORT(CHROMEOS_DISKS) SuspendUnmountManager base::TimeTicks block_suspend_time_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(SuspendUnmountManager); }; } // namespace disks diff --git a/chromeos/disks/suspend_unmount_manager_unittest.cc b/chromeos/disks/suspend_unmount_manager_unittest.cc index 9aac18c58b1aaa..433b9a844e2609 100644 --- a/chromeos/disks/suspend_unmount_manager_unittest.cc +++ b/chromeos/disks/suspend_unmount_manager_unittest.cc @@ -54,6 +54,10 @@ class SuspendUnmountManagerTest : public testing::Test { std::make_unique(&disk_mount_manager_); } + SuspendUnmountManagerTest(const SuspendUnmountManagerTest&) = delete; + SuspendUnmountManagerTest& operator=(const SuspendUnmountManagerTest&) = + delete; + ~SuspendUnmountManagerTest() override { suspend_unmount_manager_.reset(); PowerManagerClient::Shutdown(); @@ -62,9 +66,6 @@ class SuspendUnmountManagerTest : public testing::Test { protected: FakeDiskMountManager disk_mount_manager_; std::unique_ptr suspend_unmount_manager_; - - private: - DISALLOW_COPY_AND_ASSIGN(SuspendUnmountManagerTest); }; TEST_F(SuspendUnmountManagerTest, Basic) { diff --git a/chromeos/geolocation/simple_geolocation_provider.h b/chromeos/geolocation/simple_geolocation_provider.h index 160647cc6440c1..3860747e95f539 100644 --- a/chromeos/geolocation/simple_geolocation_provider.h +++ b/chromeos/geolocation/simple_geolocation_provider.h @@ -36,6 +36,11 @@ class COMPONENT_EXPORT(CHROMEOS_GEOLOCATION) SimpleGeolocationProvider { SimpleGeolocationProvider( scoped_refptr factory, const GURL& url); + + SimpleGeolocationProvider(const SimpleGeolocationProvider&) = delete; + SimpleGeolocationProvider& operator=(const SimpleGeolocationProvider&) = + delete; + virtual ~SimpleGeolocationProvider(); // Initiates new request. If |send_wifi_access_points|, WiFi AP information @@ -81,8 +86,6 @@ class COMPONENT_EXPORT(CHROMEOS_GEOLOCATION) SimpleGeolocationProvider { // Creation and destruction should happen on the same thread. base::ThreadChecker thread_checker_; - - DISALLOW_COPY_AND_ASSIGN(SimpleGeolocationProvider); }; } // namespace chromeos diff --git a/chromeos/geolocation/simple_geolocation_request.h b/chromeos/geolocation/simple_geolocation_request.h index abce4b55daab94..b536e632b1d26b 100644 --- a/chromeos/geolocation/simple_geolocation_request.h +++ b/chromeos/geolocation/simple_geolocation_request.h @@ -59,6 +59,9 @@ class COMPONENT_EXPORT(CHROMEOS_GEOLOCATION) SimpleGeolocationRequest { std::unique_ptr wifi_data, std::unique_ptr cell_tower_data); + SimpleGeolocationRequest(const SimpleGeolocationRequest&) = delete; + SimpleGeolocationRequest& operator=(const SimpleGeolocationRequest&) = delete; + ~SimpleGeolocationRequest(); // Initiates request. @@ -137,8 +140,6 @@ class COMPONENT_EXPORT(CHROMEOS_GEOLOCATION) SimpleGeolocationRequest { // Creation and destruction should happen on the same thread. base::ThreadChecker thread_checker_; - - DISALLOW_COPY_AND_ASSIGN(SimpleGeolocationRequest); }; } // namespace chromeos diff --git a/chromeos/geolocation/simple_geolocation_request_test_monitor.h b/chromeos/geolocation/simple_geolocation_request_test_monitor.h index cd4c58939ca17a..f92a9b73e04ac5 100644 --- a/chromeos/geolocation/simple_geolocation_request_test_monitor.h +++ b/chromeos/geolocation/simple_geolocation_request_test_monitor.h @@ -21,12 +21,14 @@ class COMPONENT_EXPORT(CHROMEOS_GEOLOCATION) public: SimpleGeolocationRequestTestMonitor(); + SimpleGeolocationRequestTestMonitor( + const SimpleGeolocationRequestTestMonitor&) = delete; + SimpleGeolocationRequestTestMonitor& operator=( + const SimpleGeolocationRequestTestMonitor&) = delete; + virtual ~SimpleGeolocationRequestTestMonitor(); virtual void OnRequestCreated(SimpleGeolocationRequest* request); virtual void OnStart(SimpleGeolocationRequest* request); - - private: - DISALLOW_COPY_AND_ASSIGN(SimpleGeolocationRequestTestMonitor); }; } // namespace chromeos diff --git a/chromeos/geolocation/simple_geolocation_unittest.cc b/chromeos/geolocation/simple_geolocation_unittest.cc index 334f71140dfced..5c9ae9d0367c74 100644 --- a/chromeos/geolocation/simple_geolocation_unittest.cc +++ b/chromeos/geolocation/simple_geolocation_unittest.cc @@ -311,6 +311,10 @@ class SimpleGeolocationWirelessTest : public ::testing::TestWithParam { public: SimpleGeolocationWirelessTest() : manager_test_(nullptr) {} + SimpleGeolocationWirelessTest(const SimpleGeolocationWirelessTest&) = delete; + SimpleGeolocationWirelessTest& operator=( + const SimpleGeolocationWirelessTest&) = delete; + ~SimpleGeolocationWirelessTest() override = default; void SetUp() override { @@ -375,9 +379,6 @@ class SimpleGeolocationWirelessTest : public ::testing::TestWithParam { ShillManagerClient::TestInterface* manager_test_; WifiAccessPointVector wifi_access_points_; CellTowerVector cell_towers_; - - private: - DISALLOW_COPY_AND_ASSIGN(SimpleGeolocationWirelessTest); }; // Parameter is enable/disable sending of WiFi data. diff --git a/chromeos/login/auth/auth_attempt_state.h b/chromeos/login/auth/auth_attempt_state.h index 05688bf380a202..99bdf220e124b8 100644 --- a/chromeos/login/auth/auth_attempt_state.h +++ b/chromeos/login/auth/auth_attempt_state.h @@ -25,6 +25,9 @@ class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) AuthAttemptState // Used to initialize for a login attempt. AuthAttemptState(const UserContext& user_context, bool unlock); + AuthAttemptState(const AuthAttemptState&) = delete; + AuthAttemptState& operator=(const AuthAttemptState&) = delete; + virtual ~AuthAttemptState(); // Deprecated legacy method, will be removed soon. @@ -87,8 +90,6 @@ class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) AuthAttemptState // After the username hash request is completed, this marks whether // the request was successful. bool username_hash_valid_ = true; - - DISALLOW_COPY_AND_ASSIGN(AuthAttemptState); }; } // namespace chromeos diff --git a/chromeos/login/auth/login_event_recorder.h b/chromeos/login/auth/login_event_recorder.h index 02c220df58189e..1bdbf79f983e9c 100644 --- a/chromeos/login/auth/login_event_recorder.h +++ b/chromeos/login/auth/login_event_recorder.h @@ -30,6 +30,10 @@ class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) LoginEventRecorder { virtual void RecordAuthenticationFailure() = 0; }; LoginEventRecorder(); + + LoginEventRecorder(const LoginEventRecorder&) = delete; + LoginEventRecorder& operator=(const LoginEventRecorder&) = delete; + virtual ~LoginEventRecorder(); static LoginEventRecorder* Get(); @@ -50,8 +54,6 @@ class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) LoginEventRecorder { private: Delegate* delegate_; - - DISALLOW_COPY_AND_ASSIGN(LoginEventRecorder); }; } // namespace chromeos diff --git a/chromeos/login/auth/login_performer.h b/chromeos/login/auth/login_performer.h index b6d41cada92fdf..20ded953be07b1 100644 --- a/chromeos/login/auth/login_performer.h +++ b/chromeos/login/auth/login_performer.h @@ -62,6 +62,10 @@ class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) LoginPerformer LoginPerformer(scoped_refptr task_runner, Delegate* delegate); + + LoginPerformer(const LoginPerformer&) = delete; + LoginPerformer& operator=(const LoginPerformer&) = delete; + ~LoginPerformer() override; // Performs a login for |user_context|. @@ -207,7 +211,6 @@ class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) LoginPerformer AuthorizationMode auth_mode_ = AuthorizationMode::kInternal; base::WeakPtrFactory weak_factory_{this}; - DISALLOW_COPY_AND_ASSIGN(LoginPerformer); }; } // namespace chromeos diff --git a/chromeos/login/auth/stub_authenticator_builder.h b/chromeos/login/auth/stub_authenticator_builder.h index a9a6a94cc0a2fe..4d42da9b90c198 100644 --- a/chromeos/login/auth/stub_authenticator_builder.h +++ b/chromeos/login/auth/stub_authenticator_builder.h @@ -22,6 +22,10 @@ namespace chromeos { class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) StubAuthenticatorBuilder { public: explicit StubAuthenticatorBuilder(const UserContext& expected_user_context); + + StubAuthenticatorBuilder(const StubAuthenticatorBuilder&) = delete; + StubAuthenticatorBuilder& operator=(const StubAuthenticatorBuilder&) = delete; + ~StubAuthenticatorBuilder(); scoped_refptr Create(AuthStatusConsumer* consumer); @@ -65,8 +69,6 @@ class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) StubAuthenticatorBuilder { // For kAuthFailure action - the failure reason. AuthFailure::FailureReason failure_reason_ = AuthFailure::NONE; - - DISALLOW_COPY_AND_ASSIGN(StubAuthenticatorBuilder); }; } // namespace chromeos diff --git a/chromeos/login/auth/test_attempt_state.h b/chromeos/login/auth/test_attempt_state.h index b515985e00c913..c87acb00a6faca 100644 --- a/chromeos/login/auth/test_attempt_state.h +++ b/chromeos/login/auth/test_attempt_state.h @@ -21,6 +21,9 @@ class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) TestAttemptState public: explicit TestAttemptState(const UserContext& credentials); + TestAttemptState(const TestAttemptState&) = delete; + TestAttemptState& operator=(const TestAttemptState&) = delete; + ~TestAttemptState() override; // Act as though an online login attempt completed already. @@ -33,9 +36,6 @@ class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) TestAttemptState bool online_complete() override; bool cryptohome_complete() override; cryptohome::MountError cryptohome_code() override; - - private: - DISALLOW_COPY_AND_ASSIGN(TestAttemptState); }; } // namespace chromeos diff --git a/chromeos/login/login_state/login_state_unittest.cc b/chromeos/login/login_state/login_state_unittest.cc index 5e04cd2962d9ec..d951908632c564 100644 --- a/chromeos/login/login_state/login_state_unittest.cc +++ b/chromeos/login/login_state/login_state_unittest.cc @@ -20,6 +20,10 @@ class LoginStateTest : public testing::Test, public LoginState::Observer { LoginStateTest() : logged_in_user_type_(LoginState::LOGGED_IN_USER_NONE), login_state_changes_count_(0) {} + + LoginStateTest(const LoginStateTest&) = delete; + LoginStateTest& operator=(const LoginStateTest&) = delete; + ~LoginStateTest() override = default; // testing::Test @@ -53,8 +57,6 @@ class LoginStateTest : public testing::Test, public LoginState::Observer { private: unsigned int login_state_changes_count_; - - DISALLOW_COPY_AND_ASSIGN(LoginStateTest); }; TEST_F(LoginStateTest, TestLoginState) { diff --git a/chromeos/login/login_state/scoped_test_public_session_login_state.h b/chromeos/login/login_state/scoped_test_public_session_login_state.h index f0754abaa0fbb1..11dec884a61b8c 100644 --- a/chromeos/login/login_state/scoped_test_public_session_login_state.h +++ b/chromeos/login/login_state/scoped_test_public_session_login_state.h @@ -18,12 +18,16 @@ class ScopedTestPublicSessionLoginState { explicit ScopedTestPublicSessionLoginState( LoginState::LoggedInUserType user_type = LoginState::LOGGED_IN_USER_PUBLIC_ACCOUNT); + + ScopedTestPublicSessionLoginState(const ScopedTestPublicSessionLoginState&) = + delete; + ScopedTestPublicSessionLoginState& operator=( + const ScopedTestPublicSessionLoginState&) = delete; + ~ScopedTestPublicSessionLoginState(); private: bool needs_shutdown_ = false; - - DISALLOW_COPY_AND_ASSIGN(ScopedTestPublicSessionLoginState); }; } // namespace chromeos diff --git a/chromeos/login/session/session_termination_manager.h b/chromeos/login/session/session_termination_manager.h index 3ce17cbe1bb6e7..2e571cce7d9801 100644 --- a/chromeos/login/session/session_termination_manager.h +++ b/chromeos/login/session/session_termination_manager.h @@ -25,6 +25,11 @@ class COMPONENT_EXPORT(CHROMEOS_LOGIN_SESSION) SessionTerminationManager { }; SessionTerminationManager(); + + SessionTerminationManager(const SessionTerminationManager&) = delete; + SessionTerminationManager& operator=(const SessionTerminationManager&) = + delete; + ~SessionTerminationManager(); static SessionTerminationManager* Get(); @@ -56,8 +61,6 @@ class COMPONENT_EXPORT(CHROMEOS_LOGIN_SESSION) SessionTerminationManager { base::ObserverList observers_; bool is_locked_to_single_user_ = false; base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(SessionTerminationManager); }; } // namespace chromeos diff --git a/chromeos/login/session/session_termination_manager_unittest.cc b/chromeos/login/session/session_termination_manager_unittest.cc index cc02e0054fba61..32e4699876e63b 100644 --- a/chromeos/login/session/session_termination_manager_unittest.cc +++ b/chromeos/login/session/session_termination_manager_unittest.cc @@ -20,6 +20,11 @@ class SessionTerminationManagerTest : public testing::Test { CryptohomeMiscClient::InitializeFake(); SessionManagerClient::InitializeFake(); } + + SessionTerminationManagerTest(const SessionTerminationManagerTest&) = delete; + SessionTerminationManagerTest& operator=( + const SessionTerminationManagerTest&) = delete; + ~SessionTerminationManagerTest() override { CryptohomeMiscClient::Shutdown(); PowerManagerClient::Shutdown(); @@ -29,8 +34,6 @@ class SessionTerminationManagerTest : public testing::Test { protected: FakePowerManagerClient* power_client_; SessionTerminationManager session_termination_manager_; - - DISALLOW_COPY_AND_ASSIGN(SessionTerminationManagerTest); }; // The device is not locked to single user. Check that no reboot is triggered diff --git a/chromeos/memory/pagemap.h b/chromeos/memory/pagemap.h index 1539dc6041fb29..faceb8fc3c4813 100644 --- a/chromeos/memory/pagemap.h +++ b/chromeos/memory/pagemap.h @@ -36,6 +36,10 @@ class CHROMEOS_EXPORT Pagemap { "PagemapEntry is expected to be 8 bytes"); explicit Pagemap(pid_t pid); + + Pagemap(const Pagemap&) = delete; + Pagemap& operator=(const Pagemap&) = delete; + ~Pagemap(); bool IsValid() const; @@ -65,8 +69,6 @@ class CHROMEOS_EXPORT Pagemap { friend class PagemapTest; base::ScopedFD fd_; - - DISALLOW_COPY_AND_ASSIGN(Pagemap); }; } // namespace memory diff --git a/chromeos/memory/pressure/system_memory_pressure_evaluator_unittest.cc b/chromeos/memory/pressure/system_memory_pressure_evaluator_unittest.cc index a3a3695f8dea57..ac57384cc6acd1 100644 --- a/chromeos/memory/pressure/system_memory_pressure_evaluator_unittest.cc +++ b/chromeos/memory/pressure/system_memory_pressure_evaluator_unittest.cc @@ -51,10 +51,12 @@ class TestSystemMemoryPressureEvaluator : public SystemMemoryPressureEvaluator { SystemMemoryPressureEvaluator::OnMemoryPressure(level, reclaim_target_kb); } - ~TestSystemMemoryPressureEvaluator() override = default; + TestSystemMemoryPressureEvaluator(const TestSystemMemoryPressureEvaluator&) = + delete; + TestSystemMemoryPressureEvaluator& operator=( + const TestSystemMemoryPressureEvaluator&) = delete; - private: - DISALLOW_COPY_AND_ASSIGN(TestSystemMemoryPressureEvaluator); + ~TestSystemMemoryPressureEvaluator() override = default; }; TEST(ChromeOSSystemMemoryPressureEvaluatorTest, CheckMemoryPressure) { diff --git a/chromeos/memory/userspace_swap/swap_storage.cc b/chromeos/memory/userspace_swap/swap_storage.cc index 5faa15c7523403..e4a7e1ccc816df 100644 --- a/chromeos/memory/userspace_swap/swap_storage.cc +++ b/chromeos/memory/userspace_swap/swap_storage.cc @@ -41,6 +41,9 @@ namespace { // Adds a compression layer to a SwapFile. class CompressedSwapFile : public SwapFile { public: + CompressedSwapFile(const CompressedSwapFile&) = delete; + CompressedSwapFile& operator=(const CompressedSwapFile&) = delete; + ~CompressedSwapFile() override; // SwapFile impl: @@ -64,14 +67,14 @@ class CompressedSwapFile : public SwapFile { // that |dest| be large enough to hold the decompressed buffer, the return // value is the number of decompressed bytes. static ssize_t Decompress(const Region& src, const Region& dest); - - private: - DISALLOW_COPY_AND_ASSIGN(CompressedSwapFile); }; // Adds an encryption layer to a SwapFile. class EncryptedSwapFile : public SwapFile { public: + EncryptedSwapFile(const EncryptedSwapFile&) = delete; + EncryptedSwapFile& operator=(const EncryptedSwapFile&) = delete; + ~EncryptedSwapFile() override; // SwapFile impl: @@ -87,14 +90,15 @@ class EncryptedSwapFile : public SwapFile { crypto::Aead aead_; std::vector key_; std::vector nonce_; - - private: - DISALLOW_COPY_AND_ASSIGN(EncryptedSwapFile); }; // Adds a encryption layer to a compressed swap file. class EncryptedCompressedSwapFile : public EncryptedSwapFile { public: + EncryptedCompressedSwapFile(const EncryptedCompressedSwapFile&) = delete; + EncryptedCompressedSwapFile& operator=(const EncryptedCompressedSwapFile&) = + delete; + ~EncryptedCompressedSwapFile() override; // SwapFile impl: @@ -105,9 +109,6 @@ class EncryptedCompressedSwapFile : public EncryptedSwapFile { friend class SwapFile; explicit EncryptedCompressedSwapFile(base::ScopedFD fd); - - private: - DISALLOW_COPY_AND_ASSIGN(EncryptedCompressedSwapFile); }; // Because for some inputs that aren't compressible it can result in a size diff --git a/chromeos/memory/userspace_swap/swap_storage.h b/chromeos/memory/userspace_swap/swap_storage.h index 69694115f7e9af..78abb576ccc456 100644 --- a/chromeos/memory/userspace_swap/swap_storage.h +++ b/chromeos/memory/userspace_swap/swap_storage.h @@ -21,6 +21,9 @@ namespace userspace_swap { // thread safe as synchronization is handled internally where necessary. class CHROMEOS_EXPORT SwapFile { public: + SwapFile(const SwapFile&) = delete; + SwapFile& operator=(const SwapFile&) = delete; + virtual ~SwapFile(); enum Type { @@ -84,8 +87,6 @@ class CHROMEOS_EXPORT SwapFile { // drops are safe, because they use syscalls which do not rely on the file // pointer, specifically pread(2) and fallocate(2) respectively). base::Lock write_lock_; - - DISALLOW_COPY_AND_ASSIGN(SwapFile); }; } // namespace userspace_swap diff --git a/chromeos/memory/userspace_swap/userfaultfd.h b/chromeos/memory/userspace_swap/userfaultfd.h index 9b409dd2ddc4c3..b42355bd600652 100644 --- a/chromeos/memory/userspace_swap/userfaultfd.h +++ b/chromeos/memory/userspace_swap/userfaultfd.h @@ -175,6 +175,9 @@ class CHROMEOS_EXPORT UserfaultFD { // Wrap FD is used to take a donated FD and assume ownership of it. static std::unique_ptr WrapFD(base::ScopedFD fd); + UserfaultFD(const UserfaultFD&) = delete; + UserfaultFD& operator=(const UserfaultFD&) = delete; + ~UserfaultFD(); base::ScopedFD ReleaseFD(); @@ -205,8 +208,6 @@ class CHROMEOS_EXPORT UserfaultFD { std::unique_ptr handler_; std::unique_ptr watcher_controller_; - - DISALLOW_COPY_AND_ASSIGN(UserfaultFD); }; } // namespace userspace_swap diff --git a/chromeos/memory/userspace_swap/userfaultfd_unittest.cc b/chromeos/memory/userspace_swap/userfaultfd_unittest.cc index 4a91f828545d93..3336c807cddc09 100644 --- a/chromeos/memory/userspace_swap/userfaultfd_unittest.cc +++ b/chromeos/memory/userspace_swap/userfaultfd_unittest.cc @@ -44,6 +44,9 @@ using testing::StrictMock; // tests. class ScopedMemory { public: + ScopedMemory(const ScopedMemory&) = delete; + ScopedMemory& operator=(const ScopedMemory&) = delete; + ~ScopedMemory() { Free(); } ScopedMemory() = default; @@ -92,8 +95,6 @@ class ScopedMemory { private: void* ptr_ = nullptr; size_t len_ = 0; - - DISALLOW_COPY_AND_ASSIGN(ScopedMemory); }; const size_t kPageSize = base::GetPageSize(); @@ -150,6 +151,10 @@ class UserfaultFDTest : public testing::Test { class MockUserfaultFDHandler : public UserfaultFDHandler { public: MockUserfaultFDHandler() = default; + + MockUserfaultFDHandler(const MockUserfaultFDHandler&) = delete; + MockUserfaultFDHandler& operator=(const MockUserfaultFDHandler&) = delete; + ~MockUserfaultFDHandler() override = default; MOCK_METHOD3(Pagefault, @@ -163,9 +168,6 @@ class MockUserfaultFDHandler : public UserfaultFDHandler { uintptr_t new_address, uint64_t original_length)); MOCK_METHOD1(Closed, void(int err)); - - private: - DISALLOW_COPY_AND_ASSIGN(MockUserfaultFDHandler); }; uintptr_t GetPageBase(uintptr_t addr) { diff --git a/chromeos/memory/userspace_swap/userspace_swap_renderer_initialization_impl.h b/chromeos/memory/userspace_swap/userspace_swap_renderer_initialization_impl.h index 987e888f9922c7..37a133434f34ff 100644 --- a/chromeos/memory/userspace_swap/userspace_swap_renderer_initialization_impl.h +++ b/chromeos/memory/userspace_swap/userspace_swap_renderer_initialization_impl.h @@ -18,6 +18,12 @@ namespace userspace_swap { class CHROMEOS_EXPORT UserspaceSwapRendererInitializationImpl { public: UserspaceSwapRendererInitializationImpl(); + + UserspaceSwapRendererInitializationImpl( + const UserspaceSwapRendererInitializationImpl&) = delete; + UserspaceSwapRendererInitializationImpl& operator=( + const UserspaceSwapRendererInitializationImpl&) = delete; + ~UserspaceSwapRendererInitializationImpl(); static bool UserspaceSwapSupportedAndEnabled(); @@ -40,8 +46,6 @@ class CHROMEOS_EXPORT UserspaceSwapRendererInitializationImpl { int mmap_errno_ = 0; uint64_t swap_area_ = 0; uint64_t swap_area_len_ = 0; - - DISALLOW_COPY_AND_ASSIGN(UserspaceSwapRendererInitializationImpl); }; } // namespace userspace_swap diff --git a/chromeos/network/auto_connect_handler.h b/chromeos/network/auto_connect_handler.h index c747036160bf50..995e899773aa46 100644 --- a/chromeos/network/auto_connect_handler.h +++ b/chromeos/network/auto_connect_handler.h @@ -41,6 +41,9 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) AutoConnectHandler virtual void OnAutoConnectedInitiated(int auto_connect_reasons) = 0; }; + AutoConnectHandler(const AutoConnectHandler&) = delete; + AutoConnectHandler& operator=(const AutoConnectHandler&) = delete; + ~AutoConnectHandler() override; // LoginState::Observer @@ -163,8 +166,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) AutoConnectHandler base::ObserverList::Unchecked observer_list_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(AutoConnectHandler); }; } // namespace chromeos diff --git a/chromeos/network/cellular_metrics_logger.h b/chromeos/network/cellular_metrics_logger.h index 6ab154a3d760ce..4797275460a5ab 100644 --- a/chromeos/network/cellular_metrics_logger.h +++ b/chromeos/network/cellular_metrics_logger.h @@ -75,6 +75,10 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) CellularMetricsLogger const absl::optional& shill_error_name = absl::nullopt); CellularMetricsLogger(); + + CellularMetricsLogger(const CellularMetricsLogger&) = delete; + CellularMetricsLogger& operator=(const CellularMetricsLogger&) = delete; + ~CellularMetricsLogger() override; void Init(NetworkStateHandler* network_state_handler, @@ -382,8 +386,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) CellularMetricsLogger // Tracks ESim feature usage for the Standard Feature Usage Logging Framework. std::unique_ptr esim_feature_usage_metrics_; - - DISALLOW_COPY_AND_ASSIGN(CellularMetricsLogger); }; } // namespace chromeos diff --git a/chromeos/network/cellular_metrics_logger_unittest.cc b/chromeos/network/cellular_metrics_logger_unittest.cc index db17a01d0636ae..6cdc5f6b16ba5b 100644 --- a/chromeos/network/cellular_metrics_logger_unittest.cc +++ b/chromeos/network/cellular_metrics_logger_unittest.cc @@ -70,6 +70,11 @@ class CellularMetricsLoggerTest : public testing::Test { public: CellularMetricsLoggerTest() : task_environment_(base::test::TaskEnvironment::TimeSource::MOCK_TIME) {} + + CellularMetricsLoggerTest(const CellularMetricsLoggerTest&) = delete; + CellularMetricsLoggerTest& operator=(const CellularMetricsLoggerTest&) = + delete; + ~CellularMetricsLoggerTest() override = default; void SetUp() override { @@ -208,7 +213,6 @@ class CellularMetricsLoggerTest : public testing::Test { std::unique_ptr cellular_esim_profile_handler_; std::unique_ptr cellular_metrics_logger_; - DISALLOW_COPY_AND_ASSIGN(CellularMetricsLoggerTest); }; TEST_F(CellularMetricsLoggerTest, ActiveProfileExists) { diff --git a/chromeos/network/client_cert_resolver_unittest.cc b/chromeos/network/client_cert_resolver_unittest.cc index 1ae07c9b65458a..9e8d67ba7cbb43 100644 --- a/chromeos/network/client_cert_resolver_unittest.cc +++ b/chromeos/network/client_cert_resolver_unittest.cc @@ -100,6 +100,10 @@ class ClientCertResolverTest : public testing::Test, public ClientCertResolver::Observer { public: ClientCertResolverTest() = default; + + ClientCertResolverTest(const ClientCertResolverTest&) = delete; + ClientCertResolverTest& operator=(const ClientCertResolverTest&) = delete; + ~ClientCertResolverTest() override = default; void SetUp() override { @@ -505,8 +509,6 @@ class ClientCertResolverTest : public testing::Test, std::string test_ca_cert_pem_; crypto::ScopedTestNSSDB test_nssdb_; crypto::ScopedTestNSSDB test_system_nssdb_; - - DISALLOW_COPY_AND_ASSIGN(ClientCertResolverTest); }; TEST_F(ClientCertResolverTest, NoMatchingCertificates) { diff --git a/chromeos/network/device_state.h b/chromeos/network/device_state.h index d0f0d0c5ef5a37..4b31745b54693f 100644 --- a/chromeos/network/device_state.h +++ b/chromeos/network/device_state.h @@ -22,6 +22,10 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) DeviceState : public ManagedState { typedef std::vector CellularSIMSlotInfos; explicit DeviceState(const std::string& path); + + DeviceState(const DeviceState&) = delete; + DeviceState& operator=(const DeviceState&) = delete; + ~DeviceState() override; // ManagedState overrides @@ -136,8 +140,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) DeviceState : public ManagedState { // Dictionary of IPConfig properties, keyed by IpConfig path. base::DictionaryValue ip_configs_; - - DISALLOW_COPY_AND_ASSIGN(DeviceState); }; } // namespace chromeos diff --git a/chromeos/network/fake_network_activation_handler.h b/chromeos/network/fake_network_activation_handler.h index 719e97004321c4..d384440e3177b1 100644 --- a/chromeos/network/fake_network_activation_handler.h +++ b/chromeos/network/fake_network_activation_handler.h @@ -19,6 +19,11 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) FakeNetworkActivationHandler : public NetworkActivationHandler { public: FakeNetworkActivationHandler(); + + FakeNetworkActivationHandler(const FakeNetworkActivationHandler&) = delete; + FakeNetworkActivationHandler& operator=(const FakeNetworkActivationHandler&) = + delete; + ~FakeNetworkActivationHandler() override; // Parameters captured by calls to CompleteActivation(). @@ -56,8 +61,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) FakeNetworkActivationHandler network_handler::ErrorCallback error_callback) override; std::vector complete_activation_calls_; - - DISALLOW_COPY_AND_ASSIGN(FakeNetworkActivationHandler); }; } // namespace chromeos diff --git a/chromeos/network/fake_network_connection_handler.h b/chromeos/network/fake_network_connection_handler.h index 6ce0ee813ffcc5..647fee70b195c7 100644 --- a/chromeos/network/fake_network_connection_handler.h +++ b/chromeos/network/fake_network_connection_handler.h @@ -21,6 +21,11 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) FakeNetworkConnectionHandler : public NetworkConnectionHandler { public: FakeNetworkConnectionHandler(); + + FakeNetworkConnectionHandler(const FakeNetworkConnectionHandler&) = delete; + FakeNetworkConnectionHandler& operator=(const FakeNetworkConnectionHandler&) = + delete; + ~FakeNetworkConnectionHandler() override; // Parameters captured by calls to ConnectToNetwork() and DisconnectNetwork(). @@ -87,8 +92,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) FakeNetworkConnectionHandler std::vector connect_calls_; std::vector disconnect_calls_; - - DISALLOW_COPY_AND_ASSIGN(FakeNetworkConnectionHandler); }; } // namespace chromeos diff --git a/chromeos/network/fake_network_device_handler.h b/chromeos/network/fake_network_device_handler.h index 4b1a729265a417..a8b008e032e6a8 100644 --- a/chromeos/network/fake_network_device_handler.h +++ b/chromeos/network/fake_network_device_handler.h @@ -21,6 +21,10 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) FakeNetworkDeviceHandler : public NetworkDeviceHandler { public: FakeNetworkDeviceHandler(); + + FakeNetworkDeviceHandler(const FakeNetworkDeviceHandler&) = delete; + FakeNetworkDeviceHandler& operator=(const FakeNetworkDeviceHandler&) = delete; + ~FakeNetworkDeviceHandler() override; // NetworkDeviceHandler overrides @@ -68,9 +72,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) FakeNetworkDeviceHandler bool policy_allow_roaming) override; void SetUsbEthernetMacAddressSource(const std::string& source) override; - - private: - DISALLOW_COPY_AND_ASSIGN(FakeNetworkDeviceHandler); }; } // namespace chromeos diff --git a/chromeos/network/fast_transition_observer.h b/chromeos/network/fast_transition_observer.h index 35b36c1614a172..a75c3849ed9afc 100644 --- a/chromeos/network/fast_transition_observer.h +++ b/chromeos/network/fast_transition_observer.h @@ -22,6 +22,10 @@ namespace chromeos { class COMPONENT_EXPORT(CHROMEOS_NETWORK) FastTransitionObserver { public: explicit FastTransitionObserver(PrefService* local_state); + + FastTransitionObserver(const FastTransitionObserver&) = delete; + FastTransitionObserver& operator=(const FastTransitionObserver&) = delete; + ~FastTransitionObserver(); static void RegisterPrefs(PrefRegistrySimple* registry); @@ -32,8 +36,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) FastTransitionObserver { PrefService* local_state_; PrefChangeRegistrar pref_change_registrar_; - - DISALLOW_COPY_AND_ASSIGN(FastTransitionObserver); }; } // namespace chromeos diff --git a/chromeos/network/fast_transition_observer_unittest.cc b/chromeos/network/fast_transition_observer_unittest.cc index 046d85262f6623..6426a8099197f7 100644 --- a/chromeos/network/fast_transition_observer_unittest.cc +++ b/chromeos/network/fast_transition_observer_unittest.cc @@ -26,6 +26,10 @@ class FastTransitionObserverTest : public ::testing::Test { observer_ = std::make_unique(local_state_.get()); } + FastTransitionObserverTest(const FastTransitionObserverTest&) = delete; + FastTransitionObserverTest& operator=(const FastTransitionObserverTest&) = + delete; + ~FastTransitionObserverTest() override { observer_.reset(); local_state_.reset(); @@ -44,8 +48,6 @@ class FastTransitionObserverTest : public ::testing::Test { NetworkHandlerTestHelper network_handler_test_helper_; std::unique_ptr local_state_; std::unique_ptr observer_; - - DISALLOW_COPY_AND_ASSIGN(FastTransitionObserverTest); }; TEST_F(FastTransitionObserverTest, FastTransitionChangeCallsShill) { diff --git a/chromeos/network/geolocation_handler.h b/chromeos/network/geolocation_handler.h index e8f52ee76f68e5..11a4398bd9129c 100644 --- a/chromeos/network/geolocation_handler.h +++ b/chromeos/network/geolocation_handler.h @@ -34,6 +34,9 @@ namespace chromeos { class COMPONENT_EXPORT(CHROMEOS_NETWORK) GeolocationHandler : public ShillPropertyChangedObserver { public: + GeolocationHandler(const GeolocationHandler&) = delete; + GeolocationHandler& operator=(const GeolocationHandler&) = delete; + ~GeolocationHandler() override; // This sends a request for geolocation (both wifi AP and cell tower) data. @@ -91,8 +94,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) GeolocationHandler // For Shill client callbacks base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(GeolocationHandler); }; } // namespace chromeos diff --git a/chromeos/network/geolocation_handler_unittest.cc b/chromeos/network/geolocation_handler_unittest.cc index a905adf3a940ca..c29af61b0f801b 100644 --- a/chromeos/network/geolocation_handler_unittest.cc +++ b/chromeos/network/geolocation_handler_unittest.cc @@ -25,6 +25,9 @@ class GeolocationHandlerTest : public testing::Test { : task_environment_( base::test::SingleThreadTaskEnvironment::MainThreadType::UI) {} + GeolocationHandlerTest(const GeolocationHandlerTest&) = delete; + GeolocationHandlerTest& operator=(const GeolocationHandlerTest&) = delete; + ~GeolocationHandlerTest() override = default; void SetUp() override { @@ -94,9 +97,6 @@ class GeolocationHandlerTest : public testing::Test { ShillManagerClient::TestInterface* manager_test_ = nullptr; WifiAccessPointVector wifi_access_points_; CellTowerVector cell_towers_; - - private: - DISALLOW_COPY_AND_ASSIGN(GeolocationHandlerTest); }; TEST_F(GeolocationHandlerTest, NoAccessPoints) { diff --git a/chromeos/network/managed_network_configuration_handler_impl.h b/chromeos/network/managed_network_configuration_handler_impl.h index 5d8815f8723240..7c811e2f7ea0cf 100644 --- a/chromeos/network/managed_network_configuration_handler_impl.h +++ b/chromeos/network/managed_network_configuration_handler_impl.h @@ -38,6 +38,11 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) ManagedNetworkConfigurationHandlerImpl public NetworkProfileObserver, public PolicyApplicator::ConfigurationHandler { public: + ManagedNetworkConfigurationHandlerImpl( + const ManagedNetworkConfigurationHandlerImpl&) = delete; + ManagedNetworkConfigurationHandlerImpl& operator=( + const ManagedNetworkConfigurationHandlerImpl&) = delete; + ~ManagedNetworkConfigurationHandlerImpl() override; // ManagedNetworkConfigurationHandler overrides @@ -265,8 +270,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) ManagedNetworkConfigurationHandlerImpl // For Shill client callbacks base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ManagedNetworkConfigurationHandlerImpl); }; } // namespace chromeos diff --git a/chromeos/network/managed_network_configuration_handler_unittest.cc b/chromeos/network/managed_network_configuration_handler_unittest.cc index 2d05fefe2e4533..bb880d6143bd01 100644 --- a/chromeos/network/managed_network_configuration_handler_unittest.cc +++ b/chromeos/network/managed_network_configuration_handler_unittest.cc @@ -188,6 +188,11 @@ class ManagedNetworkConfigurationHandlerTest : public testing::Test { base::RunLoop().RunUntilIdle(); } + ManagedNetworkConfigurationHandlerTest( + const ManagedNetworkConfigurationHandlerTest&) = delete; + ManagedNetworkConfigurationHandlerTest& operator=( + const ManagedNetworkConfigurationHandlerTest&) = delete; + ~ManagedNetworkConfigurationHandlerTest() override { ResetManagedNetworkConfigurationHandler(); cellular_policy_handler_.reset(); @@ -336,8 +341,6 @@ class ManagedNetworkConfigurationHandlerTest : public testing::Test { sync_preferences::TestingPrefServiceSyncable user_prefs_; TestingPrefServiceSimple local_state_; - - DISALLOW_COPY_AND_ASSIGN(ManagedNetworkConfigurationHandlerTest); }; TEST_F(ManagedNetworkConfigurationHandlerTest, RemoveIrrelevantFields) { diff --git a/chromeos/network/managed_state.h b/chromeos/network/managed_state.h index 1c3996f7269e7f..dbd44af4035a12 100644 --- a/chromeos/network/managed_state.h +++ b/chromeos/network/managed_state.h @@ -37,6 +37,9 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) ManagedState { MANAGED_TYPE_DEVICE }; + ManagedState(const ManagedState&) = delete; + ManagedState& operator=(const ManagedState&) = delete; + virtual ~ManagedState(); // This will construct and return a new instance of the appropriate class @@ -141,8 +144,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) ManagedState { // Tracks when an update has been requested. bool update_requested_ = false; - - DISALLOW_COPY_AND_ASSIGN(ManagedState); }; } // namespace chromeos diff --git a/chromeos/network/mock_managed_network_configuration_handler.h b/chromeos/network/mock_managed_network_configuration_handler.h index 65de65b6e96c47..05c3cf28cf9d7b 100644 --- a/chromeos/network/mock_managed_network_configuration_handler.h +++ b/chromeos/network/mock_managed_network_configuration_handler.h @@ -19,6 +19,12 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) MockManagedNetworkConfigurationHandler : public ManagedNetworkConfigurationHandler { public: MockManagedNetworkConfigurationHandler(); + + MockManagedNetworkConfigurationHandler( + const MockManagedNetworkConfigurationHandler&) = delete; + MockManagedNetworkConfigurationHandler& operator=( + const MockManagedNetworkConfigurationHandler&) = delete; + virtual ~MockManagedNetworkConfigurationHandler(); // ManagedNetworkConfigurationHandler overrides @@ -86,9 +92,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) MockManagedNetworkConfigurationHandler MOCK_CONST_METHOD0(AllowOnlyPolicyWiFiToConnectIfAvailable, bool()); MOCK_CONST_METHOD0(AllowOnlyPolicyNetworksToAutoconnect, bool()); MOCK_CONST_METHOD0(GetBlockedHexSSIDs, std::vector()); - - private: - DISALLOW_COPY_AND_ASSIGN(MockManagedNetworkConfigurationHandler); }; } // namespace chromeos diff --git a/chromeos/network/mock_network_device_handler.h b/chromeos/network/mock_network_device_handler.h index 1be9b212f335b5..f6566511c2f992 100644 --- a/chromeos/network/mock_network_device_handler.h +++ b/chromeos/network/mock_network_device_handler.h @@ -23,6 +23,10 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) MockNetworkDeviceHandler : public NetworkDeviceHandler { public: MockNetworkDeviceHandler(); + + MockNetworkDeviceHandler(const MockNetworkDeviceHandler&) = delete; + MockNetworkDeviceHandler& operator=(const MockNetworkDeviceHandler&) = delete; + virtual ~MockNetworkDeviceHandler(); MOCK_CONST_METHOD2(GetDeviceProperties, @@ -76,9 +80,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) MockNetworkDeviceHandler MOCK_METHOD1(SetUsbEthernetMacAddressSource, void(const std::string& enabled)); - - private: - DISALLOW_COPY_AND_ASSIGN(MockNetworkDeviceHandler); }; } // namespace chromeos diff --git a/chromeos/network/mock_network_state_handler.h b/chromeos/network/mock_network_state_handler.h index cb995e1b8e661e..4dd0729007fa57 100644 --- a/chromeos/network/mock_network_state_handler.h +++ b/chromeos/network/mock_network_state_handler.h @@ -14,6 +14,10 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) MockNetworkStateHandler : public NetworkStateHandler { public: MockNetworkStateHandler(); + + MockNetworkStateHandler(const MockNetworkStateHandler&) = delete; + MockNetworkStateHandler& operator=(const MockNetworkStateHandler&) = delete; + virtual ~MockNetworkStateHandler(); // Constructs and initializes an instance for testing. @@ -22,9 +26,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) MockNetworkStateHandler // NetworkStateHandler overrides MOCK_METHOD3(UpdateBlockedWifiNetworks, void(bool, bool, const std::vector&)); - - private: - DISALLOW_COPY_AND_ASSIGN(MockNetworkStateHandler); }; } // namespace chromeos diff --git a/chromeos/network/network_activation_handler.h b/chromeos/network/network_activation_handler.h index 94981266a8fdbf..b2fda39dd4ed1a 100644 --- a/chromeos/network/network_activation_handler.h +++ b/chromeos/network/network_activation_handler.h @@ -17,6 +17,9 @@ namespace chromeos { // calls required for activation on mobile networks. class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkActivationHandler { public: + NetworkActivationHandler(const NetworkActivationHandler&) = delete; + NetworkActivationHandler& operator=(const NetworkActivationHandler&) = delete; + virtual ~NetworkActivationHandler() = default; // CompleteActivation() will start an asynchronous activation completion @@ -32,9 +35,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkActivationHandler { protected: NetworkActivationHandler() = default; - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkActivationHandler); }; } // namespace chromeos diff --git a/chromeos/network/network_activation_handler_impl.h b/chromeos/network/network_activation_handler_impl.h index a2a3cae0819e3a..fb55354d9175d5 100644 --- a/chromeos/network/network_activation_handler_impl.h +++ b/chromeos/network/network_activation_handler_impl.h @@ -21,6 +21,10 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkActivationHandlerImpl : public NetworkActivationHandler, public base::SupportsWeakPtr { public: + NetworkActivationHandlerImpl(const NetworkActivationHandlerImpl&) = delete; + NetworkActivationHandlerImpl& operator=(const NetworkActivationHandlerImpl&) = + delete; + ~NetworkActivationHandlerImpl() override; private: @@ -36,8 +40,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkActivationHandlerImpl NetworkActivationHandlerImpl(); void HandleShillSuccess(base::OnceClosure success_callback); - - DISALLOW_COPY_AND_ASSIGN(NetworkActivationHandlerImpl); }; } // namespace chromeos diff --git a/chromeos/network/network_cert_loader.cc b/chromeos/network/network_cert_loader.cc index a8b052d55fc853..9a4f620b30ddcf 100644 --- a/chromeos/network/network_cert_loader.cc +++ b/chromeos/network/network_cert_loader.cc @@ -139,6 +139,9 @@ class NetworkCertLoader::CertCache : public net::CertDatabase::Observer { explicit CertCache(base::RepeatingClosure certificates_updated_callback) : certificates_updated_callback_(certificates_updated_callback) {} + CertCache(const CertCache&) = delete; + CertCache& operator=(const CertCache&) = delete; + ~CertCache() override { net::CertDatabase::GetInstance()->RemoveObserver(this); } @@ -286,8 +289,6 @@ class NetworkCertLoader::CertCache : public net::CertDatabase::Observer { THREAD_CHECKER(thread_checker_); base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(CertCache); }; NetworkCertLoader::NetworkCert::NetworkCert(net::ScopedCERTCertificate cert, diff --git a/chromeos/network/network_cert_migrator.h b/chromeos/network/network_cert_migrator.h index eaba214dfda88d..aeac487722a101 100644 --- a/chromeos/network/network_cert_migrator.h +++ b/chromeos/network/network_cert_migrator.h @@ -21,6 +21,9 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkCertMigrator : public NetworkStateHandlerObserver, public NetworkCertLoader::Observer { public: + NetworkCertMigrator(const NetworkCertMigrator&) = delete; + NetworkCertMigrator& operator=(const NetworkCertMigrator&) = delete; + ~NetworkCertMigrator() override; private: @@ -41,8 +44,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkCertMigrator NetworkStateHandler* network_state_handler_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(NetworkCertMigrator); }; } // namespace chromeos diff --git a/chromeos/network/network_cert_migrator_unittest.cc b/chromeos/network/network_cert_migrator_unittest.cc index c5fa4f342f0408..2ba1ead7352b49 100644 --- a/chromeos/network/network_cert_migrator_unittest.cc +++ b/chromeos/network/network_cert_migrator_unittest.cc @@ -46,6 +46,10 @@ class NetworkCertMigratorTest : public testing::Test { base::test::TaskEnvironment::MainThreadType::DEFAULT, base::test::TaskEnvironment::ThreadPoolExecutionMode::QUEUED), service_test_(nullptr) {} + + NetworkCertMigratorTest(const NetworkCertMigratorTest&) = delete; + NetworkCertMigratorTest& operator=(const NetworkCertMigratorTest&) = delete; + ~NetworkCertMigratorTest() override = default; void SetUp() override { @@ -220,8 +224,6 @@ class NetworkCertMigratorTest : public testing::Test { private: std::unique_ptr network_state_handler_; std::unique_ptr network_cert_migrator_; - - DISALLOW_COPY_AND_ASSIGN(NetworkCertMigratorTest); }; // Test that migration of user profile networks is deferred until the user's NSS diff --git a/chromeos/network/network_certificate_handler.h b/chromeos/network/network_certificate_handler.h index 915ffe31dc682a..3d7fe6d991f368 100644 --- a/chromeos/network/network_certificate_handler.h +++ b/chromeos/network/network_certificate_handler.h @@ -21,6 +21,9 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkCertificateHandler public: class Observer { public: + Observer(const Observer&) = delete; + Observer& operator=(const Observer&) = delete; + virtual ~Observer() {} // Called for any Observers whenever the certificates are loaded and any @@ -29,9 +32,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkCertificateHandler protected: Observer() {} - - private: - DISALLOW_COPY_AND_ASSIGN(Observer); }; struct Certificate { diff --git a/chromeos/network/network_configuration_handler.h b/chromeos/network/network_configuration_handler.h index c8a5386b6af77c..44ff945298095b 100644 --- a/chromeos/network/network_configuration_handler.h +++ b/chromeos/network/network_configuration_handler.h @@ -56,6 +56,10 @@ namespace chromeos { class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkConfigurationHandler : public NetworkStateHandlerObserver { public: + NetworkConfigurationHandler(const NetworkConfigurationHandler&) = delete; + NetworkConfigurationHandler& operator=(const NetworkConfigurationHandler&) = + delete; + ~NetworkConfigurationHandler() override; // Manages the observer list. @@ -229,8 +233,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkConfigurationHandler base::ObserverList::Unchecked observers_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationHandler); }; } // namespace chromeos diff --git a/chromeos/network/network_connect.cc b/chromeos/network/network_connect.cc index e81bcfc12d4417..f9b7ee58f0099f 100644 --- a/chromeos/network/network_connect.cc +++ b/chromeos/network/network_connect.cc @@ -54,6 +54,10 @@ bool PreviousConnectAttemptHadError(const NetworkState* network) { class NetworkConnectImpl : public NetworkConnect { public: explicit NetworkConnectImpl(Delegate* delegate); + + NetworkConnectImpl(const NetworkConnectImpl&) = delete; + NetworkConnectImpl& operator=(const NetworkConnectImpl&) = delete; + ~NetworkConnectImpl() override; // NetworkConnect @@ -105,8 +109,6 @@ class NetworkConnectImpl : public NetworkConnect { Delegate* delegate_; base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(NetworkConnectImpl); }; NetworkConnectImpl::NetworkConnectImpl(Delegate* delegate) diff --git a/chromeos/network/network_connect_unittest.cc b/chromeos/network/network_connect_unittest.cc index 2c2da5da600a5a..0d75f1fd6eacf1 100644 --- a/chromeos/network/network_connect_unittest.cc +++ b/chromeos/network/network_connect_unittest.cc @@ -90,6 +90,10 @@ class FakeTetherDelegate : public NetworkConnectionHandler::TetherDelegate { class NetworkConnectTest : public testing::Test { public: NetworkConnectTest() = default; + + NetworkConnectTest(const NetworkConnectTest&) = delete; + NetworkConnectTest& operator=(const NetworkConnectTest&) = delete; + ~NetworkConnectTest() override = default; void SetUp() override { @@ -192,9 +196,6 @@ class NetworkConnectTest : public testing::Test { NetworkHandlerTestHelper network_handler_test_helper_; ShillDeviceClient::TestInterface* device_test_; ShillServiceClient::TestInterface* service_test_; - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkConnectTest); }; TEST_F(NetworkConnectTest, ConnectToNetworkId_NoConfiguration) { diff --git a/chromeos/network/network_connection_handler_impl.h b/chromeos/network/network_connection_handler_impl.h index 31ba6feb22df60..b1890bb6b261b4 100644 --- a/chromeos/network/network_connection_handler_impl.h +++ b/chromeos/network/network_connection_handler_impl.h @@ -22,6 +22,11 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkConnectionHandlerImpl public base::SupportsWeakPtr { public: NetworkConnectionHandlerImpl(); + + NetworkConnectionHandlerImpl(const NetworkConnectionHandlerImpl&) = delete; + NetworkConnectionHandlerImpl& operator=(const NetworkConnectionHandlerImpl&) = + delete; + ~NetworkConnectionHandlerImpl() override; // NetworkConnectionHandler: @@ -164,8 +169,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkConnectionHandlerImpl // Track certificate loading state. bool certificates_loaded_; - - DISALLOW_COPY_AND_ASSIGN(NetworkConnectionHandlerImpl); }; } // namespace chromeos diff --git a/chromeos/network/network_connection_handler_impl_unittest.cc b/chromeos/network/network_connection_handler_impl_unittest.cc index 43c7a8c048ea6e..8191b56cacfab9 100644 --- a/chromeos/network/network_connection_handler_impl_unittest.cc +++ b/chromeos/network/network_connection_handler_impl_unittest.cc @@ -68,6 +68,11 @@ const char kTestIccid2[] = "9876543210987654321"; class TestNetworkConnectionObserver : public NetworkConnectionObserver { public: TestNetworkConnectionObserver() = default; + + TestNetworkConnectionObserver(const TestNetworkConnectionObserver&) = delete; + TestNetworkConnectionObserver& operator=( + const TestNetworkConnectionObserver&) = delete; + ~TestNetworkConnectionObserver() override = default; // NetworkConnectionObserver @@ -108,8 +113,6 @@ class TestNetworkConnectionObserver : public NetworkConnectionObserver { std::set disconnect_requests_; std::set requests_; std::map results_; - - DISALLOW_COPY_AND_ASSIGN(TestNetworkConnectionObserver); }; class FakeTetherDelegate : public NetworkConnectionHandler::TetherDelegate { @@ -160,6 +163,12 @@ class FakeTetherDelegate : public NetworkConnectionHandler::TetherDelegate { class NetworkConnectionHandlerImplTest : public testing::Test { public: NetworkConnectionHandlerImplTest() = default; + + NetworkConnectionHandlerImplTest(const NetworkConnectionHandlerImplTest&) = + delete; + NetworkConnectionHandlerImplTest& operator=( + const NetworkConnectionHandlerImplTest&) = delete; + ~NetworkConnectionHandlerImplTest() override = default; void SetUp() override { @@ -537,8 +546,6 @@ class NetworkConnectionHandlerImplTest : public testing::Test { std::unique_ptr test_nsscertdb_; std::string result_; std::unique_ptr fake_tether_delegate_; - - DISALLOW_COPY_AND_ASSIGN(NetworkConnectionHandlerImplTest); }; namespace { diff --git a/chromeos/network/network_device_handler.h b/chromeos/network/network_device_handler.h index dbcb167e9fff27..fb474f245207b2 100644 --- a/chromeos/network/network_device_handler.h +++ b/chromeos/network/network_device_handler.h @@ -48,6 +48,10 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkDeviceHandler { static const char kErrorUnknown[]; NetworkDeviceHandler(); + + NetworkDeviceHandler(const NetworkDeviceHandler&) = delete; + NetworkDeviceHandler& operator=(const NetworkDeviceHandler&) = delete; + virtual ~NetworkDeviceHandler(); // Invokes |callback| with the properties for the device matching @@ -166,9 +170,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkDeviceHandler { static std::unique_ptr InitializeForTesting( NetworkStateHandler* network_state_handler); - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkDeviceHandler); }; } // namespace chromeos diff --git a/chromeos/network/network_device_handler_impl.h b/chromeos/network/network_device_handler_impl.h index fbb40024ee558b..4710a545fc2cd8 100644 --- a/chromeos/network/network_device_handler_impl.h +++ b/chromeos/network/network_device_handler_impl.h @@ -27,6 +27,9 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkDeviceHandlerImpl : public NetworkDeviceHandler, public NetworkStateHandlerObserver { public: + NetworkDeviceHandlerImpl(const NetworkDeviceHandlerImpl&) = delete; + NetworkDeviceHandlerImpl& operator=(const NetworkDeviceHandlerImpl&) = delete; + ~NetworkDeviceHandlerImpl() override; // NetworkDeviceHandler overrides @@ -186,8 +189,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkDeviceHandlerImpl std::unordered_set mac_address_change_not_supported_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(NetworkDeviceHandlerImpl); }; } // namespace chromeos diff --git a/chromeos/network/network_device_handler_unittest.cc b/chromeos/network/network_device_handler_unittest.cc index 2c809d37d01fb8..a70bb2193d9dfc 100644 --- a/chromeos/network/network_device_handler_unittest.cc +++ b/chromeos/network/network_device_handler_unittest.cc @@ -45,6 +45,10 @@ class NetworkDeviceHandlerTest : public testing::Test { NetworkDeviceHandlerTest() : task_environment_( base::test::SingleThreadTaskEnvironment::MainThreadType::UI) {} + + NetworkDeviceHandlerTest(const NetworkDeviceHandlerTest&) = delete; + NetworkDeviceHandlerTest& operator=(const NetworkDeviceHandlerTest&) = delete; + ~NetworkDeviceHandlerTest() override = default; void SetUp() override { @@ -140,9 +144,6 @@ class NetworkDeviceHandlerTest : public testing::Test { std::unique_ptr network_device_handler_; std::unique_ptr network_state_handler_; std::unique_ptr properties_; - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkDeviceHandlerTest); }; TEST_F(NetworkDeviceHandlerTest, GetDeviceProperties) { diff --git a/chromeos/network/network_metadata_store_unittest.cc b/chromeos/network/network_metadata_store_unittest.cc index 9e932fef8d90df..60279499bd1998 100644 --- a/chromeos/network/network_metadata_store_unittest.cc +++ b/chromeos/network/network_metadata_store_unittest.cc @@ -103,6 +103,9 @@ class NetworkMetadataStoreTest : public ::testing::Test { metadata_store_->AddObserver(metadata_observer_.get()); } + NetworkMetadataStoreTest(const NetworkMetadataStoreTest&) = delete; + NetworkMetadataStoreTest& operator=(const NetworkMetadataStoreTest&) = delete; + ~NetworkMetadataStoreTest() override { network_state_handler_ = nullptr; metadata_store_.reset(); @@ -187,8 +190,6 @@ class NetworkMetadataStoreTest : public ::testing::Test { std::unique_ptr metadata_store_; std::unique_ptr metadata_observer_; std::unique_ptr scoped_user_manager_; - - DISALLOW_COPY_AND_ASSIGN(NetworkMetadataStoreTest); }; namespace { diff --git a/chromeos/network/network_profile_handler.h b/chromeos/network/network_profile_handler.h index c931c0fc998846..54ca2c79d120be 100644 --- a/chromeos/network/network_profile_handler.h +++ b/chromeos/network/network_profile_handler.h @@ -28,6 +28,9 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkProfileHandler public: typedef std::vector ProfileList; + NetworkProfileHandler(const NetworkProfileHandler&) = delete; + NetworkProfileHandler& operator=(const NetworkProfileHandler&) = delete; + ~NetworkProfileHandler() override; void AddObserver(NetworkProfileObserver* observer); @@ -102,9 +105,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkProfileHandler // For Shill client callbacks base::WeakPtrFactory weak_ptr_factory_{this}; - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkProfileHandler); }; } // namespace chromeos diff --git a/chromeos/network/network_sms_handler.cc b/chromeos/network/network_sms_handler.cc index 37be1ae975c2a5..603dd555afa60f 100644 --- a/chromeos/network/network_sms_handler.cc +++ b/chromeos/network/network_sms_handler.cc @@ -50,6 +50,12 @@ class NetworkSmsHandler::ModemManager1NetworkSmsDeviceHandler ModemManager1NetworkSmsDeviceHandler(NetworkSmsHandler* host, const std::string& service_name, const dbus::ObjectPath& object_path); + + ModemManager1NetworkSmsDeviceHandler( + const ModemManager1NetworkSmsDeviceHandler&) = delete; + ModemManager1NetworkSmsDeviceHandler& operator=( + const ModemManager1NetworkSmsDeviceHandler&) = delete; + ~ModemManager1NetworkSmsDeviceHandler() override; private: @@ -70,8 +76,6 @@ class NetworkSmsHandler::ModemManager1NetworkSmsDeviceHandler base::circular_deque retrieval_queue_; base::WeakPtrFactory weak_ptr_factory_{ this}; - - DISALLOW_COPY_AND_ASSIGN(ModemManager1NetworkSmsDeviceHandler); }; NetworkSmsHandler::ModemManager1NetworkSmsDeviceHandler:: diff --git a/chromeos/network/network_sms_handler.h b/chromeos/network/network_sms_handler.h index 824b207e9a0189..a5fb03bd9aa44a 100644 --- a/chromeos/network/network_sms_handler.h +++ b/chromeos/network/network_sms_handler.h @@ -41,6 +41,9 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkSmsHandler virtual void MessageReceived(const base::Value& message) = 0; }; + NetworkSmsHandler(const NetworkSmsHandler&) = delete; + NetworkSmsHandler& operator=(const NetworkSmsHandler&) = delete; + ~NetworkSmsHandler() override; // Requests an immediate check for new messages. @@ -99,8 +102,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkSmsHandler std::vector received_messages_; std::string cellular_device_path_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(NetworkSmsHandler); }; } // namespace chromeos diff --git a/chromeos/network/network_state.h b/chromeos/network/network_state.h index 3ec66f6ba19649..d4364cd32c85df 100644 --- a/chromeos/network/network_state.h +++ b/chromeos/network/network_state.h @@ -45,6 +45,10 @@ class DeviceState; class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkState : public ManagedState { public: explicit NetworkState(const std::string& path); + + NetworkState(const NetworkState&) = delete; + NetworkState& operator=(const NetworkState&) = delete; + ~NetworkState() override; struct VpnProviderInfo { @@ -385,8 +389,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkState : public ManagedState { // Set by NetworkStateHandler if Chrome detects a captive portal state. // See IsCaptivePortal() for details. bool is_chrome_captive_portal_ = false; - - DISALLOW_COPY_AND_ASSIGN(NetworkState); }; } // namespace chromeos diff --git a/chromeos/network/network_state_handler.h b/chromeos/network/network_state_handler.h index 878278cafacf58..a2570182eba5c8 100644 --- a/chromeos/network/network_state_handler.h +++ b/chromeos/network/network_state_handler.h @@ -115,6 +115,9 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkStateHandler TECHNOLOGY_PROHIBITED }; + NetworkStateHandler(const NetworkStateHandler&) = delete; + NetworkStateHandler& operator=(const NetworkStateHandler&) = delete; + ~NetworkStateHandler() override; // Called just before destruction to give observers a chance to remove @@ -773,8 +776,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkStateHandler bool is_user_logged_in_ = false; SEQUENCE_CHECKER(sequence_checker_); - - DISALLOW_COPY_AND_ASSIGN(NetworkStateHandler); }; } // namespace chromeos diff --git a/chromeos/network/network_state_handler_observer.h b/chromeos/network/network_state_handler_observer.h index df3aa07ea1b742..26a464edf28679 100644 --- a/chromeos/network/network_state_handler_observer.h +++ b/chromeos/network/network_state_handler_observer.h @@ -22,6 +22,11 @@ class DeviceState; class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkStateHandlerObserver { public: NetworkStateHandlerObserver(); + + NetworkStateHandlerObserver(const NetworkStateHandlerObserver&) = delete; + NetworkStateHandlerObserver& operator=(const NetworkStateHandlerObserver&) = + delete; + virtual ~NetworkStateHandlerObserver(); // The list of networks changed. @@ -85,9 +90,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkStateHandlerObserver { // Called just before NetworkStateHandler is destroyed so that observers // can safely stop observing. virtual void OnShuttingDown(); - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkStateHandlerObserver); }; } // namespace chromeos diff --git a/chromeos/network/network_state_handler_unittest.cc b/chromeos/network/network_state_handler_unittest.cc index 808d816a4696e6..c84b584fb2dcf5 100644 --- a/chromeos/network/network_state_handler_unittest.cc +++ b/chromeos/network/network_state_handler_unittest.cc @@ -108,6 +108,10 @@ base::Value GenerateSimSlotInfosWithEid(const std::string& eid) { class TestObserver final : public chromeos::NetworkStateHandlerObserver { public: explicit TestObserver(NetworkStateHandler* handler) : handler_(handler) {} + + TestObserver(const TestObserver&) = delete; + TestObserver& operator=(const TestObserver&) = delete; + ~TestObserver() override = default; void DeviceListChanged() override { @@ -295,13 +299,15 @@ class TestObserver final : public chromeos::NetworkStateHandlerObserver { absl::optional run_loop_scan_started_; absl::optional run_loop_scan_completed_; std::vector> service_path_transitions_; - - DISALLOW_COPY_AND_ASSIGN(TestObserver); }; class TestTetherSortDelegate : public NetworkStateHandler::TetherSortDelegate { public: TestTetherSortDelegate() = default; + + TestTetherSortDelegate(const TestTetherSortDelegate&) = delete; + TestTetherSortDelegate& operator=(const TestTetherSortDelegate&) = delete; + ~TestTetherSortDelegate() = default; // NetworkStateHandler::TetherSortDelegate: @@ -319,9 +325,6 @@ class TestTetherSortDelegate : public NetworkStateHandler::TetherSortDelegate { return first_network->guid() >= second_network->guid(); }); } - - private: - DISALLOW_COPY_AND_ASSIGN(TestTetherSortDelegate); }; } // namespace @@ -335,6 +338,10 @@ class NetworkStateHandlerTest : public testing::Test { manager_test_(nullptr), profile_test_(nullptr), service_test_(nullptr) {} + + NetworkStateHandlerTest(const NetworkStateHandlerTest&) = delete; + NetworkStateHandlerTest& operator=(const NetworkStateHandlerTest&) = delete; + ~NetworkStateHandlerTest() override = default; void SetUp() override { @@ -453,9 +460,6 @@ class NetworkStateHandlerTest : public testing::Test { ShillManagerClient::TestInterface* manager_test_; ShillProfileClient::TestInterface* profile_test_; ShillServiceClient::TestInterface* service_test_; - - private: - DISALLOW_COPY_AND_ASSIGN(NetworkStateHandlerTest); }; TEST_F(NetworkStateHandlerTest, NetworkStateHandlerStub) { diff --git a/chromeos/network/onc/onc_certificate_importer.h b/chromeos/network/onc/onc_certificate_importer.h index 0e1fd0907ef7de..7f8e32ec64c592 100644 --- a/chromeos/network/onc/onc_certificate_importer.h +++ b/chromeos/network/onc/onc_certificate_importer.h @@ -24,6 +24,10 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) CertificateImporter { typedef base::OnceCallback DoneCallback; CertificateImporter() {} + + CertificateImporter(const CertificateImporter&) = delete; + CertificateImporter& operator=(const CertificateImporter&) = delete; + virtual ~CertificateImporter() {} // This is intended for user-initiated ONC imports. @@ -49,9 +53,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) CertificateImporter { const std::vector& client_certificates, DoneCallback done_callback) = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(CertificateImporter); }; } // namespace onc diff --git a/chromeos/network/onc/onc_certificate_importer_impl.h b/chromeos/network/onc/onc_certificate_importer_impl.h index 32f3184f478ff7..45d2047bb90bf2 100644 --- a/chromeos/network/onc/onc_certificate_importer_impl.h +++ b/chromeos/network/onc/onc_certificate_importer_impl.h @@ -42,6 +42,10 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) CertificateImporterImpl CertificateImporterImpl( const scoped_refptr& io_task_runner, net::NSSCertDatabase* target_nssdb_); + + CertificateImporterImpl(const CertificateImporterImpl&) = delete; + CertificateImporterImpl& operator=(const CertificateImporterImpl&) = delete; + ~CertificateImporterImpl() override; // CertificateImporter overrides @@ -102,8 +106,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) CertificateImporterImpl net::NSSCertDatabase* target_nssdb_; base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(CertificateImporterImpl); }; } // namespace onc diff --git a/chromeos/network/onc/onc_certificate_pattern_unittest.cc b/chromeos/network/onc/onc_certificate_pattern_unittest.cc index 637abb5b183894..3f9e0e2cc38ff3 100644 --- a/chromeos/network/onc/onc_certificate_pattern_unittest.cc +++ b/chromeos/network/onc/onc_certificate_pattern_unittest.cc @@ -23,6 +23,11 @@ constexpr char kFakePemEncodedIssuer[] = "PEM-ENCODED-ISSUER"; class OncCertificatePatternTest : public testing::Test { public: OncCertificatePatternTest() = default; + + OncCertificatePatternTest(const OncCertificatePatternTest&) = delete; + OncCertificatePatternTest& operator=(const OncCertificatePatternTest&) = + delete; + ~OncCertificatePatternTest() override = default; void SetUp() override { @@ -35,8 +40,6 @@ class OncCertificatePatternTest : public testing::Test { protected: scoped_refptr cert_; - - DISALLOW_COPY_AND_ASSIGN(OncCertificatePatternTest); }; } // namespace diff --git a/chromeos/network/onc/onc_mapper.h b/chromeos/network/onc/onc_mapper.h index e2f22024ec32b0..87520852796062 100644 --- a/chromeos/network/onc/onc_mapper.h +++ b/chromeos/network/onc/onc_mapper.h @@ -38,6 +38,10 @@ struct OncValueSignature; class COMPONENT_EXPORT(CHROMEOS_NETWORK) Mapper { public: Mapper(); + + Mapper(const Mapper&) = delete; + Mapper& operator=(const Mapper&) = delete; + virtual ~Mapper(); protected: @@ -105,9 +109,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) Mapper { const OncValueSignature& signature, const base::Value& onc_value, bool* error); - - private: - DISALLOW_COPY_AND_ASSIGN(Mapper); }; } // namespace onc diff --git a/chromeos/network/onc/onc_merger.cc b/chromeos/network/onc/onc_merger.cc index dc455ebf08fb37..507c8ab0feb5a1 100644 --- a/chromeos/network/onc/onc_merger.cc +++ b/chromeos/network/onc/onc_merger.cc @@ -82,6 +82,9 @@ class MergeListOfDictionaries { MergeListOfDictionaries() = default; + MergeListOfDictionaries(const MergeListOfDictionaries&) = delete; + MergeListOfDictionaries& operator=(const MergeListOfDictionaries&) = delete; + virtual ~MergeListOfDictionaries() = default; // For each path in any of the dictionaries |dicts|, either MergeListOfValues @@ -135,9 +138,6 @@ class MergeListOfDictionaries { const ValuePtrs& dicts) { return MergeDictionaries(dicts); } - - private: - DISALLOW_COPY_AND_ASSIGN(MergeListOfDictionaries); }; // This is the base class for merging policies and user settings. diff --git a/chromeos/network/onc/onc_normalizer.h b/chromeos/network/onc/onc_normalizer.h index 7a673764acc31f..c64343a21ae065 100644 --- a/chromeos/network/onc/onc_normalizer.h +++ b/chromeos/network/onc/onc_normalizer.h @@ -19,6 +19,10 @@ struct OncValueSignature; class COMPONENT_EXPORT(CHROMEOS_NETWORK) Normalizer : public Mapper { public: explicit Normalizer(bool remove_recommended_fields); + + Normalizer(const Normalizer&) = delete; + Normalizer& operator=(const Normalizer&) = delete; + ~Normalizer() override; // Removes all fields that are ignored/irrelevant because of the value of @@ -53,8 +57,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) Normalizer : public Mapper { void NormalizeStaticIPConfigForNetwork(base::DictionaryValue* network); const bool remove_recommended_fields_; - - DISALLOW_COPY_AND_ASSIGN(Normalizer); }; } // namespace onc diff --git a/chromeos/network/onc/onc_validator.h b/chromeos/network/onc/onc_validator.h index ab9501b3057c1d..1dfb103ea7ce61 100644 --- a/chromeos/network/onc/onc_validator.h +++ b/chromeos/network/onc/onc_validator.h @@ -100,6 +100,9 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) Validator : public Mapper { bool managed_onc, bool log_warnings); + Validator(const Validator&) = delete; + Validator& operator=(const Validator&) = delete; + ~Validator() override; // Sets the ONC source to |source|. If not set, defaults to ONC_SOURCE_NONE. @@ -293,8 +296,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) Validator : public Mapper { // List of all validation issues that occured within validation initiated by // function ValidateAndRepairObject. std::vector validation_issues_; - - DISALLOW_COPY_AND_ASSIGN(Validator); }; } // namespace onc diff --git a/chromeos/network/onc/variable_expander.h b/chromeos/network/onc/variable_expander.h index eea36059a67975..f8f1eebf2d69a1 100644 --- a/chromeos/network/onc/variable_expander.h +++ b/chromeos/network/onc/variable_expander.h @@ -36,6 +36,9 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) VariableExpander { // Takes a map of variables to values. explicit VariableExpander(std::map variables); + VariableExpander(const VariableExpander&) = delete; + VariableExpander& operator=(const VariableExpander&) = delete; + ~VariableExpander(); // Expands all variables in |str|. Returns true if no error has occurred. @@ -52,8 +55,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) VariableExpander { private: // Maps variable -> value. const std::map variables_; - - DISALLOW_COPY_AND_ASSIGN(VariableExpander); }; } // namespace chromeos diff --git a/chromeos/network/portal_detector/mock_network_portal_detector.h b/chromeos/network/portal_detector/mock_network_portal_detector.h index e3956820e00561..92d3e0d81a9490 100644 --- a/chromeos/network/portal_detector/mock_network_portal_detector.h +++ b/chromeos/network/portal_detector/mock_network_portal_detector.h @@ -13,6 +13,11 @@ namespace chromeos { class MockNetworkPortalDetector : public NetworkPortalDetector { public: MockNetworkPortalDetector(); + + MockNetworkPortalDetector(const MockNetworkPortalDetector&) = delete; + MockNetworkPortalDetector& operator=(const MockNetworkPortalDetector&) = + delete; + ~MockNetworkPortalDetector() override; MOCK_METHOD1(AddObserver, @@ -28,9 +33,6 @@ class MockNetworkPortalDetector : public NetworkPortalDetector { MOCK_METHOD0(StartPortalDetection, void()); MOCK_METHOD1(SetStrategy, void(chromeos::PortalDetectorStrategy::StrategyId id)); - - private: - DISALLOW_COPY_AND_ASSIGN(MockNetworkPortalDetector); }; } // namespace chromeos diff --git a/chromeos/network/portal_detector/network_portal_detector_strategy.cc b/chromeos/network/portal_detector/network_portal_detector_strategy.cc index c7030cb2976ac9..9b7a2e1628eaee 100644 --- a/chromeos/network/portal_detector/network_portal_detector_strategy.cc +++ b/chromeos/network/portal_detector/network_portal_detector_strategy.cc @@ -27,6 +27,10 @@ class LoginScreenStrategy : public PortalDetectorStrategy { explicit LoginScreenStrategy(PortalDetectorStrategy::Delegate* delegate) : PortalDetectorStrategy(delegate) {} + + LoginScreenStrategy(const LoginScreenStrategy&) = delete; + LoginScreenStrategy& operator=(const LoginScreenStrategy&) = delete; + ~LoginScreenStrategy() override = default; protected: @@ -44,9 +48,6 @@ class LoginScreenStrategy : public PortalDetectorStrategy { } return base::TimeDelta::FromSeconds(kBaseAttemptTimeoutSec); } - - private: - DISALLOW_COPY_AND_ASSIGN(LoginScreenStrategy); }; class ErrorScreenStrategy : public PortalDetectorStrategy { @@ -55,6 +56,10 @@ class ErrorScreenStrategy : public PortalDetectorStrategy { explicit ErrorScreenStrategy(PortalDetectorStrategy::Delegate* delegate) : PortalDetectorStrategy(delegate) {} + + ErrorScreenStrategy(const ErrorScreenStrategy&) = delete; + ErrorScreenStrategy& operator=(const ErrorScreenStrategy&) = delete; + ~ErrorScreenStrategy() override = default; protected: @@ -63,9 +68,6 @@ class ErrorScreenStrategy : public PortalDetectorStrategy { base::TimeDelta GetNextAttemptTimeoutImpl() override { return base::TimeDelta::FromSeconds(kAttemptTimeoutSec); } - - private: - DISALLOW_COPY_AND_ASSIGN(ErrorScreenStrategy); }; class SessionStrategy : public PortalDetectorStrategy { @@ -76,6 +78,10 @@ class SessionStrategy : public PortalDetectorStrategy { explicit SessionStrategy(PortalDetectorStrategy::Delegate* delegate) : PortalDetectorStrategy(delegate) {} + + SessionStrategy(const SessionStrategy&) = delete; + SessionStrategy& operator=(const SessionStrategy&) = delete; + ~SessionStrategy() override = default; protected: @@ -88,9 +94,6 @@ class SessionStrategy : public PortalDetectorStrategy { timeout = kSlowAttemptTimeoutSec; return base::TimeDelta::FromSeconds(timeout); } - - private: - DISALLOW_COPY_AND_ASSIGN(SessionStrategy); }; } // namespace diff --git a/chromeos/network/portal_detector/network_portal_detector_strategy.h b/chromeos/network/portal_detector/network_portal_detector_strategy.h index ce4ed2ac7e2c44..0dd440f2743445 100644 --- a/chromeos/network/portal_detector/network_portal_detector_strategy.h +++ b/chromeos/network/portal_detector/network_portal_detector_strategy.h @@ -36,6 +36,9 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) PortalDetectorStrategy { virtual base::TimeTicks AttemptStartTime() = 0; }; + PortalDetectorStrategy(const PortalDetectorStrategy&) = delete; + PortalDetectorStrategy& operator=(const PortalDetectorStrategy&) = delete; + virtual ~PortalDetectorStrategy(); // Lifetime of delegate must enclose lifetime of PortalDetectorStrategy. @@ -106,8 +109,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) PortalDetectorStrategy { // True when |next_attempt_timeout_for_testing_| is initialized. static bool next_attempt_timeout_for_testing_initialized_; - - DISALLOW_COPY_AND_ASSIGN(PortalDetectorStrategy); }; } // namespace chromeos diff --git a/chromeos/network/portal_detector/network_portal_detector_stub.h b/chromeos/network/portal_detector/network_portal_detector_stub.h index 825ee73ec40f56..54ab87f4e48191 100644 --- a/chromeos/network/portal_detector/network_portal_detector_stub.h +++ b/chromeos/network/portal_detector/network_portal_detector_stub.h @@ -14,6 +14,11 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkPortalDetectorStub : public NetworkPortalDetector { public: NetworkPortalDetectorStub(); + + NetworkPortalDetectorStub(const NetworkPortalDetectorStub&) = delete; + NetworkPortalDetectorStub& operator=(const NetworkPortalDetectorStub&) = + delete; + ~NetworkPortalDetectorStub() override; private: @@ -26,8 +31,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkPortalDetectorStub void Enable(bool start_detection) override; void StartPortalDetection() override; void SetStrategy(PortalDetectorStrategy::StrategyId id) override; - - DISALLOW_COPY_AND_ASSIGN(NetworkPortalDetectorStub); }; } // namespace chromeos diff --git a/chromeos/network/prohibited_technologies_handler.h b/chromeos/network/prohibited_technologies_handler.h index 7322baa38838c9..395dc96b7fcf39 100644 --- a/chromeos/network/prohibited_technologies_handler.h +++ b/chromeos/network/prohibited_technologies_handler.h @@ -21,6 +21,10 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) ProhibitedTechnologiesHandler : public LoginState::Observer, public NetworkPolicyObserver { public: + ProhibitedTechnologiesHandler(const ProhibitedTechnologiesHandler&) = delete; + ProhibitedTechnologiesHandler& operator=( + const ProhibitedTechnologiesHandler&) = delete; + ~ProhibitedTechnologiesHandler() override; // LoginState::Observer @@ -63,8 +67,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) ProhibitedTechnologiesHandler NetworkStateHandler* network_state_handler_ = nullptr; bool user_logged_in_ = false; bool user_policy_applied_ = false; - - DISALLOW_COPY_AND_ASSIGN(ProhibitedTechnologiesHandler); }; } // namespace chromeos diff --git a/chromeos/network/proxy/proxy_config_service_impl.h b/chromeos/network/proxy/proxy_config_service_impl.h index 132a6f32c865dc..b4d6df6f41bc95 100644 --- a/chromeos/network/proxy/proxy_config_service_impl.h +++ b/chromeos/network/proxy/proxy_config_service_impl.h @@ -49,6 +49,10 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) ProxyConfigServiceImpl PrefService* profile_prefs, PrefService* local_state_prefs, scoped_refptr io_task_runner); + + ProxyConfigServiceImpl(const ProxyConfigServiceImpl&) = delete; + ProxyConfigServiceImpl& operator=(const ProxyConfigServiceImpl&) = delete; + ~ProxyConfigServiceImpl() override; // PrefProxyConfigTrackerImpl implementation. @@ -100,8 +104,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) ProxyConfigServiceImpl PrefService* local_state_prefs_; base::WeakPtrFactory pointer_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceImpl); }; } // namespace chromeos diff --git a/chromeos/network/proxy/ui_proxy_config_service.h b/chromeos/network/proxy/ui_proxy_config_service.h index cc8b66aea629c9..180b42a70356cd 100644 --- a/chromeos/network/proxy/ui_proxy_config_service.h +++ b/chromeos/network/proxy/ui_proxy_config_service.h @@ -42,6 +42,10 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) UIProxyConfigService { PrefService* local_state_prefs, NetworkStateHandler* network_state_handler, NetworkProfileHandler* network_profile_handler); + + UIProxyConfigService(const UIProxyConfigService&) = delete; + UIProxyConfigService& operator=(const UIProxyConfigService&) = delete; + ~UIProxyConfigService(); // Generates ONC dictionary for proxy settings enforced for the network, and @@ -85,8 +89,6 @@ class COMPONENT_EXPORT(CHROMEOS_NETWORK) UIProxyConfigService { NetworkStateHandler* network_state_handler_; // unowned NetworkProfileHandler* network_profile_handler_; // unowned - - DISALLOW_COPY_AND_ASSIGN(UIProxyConfigService); }; } // namespace chromeos diff --git a/chromeos/network/shill_property_handler.cc b/chromeos/network/shill_property_handler.cc index db673c4c24de98..fd327e17a040d3 100644 --- a/chromeos/network/shill_property_handler.cc +++ b/chromeos/network/shill_property_handler.cc @@ -76,6 +76,9 @@ class ShillPropertyObserver : public ShillPropertyChangedObserver { } } + ShillPropertyObserver(const ShillPropertyObserver&) = delete; + ShillPropertyObserver& operator=(const ShillPropertyObserver&) = delete; + ~ShillPropertyObserver() override { switch (type_) { case ManagedState::MANAGED_TYPE_NETWORK: @@ -99,8 +102,6 @@ class ShillPropertyObserver : public ShillPropertyChangedObserver { ManagedState::ManagedType type_; std::string path_; Handler handler_; - - DISALLOW_COPY_AND_ASSIGN(ShillPropertyObserver); }; //------------------------------------------------------------------------------ diff --git a/chromeos/network/shill_property_handler_unittest.cc b/chromeos/network/shill_property_handler_unittest.cc index 985dc50acdae03..c3d7903f4abe19 100644 --- a/chromeos/network/shill_property_handler_unittest.cc +++ b/chromeos/network/shill_property_handler_unittest.cc @@ -179,6 +179,10 @@ class ShillPropertyHandlerTest : public testing::Test { device_test_(NULL), service_test_(NULL), profile_test_(NULL) {} + + ShillPropertyHandlerTest(const ShillPropertyHandlerTest&) = delete; + ShillPropertyHandlerTest& operator=(const ShillPropertyHandlerTest&) = delete; + ~ShillPropertyHandlerTest() override = default; void SetUp() override { @@ -281,9 +285,6 @@ class ShillPropertyHandlerTest : public testing::Test { ShillDeviceClient::TestInterface* device_test_; ShillServiceClient::TestInterface* service_test_; ShillProfileClient::TestInterface* profile_test_; - - private: - DISALLOW_COPY_AND_ASSIGN(ShillPropertyHandlerTest); }; TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerStub) { diff --git a/chromeos/process_proxy/process_output_watcher.h b/chromeos/process_proxy/process_output_watcher.h index 318d5353a63218..48c56229b7c53d 100644 --- a/chromeos/process_proxy/process_output_watcher.h +++ b/chromeos/process_proxy/process_output_watcher.h @@ -32,6 +32,10 @@ using ProcessOutputCallback = base::RepeatingCallback< class COMPONENT_EXPORT(CHROMEOS_PROCESS_PROXY) ProcessOutputWatcher { public: ProcessOutputWatcher(int out_fd, const ProcessOutputCallback& callback); + + ProcessOutputWatcher(const ProcessOutputWatcher&) = delete; + ProcessOutputWatcher& operator=(const ProcessOutputWatcher&) = delete; + ~ProcessOutputWatcher(); void Start(); @@ -70,8 +74,6 @@ class COMPONENT_EXPORT(CHROMEOS_PROCESS_PROXY) ProcessOutputWatcher { ProcessOutputCallback on_read_callback_; base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ProcessOutputWatcher); }; } // namespace chromeos diff --git a/chromeos/services/assistant/assistant_manager_service_impl.h b/chromeos/services/assistant/assistant_manager_service_impl.h index 1f83c9b0b0d0c4..da8b3bece03f44 100644 --- a/chromeos/services/assistant/assistant_manager_service_impl.h +++ b/chromeos/services/assistant/assistant_manager_service_impl.h @@ -107,6 +107,10 @@ class COMPONENT_EXPORT(ASSISTANT_SERVICE) AssistantManagerServiceImpl std::unique_ptr libassistant_service_host = nullptr); + AssistantManagerServiceImpl(const AssistantManagerServiceImpl&) = delete; + AssistantManagerServiceImpl& operator=(const AssistantManagerServiceImpl&) = + delete; + ~AssistantManagerServiceImpl() override; // assistant::AssistantManagerService overrides: @@ -270,8 +274,6 @@ class COMPONENT_EXPORT(ASSISTANT_SERVICE) AssistantManagerServiceImpl base::ObserverList state_observers_; base::WeakPtrFactory weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(AssistantManagerServiceImpl); }; } // namespace assistant diff --git a/chromeos/services/assistant/assistant_manager_service_impl_unittest.cc b/chromeos/services/assistant/assistant_manager_service_impl_unittest.cc index 41f7f79048d994..edebea8436050c 100644 --- a/chromeos/services/assistant/assistant_manager_service_impl_unittest.cc +++ b/chromeos/services/assistant/assistant_manager_service_impl_unittest.cc @@ -101,17 +101,24 @@ class FakeLibassistantServiceHost : public LibassistantServiceHost { class StateObserverMock : public AssistantManagerService::StateObserver { public: StateObserverMock() = default; + + StateObserverMock(const StateObserverMock&) = delete; + StateObserverMock& operator=(const StateObserverMock&) = delete; + ~StateObserverMock() override = default; MOCK_METHOD(void, OnStateChanged, (AssistantManagerService::State new_state)); - - private: - DISALLOW_COPY_AND_ASSIGN(StateObserverMock); }; class AssistantManagerServiceImplTest : public testing::Test { public: AssistantManagerServiceImplTest() = default; + + AssistantManagerServiceImplTest(const AssistantManagerServiceImplTest&) = + delete; + AssistantManagerServiceImplTest& operator=( + const AssistantManagerServiceImplTest&) = delete; + ~AssistantManagerServiceImplTest() override = default; void SetUp() override { @@ -247,8 +254,6 @@ class AssistantManagerServiceImplTest : public testing::Test { scoped_refptr shared_url_loader_factory_; std::unique_ptr assistant_manager_service_; - - DISALLOW_COPY_AND_ASSIGN(AssistantManagerServiceImplTest); }; class SpeakerIdEnrollmentControllerMock diff --git a/chromeos/services/assistant/assistant_settings_impl.h b/chromeos/services/assistant/assistant_settings_impl.h index 6db5892970e0dd..93367b391b24b4 100644 --- a/chromeos/services/assistant/assistant_settings_impl.h +++ b/chromeos/services/assistant/assistant_settings_impl.h @@ -29,6 +29,10 @@ class ServiceContext; class AssistantSettingsImpl : public AssistantSettings { public: explicit AssistantSettingsImpl(ServiceContext* context); + + AssistantSettingsImpl(const AssistantSettingsImpl&) = delete; + AssistantSettingsImpl& operator=(const AssistantSettingsImpl&) = delete; + ~AssistantSettingsImpl() override; void Initialize( @@ -70,8 +74,6 @@ class AssistantSettingsImpl : public AssistantSettings { speaker_id_enrollment_remote_; base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(AssistantSettingsImpl); }; } // namespace assistant diff --git a/chromeos/services/assistant/audio_decoder/assistant_audio_decoder.h b/chromeos/services/assistant/audio_decoder/assistant_audio_decoder.h index 8d10b9f68e3a35..922e042ce5ad42 100644 --- a/chromeos/services/assistant/audio_decoder/assistant_audio_decoder.h +++ b/chromeos/services/assistant/audio_decoder/assistant_audio_decoder.h @@ -29,6 +29,10 @@ class AssistantAudioDecoder : public mojom::AssistantAudioDecoder { AssistantAudioDecoder( mojo::PendingRemote client, mojo::PendingRemote data_source); + + AssistantAudioDecoder(const AssistantAudioDecoder&) = delete; + AssistantAudioDecoder& operator=(const AssistantAudioDecoder&) = delete; + ~AssistantAudioDecoder() override; // Called by |client_| on main thread. @@ -74,8 +78,6 @@ class AssistantAudioDecoder : public mojom::AssistantAudioDecoder { std::unique_ptr media_thread_; base::WeakPtrFactory weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(AssistantAudioDecoder); }; } // namespace assistant diff --git a/chromeos/services/assistant/audio_decoder/assistant_audio_decoder_factory.h b/chromeos/services/assistant/audio_decoder/assistant_audio_decoder_factory.h index 7dbe09d2283251..bb77b7969cb989 100644 --- a/chromeos/services/assistant/audio_decoder/assistant_audio_decoder_factory.h +++ b/chromeos/services/assistant/audio_decoder/assistant_audio_decoder_factory.h @@ -18,6 +18,11 @@ class AssistantAudioDecoderFactory public: explicit AssistantAudioDecoderFactory( mojo::PendingReceiver receiver); + + AssistantAudioDecoderFactory(const AssistantAudioDecoderFactory&) = delete; + AssistantAudioDecoderFactory& operator=(const AssistantAudioDecoderFactory&) = + delete; + ~AssistantAudioDecoderFactory() override; private: @@ -29,8 +34,6 @@ class AssistantAudioDecoderFactory override; mojo::Receiver receiver_; - - DISALLOW_COPY_AND_ASSIGN(AssistantAudioDecoderFactory); }; } // namespace assistant diff --git a/chromeos/services/assistant/audio_decoder/ipc_data_source.h b/chromeos/services/assistant/audio_decoder/ipc_data_source.h index 0d00921aa75c63..d7148d93954400 100644 --- a/chromeos/services/assistant/audio_decoder/ipc_data_source.h +++ b/chromeos/services/assistant/audio_decoder/ipc_data_source.h @@ -25,6 +25,10 @@ class IPCDataSource : public media::DataSource { // May only be called on the utility thread. explicit IPCDataSource( mojo::PendingRemote media_data_source); + + IPCDataSource(const IPCDataSource&) = delete; + IPCDataSource& operator=(const IPCDataSource&) = delete; + ~IPCDataSource() override; // media::DataSource implementation. The methods may be called on any single @@ -55,8 +59,6 @@ class IPCDataSource : public media::DataSource { // Enforces that the DataSource methods are called on one other thread only. THREAD_CHECKER(data_source_thread_checker_); - - DISALLOW_COPY_AND_ASSIGN(IPCDataSource); }; } // namespace assistant diff --git a/chromeos/services/assistant/media_session/assistant_media_session.h b/chromeos/services/assistant/media_session/assistant_media_session.h index 954f2f37bb25f2..e9b9826fef8a19 100644 --- a/chromeos/services/assistant/media_session/assistant_media_session.h +++ b/chromeos/services/assistant/media_session/assistant_media_session.h @@ -28,6 +28,10 @@ class COMPONENT_EXPORT(ASSISTANT_SERVICE) AssistantMediaSession : public media_session::mojom::MediaSession { public: explicit AssistantMediaSession(MediaHost* host); + + AssistantMediaSession(const AssistantMediaSession&) = delete; + AssistantMediaSession& operator=(const AssistantMediaSession&) = delete; + ~AssistantMediaSession() override; // media_session.mojom.MediaSession overrides: @@ -131,8 +135,6 @@ class COMPONENT_EXPORT(ASSISTANT_SERVICE) AssistantMediaSession base::UnguessableToken::Null(); base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(AssistantMediaSession); }; } // namespace assistant diff --git a/chromeos/services/assistant/service.cc b/chromeos/services/assistant/service.cc index 941e456f456023..6e6c35e97c5404 100644 --- a/chromeos/services/assistant/service.cc +++ b/chromeos/services/assistant/service.cc @@ -130,6 +130,10 @@ class ScopedAshSessionObserver { class Service::Context : public ServiceContext { public: explicit Context(Service* parent) : parent_(parent) {} + + Context(const Context&) = delete; + Context& operator=(const Context&) = delete; + ~Context() override = default; // ServiceContext: @@ -176,8 +180,6 @@ class Service::Context : public ServiceContext { private: Service* const parent_; // |this| is owned by |parent_|. - - DISALLOW_COPY_AND_ASSIGN(Context); }; Service::Service(std::unique_ptr diff --git a/chromeos/services/assistant/service.h b/chromeos/services/assistant/service.h index e553d116bd0b77..c5b512e30301d4 100644 --- a/chromeos/services/assistant/service.h +++ b/chromeos/services/assistant/service.h @@ -68,6 +68,10 @@ class COMPONENT_EXPORT(ASSISTANT_SERVICE) Service Service(std::unique_ptr pending_url_loader_factory, signin::IdentityManager* identity_manager); + + Service(const Service&) = delete; + Service& operator=(const Service&) = delete; + ~Service() override; // Allows tests to override the S3 server URI used by the service. @@ -193,8 +197,6 @@ class COMPONENT_EXPORT(ASSISTANT_SERVICE) Service SEQUENCE_CHECKER(sequence_checker_); base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(Service); }; } // namespace assistant diff --git a/chromeos/services/assistant/test_support/fake_assistant_manager_service_impl.h b/chromeos/services/assistant/test_support/fake_assistant_manager_service_impl.h index 913f87f0efaefa..23cfd170c87acd 100644 --- a/chromeos/services/assistant/test_support/fake_assistant_manager_service_impl.h +++ b/chromeos/services/assistant/test_support/fake_assistant_manager_service_impl.h @@ -30,6 +30,12 @@ class COMPONENT_EXPORT(ASSISTANT_SERVICE) FakeAssistantManagerServiceImpl : public AssistantManagerService { public: FakeAssistantManagerServiceImpl(); + + FakeAssistantManagerServiceImpl(const FakeAssistantManagerServiceImpl&) = + delete; + FakeAssistantManagerServiceImpl& operator=( + const FakeAssistantManagerServiceImpl&) = delete; + ~FakeAssistantManagerServiceImpl() override; void FinishStart(); @@ -99,8 +105,6 @@ class COMPONENT_EXPORT(ASSISTANT_SERVICE) FakeAssistantManagerServiceImpl absl::optional access_token_; FakeAssistantSettingsImpl assistant_settings_; base::ObserverList state_observers_; - - DISALLOW_COPY_AND_ASSIGN(FakeAssistantManagerServiceImpl); }; } // namespace assistant diff --git a/chromeos/services/assistant/test_support/fully_initialized_assistant_state.h b/chromeos/services/assistant/test_support/fully_initialized_assistant_state.h index 51486cdd2a7a29..928c5700135499 100644 --- a/chromeos/services/assistant/test_support/fully_initialized_assistant_state.h +++ b/chromeos/services/assistant/test_support/fully_initialized_assistant_state.h @@ -15,14 +15,18 @@ namespace assistant { class FullyInitializedAssistantState : public ash::AssistantState { public: FullyInitializedAssistantState(); + + FullyInitializedAssistantState(const FullyInitializedAssistantState&) = + delete; + FullyInitializedAssistantState& operator=( + const FullyInitializedAssistantState&) = delete; + ~FullyInitializedAssistantState() override = default; void SetAssistantEnabled(bool enabled); private: void InitializeAllValues(); - - DISALLOW_COPY_AND_ASSIGN(FullyInitializedAssistantState); }; } // namespace assistant diff --git a/chromeos/services/assistant/test_support/mock_assistant.h b/chromeos/services/assistant/test_support/mock_assistant.h index a950a864d97cef..bafe0cd571836e 100644 --- a/chromeos/services/assistant/test_support/mock_assistant.h +++ b/chromeos/services/assistant/test_support/mock_assistant.h @@ -19,6 +19,10 @@ namespace assistant { class MockAssistant : public Assistant { public: MockAssistant(); + + MockAssistant(const MockAssistant&) = delete; + MockAssistant& operator=(const MockAssistant&) = delete; + ~MockAssistant() override; MOCK_METHOD1(StartEditReminderInteraction, void(const std::string&)); @@ -51,9 +55,6 @@ class MockAssistant : public Assistant { MOCK_METHOD0(StopAlarmTimerRinging, void()); MOCK_METHOD1(CreateTimer, void(base::TimeDelta)); - - private: - DISALLOW_COPY_AND_ASSIGN(MockAssistant); }; } // namespace assistant diff --git a/chromeos/services/cellular_setup/cellular_setup_base.h b/chromeos/services/cellular_setup/cellular_setup_base.h index 4262329a55beb5..21f7c335208326 100644 --- a/chromeos/services/cellular_setup/cellular_setup_base.h +++ b/chromeos/services/cellular_setup/cellular_setup_base.h @@ -19,6 +19,9 @@ namespace cellular_setup { // derived classes should override them. class CellularSetupBase : public mojom::CellularSetup { public: + CellularSetupBase(const CellularSetupBase&) = delete; + CellularSetupBase& operator=(const CellularSetupBase&) = delete; + ~CellularSetupBase() override; void BindReceiver(mojo::PendingReceiver receiver); @@ -28,8 +31,6 @@ class CellularSetupBase : public mojom::CellularSetup { private: mojo::ReceiverSet receivers_; - - DISALLOW_COPY_AND_ASSIGN(CellularSetupBase); }; } // namespace cellular_setup diff --git a/chromeos/services/cellular_setup/cellular_setup_impl.h b/chromeos/services/cellular_setup/cellular_setup_impl.h index 38a2ed79f4a20a..2ca11cd49f0b85 100644 --- a/chromeos/services/cellular_setup/cellular_setup_impl.h +++ b/chromeos/services/cellular_setup/cellular_setup_impl.h @@ -29,6 +29,9 @@ class CellularSetupImpl : public CellularSetupBase { static void CreateAndBindToReciever( mojo::PendingReceiver receiver); + CellularSetupImpl(const CellularSetupImpl&) = delete; + CellularSetupImpl& operator=(const CellularSetupImpl&) = delete; + ~CellularSetupImpl() override; private: @@ -46,8 +49,6 @@ class CellularSetupImpl : public CellularSetupBase { size_t next_request_id_ = 0u; base::IDMap, size_t> ota_activator_map_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(CellularSetupImpl); }; } // namespace cellular_setup diff --git a/chromeos/services/cellular_setup/cellular_setup_impl_unittest.cc b/chromeos/services/cellular_setup/cellular_setup_impl_unittest.cc index d02e3796f22c74..de84613bb1298c 100644 --- a/chromeos/services/cellular_setup/cellular_setup_impl_unittest.cc +++ b/chromeos/services/cellular_setup/cellular_setup_impl_unittest.cc @@ -29,6 +29,10 @@ namespace { class FakeOtaActivatorFactory : public OtaActivatorImpl::Factory { public: FakeOtaActivatorFactory() = default; + + FakeOtaActivatorFactory(const FakeOtaActivatorFactory&) = delete; + FakeOtaActivatorFactory& operator=(const FakeOtaActivatorFactory&) = delete; + ~FakeOtaActivatorFactory() override = default; std::vector& created_instances() { @@ -58,8 +62,6 @@ class FakeOtaActivatorFactory : public OtaActivatorImpl::Factory { } std::vector created_instances_; - - DISALLOW_COPY_AND_ASSIGN(FakeOtaActivatorFactory); }; } // namespace diff --git a/chromeos/services/cellular_setup/fake_ota_activator.h b/chromeos/services/cellular_setup/fake_ota_activator.h index 29afef890a8da2..8fc37795f0be7a 100644 --- a/chromeos/services/cellular_setup/fake_ota_activator.h +++ b/chromeos/services/cellular_setup/fake_ota_activator.h @@ -18,6 +18,10 @@ namespace cellular_setup { class FakeOtaActivator : public OtaActivator { public: explicit FakeOtaActivator(base::OnceClosure on_finished_callback); + + FakeOtaActivator(const FakeOtaActivator&) = delete; + FakeOtaActivator& operator=(const FakeOtaActivator&) = delete; + ~FakeOtaActivator() override; using OtaActivator::InvokeOnFinishedCallback; @@ -31,8 +35,6 @@ class FakeOtaActivator : public OtaActivator { void OnCarrierPortalStatusChange(mojom::CarrierPortalStatus status) override; FakeCarrierPortalHandler fake_carrier_portal_handler_; - - DISALLOW_COPY_AND_ASSIGN(FakeOtaActivator); }; } // namespace cellular_setup diff --git a/chromeos/services/cellular_setup/ota_activator.h b/chromeos/services/cellular_setup/ota_activator.h index ed188142237c86..47a361efc80674 100644 --- a/chromeos/services/cellular_setup/ota_activator.h +++ b/chromeos/services/cellular_setup/ota_activator.h @@ -22,6 +22,9 @@ namespace cellular_setup { // instance. class OtaActivator : public mojom::CarrierPortalHandler { public: + OtaActivator(const OtaActivator&) = delete; + OtaActivator& operator=(const OtaActivator&) = delete; + ~OtaActivator() override; // Generates a mojo::PendingRemote<> bound to this instance. Only one @@ -36,8 +39,6 @@ class OtaActivator : public mojom::CarrierPortalHandler { base::OnceClosure on_finished_callback_; mojo::Receiver receiver_{this}; - - DISALLOW_COPY_AND_ASSIGN(OtaActivator); }; } // namespace cellular_setup diff --git a/chromeos/services/cellular_setup/public/cpp/fake_activation_delegate.h b/chromeos/services/cellular_setup/public/cpp/fake_activation_delegate.h index bbb5997c7fdadd..fc76d788ec3a31 100644 --- a/chromeos/services/cellular_setup/public/cpp/fake_activation_delegate.h +++ b/chromeos/services/cellular_setup/public/cpp/fake_activation_delegate.h @@ -20,6 +20,10 @@ namespace cellular_setup { class FakeActivationDelegate : public mojom::ActivationDelegate { public: FakeActivationDelegate(); + + FakeActivationDelegate(const FakeActivationDelegate&) = delete; + FakeActivationDelegate& operator=(const FakeActivationDelegate&) = delete; + ~FakeActivationDelegate() override; mojo::PendingRemote GenerateRemote(); @@ -44,8 +48,6 @@ class FakeActivationDelegate : public mojom::ActivationDelegate { std::vector activation_results_; mojo::ReceiverSet receivers_; - - DISALLOW_COPY_AND_ASSIGN(FakeActivationDelegate); }; } // namespace cellular_setup diff --git a/chromeos/services/cellular_setup/public/cpp/fake_carrier_portal_handler.h b/chromeos/services/cellular_setup/public/cpp/fake_carrier_portal_handler.h index 80877c54fc2ded..0a96f28ec97740 100644 --- a/chromeos/services/cellular_setup/public/cpp/fake_carrier_portal_handler.h +++ b/chromeos/services/cellular_setup/public/cpp/fake_carrier_portal_handler.h @@ -20,6 +20,10 @@ namespace cellular_setup { class FakeCarrierPortalHandler : public mojom::CarrierPortalHandler { public: FakeCarrierPortalHandler(); + + FakeCarrierPortalHandler(const FakeCarrierPortalHandler&) = delete; + FakeCarrierPortalHandler& operator=(const FakeCarrierPortalHandler&) = delete; + ~FakeCarrierPortalHandler() override; mojo::PendingRemote GenerateRemote(); @@ -35,8 +39,6 @@ class FakeCarrierPortalHandler : public mojom::CarrierPortalHandler { private: std::vector status_updates_; mojo::ReceiverSet receivers_; - - DISALLOW_COPY_AND_ASSIGN(FakeCarrierPortalHandler); }; } // namespace cellular_setup diff --git a/chromeos/services/cellular_setup/public/cpp/fake_cellular_setup.h b/chromeos/services/cellular_setup/public/cpp/fake_cellular_setup.h index ab208e565d8aff..9cf01b2d992df3 100644 --- a/chromeos/services/cellular_setup/public/cpp/fake_cellular_setup.h +++ b/chromeos/services/cellular_setup/public/cpp/fake_cellular_setup.h @@ -28,6 +28,11 @@ class FakeCellularSetup : public CellularSetupBase { StartActivationInvocation( mojo::PendingRemote activation_delegate, StartActivationCallback callback); + + StartActivationInvocation(const StartActivationInvocation&) = delete; + StartActivationInvocation& operator=(const StartActivationInvocation&) = + delete; + ~StartActivationInvocation(); mojo::Remote& activation_delegate() { @@ -45,8 +50,6 @@ class FakeCellularSetup : public CellularSetupBase { // Null until ExecuteCallback() has been invoked. std::unique_ptr fake_carrier_portal_observer_; - - DISALLOW_COPY_AND_ASSIGN(StartActivationInvocation); }; FakeCellularSetup(); diff --git a/chromeos/services/device_sync/cryptauth_api_call_flow.h b/chromeos/services/device_sync/cryptauth_api_call_flow.h index a4fc80db77cb3b..c5da4d39128627 100644 --- a/chromeos/services/device_sync/cryptauth_api_call_flow.h +++ b/chromeos/services/device_sync/cryptauth_api_call_flow.h @@ -35,6 +35,10 @@ class CryptAuthApiCallFlow : public OAuth2ApiCallFlow { typedef base::OnceCallback ErrorCallback; CryptAuthApiCallFlow(); + + CryptAuthApiCallFlow(const CryptAuthApiCallFlow&) = delete; + CryptAuthApiCallFlow& operator=(const CryptAuthApiCallFlow&) = delete; + ~CryptAuthApiCallFlow() override; // Starts the API POST request call. @@ -119,8 +123,6 @@ class CryptAuthApiCallFlow : public OAuth2ApiCallFlow { std::unique_ptr partial_network_annotation_; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthApiCallFlow); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_client_impl.h b/chromeos/services/device_sync/cryptauth_client_impl.h index 4c58693e919292..3efb7804d5019f 100644 --- a/chromeos/services/device_sync/cryptauth_client_impl.h +++ b/chromeos/services/device_sync/cryptauth_client_impl.h @@ -48,6 +48,10 @@ class CryptAuthClientImpl : public CryptAuthClient { signin::IdentityManager* identity_manager, scoped_refptr url_loader_factory, const cryptauth::DeviceClassifier& device_classifier); + + CryptAuthClientImpl(const CryptAuthClientImpl&) = delete; + CryptAuthClientImpl& operator=(const CryptAuthClientImpl&) = delete; + ~CryptAuthClientImpl() override; // CryptAuthClient: @@ -196,8 +200,6 @@ class CryptAuthClientImpl : public CryptAuthClient { ErrorCallback error_callback_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthClientImpl); }; // Implementation of CryptAuthClientFactory. @@ -211,6 +213,11 @@ class CryptAuthClientFactoryImpl : public CryptAuthClientFactory { signin::IdentityManager* identity_manager, scoped_refptr url_loader_factory, const cryptauth::DeviceClassifier& device_classifier); + + CryptAuthClientFactoryImpl(const CryptAuthClientFactoryImpl&) = delete; + CryptAuthClientFactoryImpl& operator=(const CryptAuthClientFactoryImpl&) = + delete; + ~CryptAuthClientFactoryImpl() override; // CryptAuthClientFactory: @@ -220,8 +227,6 @@ class CryptAuthClientFactoryImpl : public CryptAuthClientFactory { signin::IdentityManager* identity_manager_; const scoped_refptr url_loader_factory_; const cryptauth::DeviceClassifier device_classifier_; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthClientFactoryImpl); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_client_impl_unittest.cc b/chromeos/services/device_sync/cryptauth_client_impl_unittest.cc index 16975be65f8f56..443e94ff28eb22 100644 --- a/chromeos/services/device_sync/cryptauth_client_impl_unittest.cc +++ b/chromeos/services/device_sync/cryptauth_client_impl_unittest.cc @@ -81,6 +81,10 @@ class MockCryptAuthApiCallFlow : public CryptAuthApiCallFlow { MockCryptAuthApiCallFlow() : CryptAuthApiCallFlow() { SetPartialNetworkTrafficAnnotation(PARTIAL_TRAFFIC_ANNOTATION_FOR_TESTS); } + + MockCryptAuthApiCallFlow(const MockCryptAuthApiCallFlow&) = delete; + MockCryptAuthApiCallFlow& operator=(const MockCryptAuthApiCallFlow&) = delete; + virtual ~MockCryptAuthApiCallFlow() {} void StartPostRequest( @@ -123,9 +127,6 @@ class MockCryptAuthApiCallFlow : public CryptAuthApiCallFlow { const std::string& access_token, ResultCallback& result_callback, ErrorCallback& error_callback)); - - private: - DISALLOW_COPY_AND_ASSIGN(MockCryptAuthApiCallFlow); }; // Callback that should never be invoked. diff --git a/chromeos/services/device_sync/cryptauth_device_activity_getter.h b/chromeos/services/device_sync/cryptauth_device_activity_getter.h index 11c6d59cc96210..da8e081417b69d 100644 --- a/chromeos/services/device_sync/cryptauth_device_activity_getter.h +++ b/chromeos/services/device_sync/cryptauth_device_activity_getter.h @@ -31,6 +31,10 @@ class CryptAuthDeviceActivityGetter { using GetDeviceActivityStatusAttemptErrorCallback = base::OnceCallback; + CryptAuthDeviceActivityGetter(const CryptAuthDeviceActivityGetter&) = delete; + CryptAuthDeviceActivityGetter& operator=( + const CryptAuthDeviceActivityGetter&) = delete; + virtual ~CryptAuthDeviceActivityGetter(); // Starts the GetDevicesActivityStatus portion of the CryptAuth v2 DeviceSync @@ -52,8 +56,6 @@ class CryptAuthDeviceActivityGetter { GetDeviceActivityStatusAttemptFinishedCallback success_callback_; GetDeviceActivityStatusAttemptErrorCallback error_callback_; bool was_get_device_activity_getter_called_ = false; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthDeviceActivityGetter); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_device_manager.h b/chromeos/services/device_sync/cryptauth_device_manager.h index c2b04f57d94cfa..d7424464ec2e2c 100644 --- a/chromeos/services/device_sync/cryptauth_device_manager.h +++ b/chromeos/services/device_sync/cryptauth_device_manager.h @@ -58,6 +58,10 @@ class CryptAuthDeviceManager { }; CryptAuthDeviceManager(); + + CryptAuthDeviceManager(const CryptAuthDeviceManager&) = delete; + CryptAuthDeviceManager& operator=(const CryptAuthDeviceManager&) = delete; + virtual ~CryptAuthDeviceManager(); void AddObserver(Observer* observer); @@ -114,8 +118,6 @@ class CryptAuthDeviceManager { private: base::ObserverList::Unchecked observers_; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthDeviceManager); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_device_manager_impl_unittest.cc b/chromeos/services/device_sync/cryptauth_device_manager_impl_unittest.cc index 1a613a61efbe22..ac06028e16b5df 100644 --- a/chromeos/services/device_sync/cryptauth_device_manager_impl_unittest.cc +++ b/chromeos/services/device_sync/cryptauth_device_manager_impl_unittest.cc @@ -400,6 +400,10 @@ class TestCryptAuthDeviceManager : public CryptAuthDeviceManagerImpl { SetSyncSchedulerForTest(base::WrapUnique(scoped_sync_scheduler_)); } + TestCryptAuthDeviceManager(const TestCryptAuthDeviceManager&) = delete; + TestCryptAuthDeviceManager& operator=(const TestCryptAuthDeviceManager&) = + delete; + ~TestCryptAuthDeviceManager() override {} base::WeakPtr GetSyncScheduler() { @@ -416,8 +420,6 @@ class TestCryptAuthDeviceManager : public CryptAuthDeviceManagerImpl { // This should be safe because the life-time this SyncScheduler will always be // within the life of the TestCryptAuthDeviceManager object. base::WeakPtrFactory weak_sync_scheduler_factory_; - - DISALLOW_COPY_AND_ASSIGN(TestCryptAuthDeviceManager); }; } // namespace diff --git a/chromeos/services/device_sync/cryptauth_device_notifier.h b/chromeos/services/device_sync/cryptauth_device_notifier.h index 6a664722ce3118..62bfb10326d91f 100644 --- a/chromeos/services/device_sync/cryptauth_device_notifier.h +++ b/chromeos/services/device_sync/cryptauth_device_notifier.h @@ -24,6 +24,10 @@ namespace device_sync { class CryptAuthDeviceNotifier { public: CryptAuthDeviceNotifier() = default; + + CryptAuthDeviceNotifier(const CryptAuthDeviceNotifier&) = delete; + CryptAuthDeviceNotifier& operator=(const CryptAuthDeviceNotifier&) = delete; + virtual ~CryptAuthDeviceNotifier() = default; // Sends a GCM message to devices with Instance IDs |device_ids|. The message @@ -37,9 +41,6 @@ class CryptAuthDeviceNotifier { CryptAuthFeatureType feature_type, base::OnceClosure success_callback, base::OnceCallback error_callback) = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(CryptAuthDeviceNotifier); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_device_registry.h b/chromeos/services/device_sync/cryptauth_device_registry.h index a547c0d10dbe8c..fbd1c3bb530082 100644 --- a/chromeos/services/device_sync/cryptauth_device_registry.h +++ b/chromeos/services/device_sync/cryptauth_device_registry.h @@ -22,6 +22,9 @@ class CryptAuthDeviceRegistry { public: using InstanceIdToDeviceMap = base::flat_map; + CryptAuthDeviceRegistry(const CryptAuthDeviceRegistry&) = delete; + CryptAuthDeviceRegistry& operator=(const CryptAuthDeviceRegistry&) = delete; + virtual ~CryptAuthDeviceRegistry(); // Returns a map from Instance ID to CryptAuthDevice. @@ -55,8 +58,6 @@ class CryptAuthDeviceRegistry { private: InstanceIdToDeviceMap instance_id_to_device_map_; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthDeviceRegistry); }; std::ostream& operator<<(std::ostream& stream, diff --git a/chromeos/services/device_sync/cryptauth_device_syncer.h b/chromeos/services/device_sync/cryptauth_device_syncer.h index bd876a587dca1d..da56a6a5d01ed5 100644 --- a/chromeos/services/device_sync/cryptauth_device_syncer.h +++ b/chromeos/services/device_sync/cryptauth_device_syncer.h @@ -65,6 +65,9 @@ namespace device_sync { // call. For a new DeviceSync attempt, a new object should be created. class CryptAuthDeviceSyncer { public: + CryptAuthDeviceSyncer(const CryptAuthDeviceSyncer&) = delete; + CryptAuthDeviceSyncer& operator=(const CryptAuthDeviceSyncer&) = delete; + virtual ~CryptAuthDeviceSyncer(); // The DeviceSync result is passed by value so that the device syner can be @@ -97,8 +100,6 @@ class CryptAuthDeviceSyncer { private: DeviceSyncAttemptFinishedCallback callback_; bool was_sync_called_ = false; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthDeviceSyncer); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_ecies_encryptor.h b/chromeos/services/device_sync/cryptauth_ecies_encryptor.h index 9db13e9b7eec3b..1dec7b05a6b8d0 100644 --- a/chromeos/services/device_sync/cryptauth_ecies_encryptor.h +++ b/chromeos/services/device_sync/cryptauth_ecies_encryptor.h @@ -43,6 +43,9 @@ class CryptAuthEciesEncryptor { base::OnceCallback&)>; using BatchCallback = base::OnceCallback; + CryptAuthEciesEncryptor(const CryptAuthEciesEncryptor&) = delete; + CryptAuthEciesEncryptor& operator=(const CryptAuthEciesEncryptor&) = delete; + virtual ~CryptAuthEciesEncryptor(); // Encrypts/Decrypts the input payload with the provided key, returning the @@ -80,8 +83,6 @@ class CryptAuthEciesEncryptor { BatchCallback callback); BatchCallback callback_; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthEciesEncryptor); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_enroller_impl.h b/chromeos/services/device_sync/cryptauth_enroller_impl.h index e5baa7fb49e7ef..410633cd9072c0 100644 --- a/chromeos/services/device_sync/cryptauth_enroller_impl.h +++ b/chromeos/services/device_sync/cryptauth_enroller_impl.h @@ -40,6 +40,10 @@ class CryptAuthEnrollerImpl : public CryptAuthEnroller { CryptAuthEnrollerImpl(CryptAuthClientFactory* client_factory, std::unique_ptr secure_message_delegate); + + CryptAuthEnrollerImpl(const CryptAuthEnrollerImpl&) = delete; + CryptAuthEnrollerImpl& operator=(const CryptAuthEnrollerImpl&) = delete; + ~CryptAuthEnrollerImpl() override; // CryptAuthEnroller: @@ -103,8 +107,6 @@ class CryptAuthEnrollerImpl : public CryptAuthEnroller { std::string symmetric_key_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthEnrollerImpl); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_enrollment_manager.h b/chromeos/services/device_sync/cryptauth_enrollment_manager.h index f95ab389c4574e..b78841cd3e43e1 100644 --- a/chromeos/services/device_sync/cryptauth_enrollment_manager.h +++ b/chromeos/services/device_sync/cryptauth_enrollment_manager.h @@ -37,6 +37,11 @@ class CryptAuthEnrollmentManager { }; CryptAuthEnrollmentManager(); + + CryptAuthEnrollmentManager(const CryptAuthEnrollmentManager&) = delete; + CryptAuthEnrollmentManager& operator=(const CryptAuthEnrollmentManager&) = + delete; + virtual ~CryptAuthEnrollmentManager(); void AddObserver(Observer* observer); @@ -91,8 +96,6 @@ class CryptAuthEnrollmentManager { private: base::ObserverList::Unchecked observers_; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthEnrollmentManager); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_enrollment_manager_impl_unittest.cc b/chromeos/services/device_sync/cryptauth_enrollment_manager_impl_unittest.cc index 831a6ae24d578c..60b073cf5eeb52 100644 --- a/chromeos/services/device_sync/cryptauth_enrollment_manager_impl_unittest.cc +++ b/chromeos/services/device_sync/cryptauth_enrollment_manager_impl_unittest.cc @@ -58,6 +58,10 @@ const double kLastExpiredEnrollmentTimeSeconds = class MockCryptAuthEnroller : public CryptAuthEnroller { public: MockCryptAuthEnroller() {} + + MockCryptAuthEnroller(const MockCryptAuthEnroller&) = delete; + MockCryptAuthEnroller& operator=(const MockCryptAuthEnroller&) = delete; + ~MockCryptAuthEnroller() override {} MOCK_METHOD5(Enroll, @@ -66,9 +70,6 @@ class MockCryptAuthEnroller : public CryptAuthEnroller { const cryptauth::GcmDeviceInfo& device_info, cryptauth::InvocationReason invocation_reason, EnrollmentFinishedCallback callback)); - - private: - DISALLOW_COPY_AND_ASSIGN(MockCryptAuthEnroller); }; // Creates MockCryptAuthEnroller instances, and allows expecations to be set @@ -77,6 +78,11 @@ class MockCryptAuthEnrollerFactory : public CryptAuthEnrollerFactory { public: MockCryptAuthEnrollerFactory() : next_cryptauth_enroller_(new NiceMock()) {} + + MockCryptAuthEnrollerFactory(const MockCryptAuthEnrollerFactory&) = delete; + MockCryptAuthEnrollerFactory& operator=(const MockCryptAuthEnrollerFactory&) = + delete; + ~MockCryptAuthEnrollerFactory() override {} // CryptAuthEnrollerFactory: @@ -95,8 +101,6 @@ class MockCryptAuthEnrollerFactory : public CryptAuthEnrollerFactory { // Stores the next CryptAuthEnroller to be created. // Ownership is passed to the caller of |CreateInstance()|. std::unique_ptr next_cryptauth_enroller_; - - DISALLOW_COPY_AND_ASSIGN(MockCryptAuthEnrollerFactory); }; // Harness for testing CryptAuthEnrollmentManager. @@ -121,6 +125,11 @@ class TestCryptAuthEnrollmentManager : public CryptAuthEnrollmentManagerImpl { SetSyncSchedulerForTest(base::WrapUnique(scoped_sync_scheduler_)); } + TestCryptAuthEnrollmentManager(const TestCryptAuthEnrollmentManager&) = + delete; + TestCryptAuthEnrollmentManager& operator=( + const TestCryptAuthEnrollmentManager&) = delete; + ~TestCryptAuthEnrollmentManager() override {} base::WeakPtr GetSyncScheduler() { @@ -137,8 +146,6 @@ class TestCryptAuthEnrollmentManager : public CryptAuthEnrollmentManagerImpl { // This should be safe because the life-time this SyncScheduler will always be // within the life of the TestCryptAuthEnrollmentManager object. base::WeakPtrFactory weak_sync_scheduler_factory_; - - DISALLOW_COPY_AND_ASSIGN(TestCryptAuthEnrollmentManager); }; } // namespace diff --git a/chromeos/services/device_sync/cryptauth_feature_status_getter.h b/chromeos/services/device_sync/cryptauth_feature_status_getter.h index d663d865a60fe2..6850d8380af5c9 100644 --- a/chromeos/services/device_sync/cryptauth_feature_status_getter.h +++ b/chromeos/services/device_sync/cryptauth_feature_status_getter.h @@ -57,6 +57,10 @@ class CryptAuthFeatureStatusGetter { base::OnceCallback; + CryptAuthFeatureStatusGetter(const CryptAuthFeatureStatusGetter&) = delete; + CryptAuthFeatureStatusGetter& operator=(const CryptAuthFeatureStatusGetter&) = + delete; + virtual ~CryptAuthFeatureStatusGetter(); // Starts the BatchGetFeatureStatuses portion of the CryptAuth v2 DeviceSync @@ -83,8 +87,6 @@ class CryptAuthFeatureStatusGetter { private: GetFeatureStatusesAttemptFinishedCallback callback_; bool was_get_feature_statuses_called_ = false; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthFeatureStatusGetter); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_feature_status_setter.h b/chromeos/services/device_sync/cryptauth_feature_status_setter.h index 643fcdfe2c4181..f499d22bbfea94 100644 --- a/chromeos/services/device_sync/cryptauth_feature_status_setter.h +++ b/chromeos/services/device_sync/cryptauth_feature_status_setter.h @@ -25,6 +25,11 @@ namespace device_sync { class CryptAuthFeatureStatusSetter { public: CryptAuthFeatureStatusSetter() = default; + + CryptAuthFeatureStatusSetter(const CryptAuthFeatureStatusSetter&) = delete; + CryptAuthFeatureStatusSetter& operator=(const CryptAuthFeatureStatusSetter&) = + delete; + virtual ~CryptAuthFeatureStatusSetter() = default; // Enables or disables |feature| for the device with device ID |device_id|. @@ -34,9 +39,6 @@ class CryptAuthFeatureStatusSetter { FeatureStatusChange status_change, base::OnceClosure success_callback, base::OnceCallback error_callback) = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(CryptAuthFeatureStatusSetter); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_gcm_manager_impl_unittest.cc b/chromeos/services/device_sync/cryptauth_gcm_manager_impl_unittest.cc index 1f6825759b4edb..e9e93a2f5eac8f 100644 --- a/chromeos/services/device_sync/cryptauth_gcm_manager_impl_unittest.cc +++ b/chromeos/services/device_sync/cryptauth_gcm_manager_impl_unittest.cc @@ -42,6 +42,10 @@ const CryptAuthFeatureType kFeatureType2 = class MockGCMDriver : public gcm::FakeGCMDriver { public: MockGCMDriver() {} + + MockGCMDriver(const MockGCMDriver&) = delete; + MockGCMDriver& operator=(const MockGCMDriver&) = delete; + ~MockGCMDriver() override {} MOCK_METHOD2(AddAppHandler, @@ -52,9 +56,6 @@ class MockGCMDriver : public gcm::FakeGCMDriver { const std::vector& sender_ids)); using gcm::GCMDriver::RegisterFinished; - - private: - DISALLOW_COPY_AND_ASSIGN(MockGCMDriver); }; } // namespace diff --git a/chromeos/services/device_sync/cryptauth_group_private_key_sharer.h b/chromeos/services/device_sync/cryptauth_group_private_key_sharer.h index 41d86d771e5461..0190a7a63bada8 100644 --- a/chromeos/services/device_sync/cryptauth_group_private_key_sharer.h +++ b/chromeos/services/device_sync/cryptauth_group_private_key_sharer.h @@ -36,6 +36,11 @@ class CryptAuthGroupPrivateKeySharer { using ShareGroupPrivateKeyAttemptFinishedCallback = base::OnceCallback; + CryptAuthGroupPrivateKeySharer(const CryptAuthGroupPrivateKeySharer&) = + delete; + CryptAuthGroupPrivateKeySharer& operator=( + const CryptAuthGroupPrivateKeySharer&) = delete; + virtual ~CryptAuthGroupPrivateKeySharer(); // Starts the ShareGroupPrivateKey portion of the CryptAuth v2 DeviceSync @@ -63,8 +68,6 @@ class CryptAuthGroupPrivateKeySharer { private: ShareGroupPrivateKeyAttemptFinishedCallback callback_; bool was_share_group_private_key_called_ = false; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthGroupPrivateKeySharer); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_key_creator.h b/chromeos/services/device_sync/cryptauth_key_creator.h index 93cbea2f1e9c8b..e4b31818d94fdf 100644 --- a/chromeos/services/device_sync/cryptauth_key_creator.h +++ b/chromeos/services/device_sync/cryptauth_key_creator.h @@ -73,6 +73,10 @@ class CryptAuthKeyCreator { }; CryptAuthKeyCreator(); + + CryptAuthKeyCreator(const CryptAuthKeyCreator&) = delete; + CryptAuthKeyCreator& operator=(const CryptAuthKeyCreator&) = delete; + virtual ~CryptAuthKeyCreator(); // A new key is null if key creation fails. @@ -85,8 +89,6 @@ class CryptAuthKeyCreator { keys_to_create, const absl::optional& server_ephemeral_dh, CreateKeysCallback create_keys_callback) = 0; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthKeyCreator); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_key_proof_computer.h b/chromeos/services/device_sync/cryptauth_key_proof_computer.h index cb86e3f981563d..64290ea9cf945a 100644 --- a/chromeos/services/device_sync/cryptauth_key_proof_computer.h +++ b/chromeos/services/device_sync/cryptauth_key_proof_computer.h @@ -46,6 +46,11 @@ class CryptAuthKey; class CryptAuthKeyProofComputer { public: CryptAuthKeyProofComputer() = default; + + CryptAuthKeyProofComputer(const CryptAuthKeyProofComputer&) = delete; + CryptAuthKeyProofComputer& operator=(const CryptAuthKeyProofComputer&) = + delete; + virtual ~CryptAuthKeyProofComputer() = default; // Returns null if key proof computation failed. @@ -56,8 +61,6 @@ class CryptAuthKeyProofComputer { const std::string& payload, const std::string& salt, const absl::optional& info) = 0; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthKeyProofComputer); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_key_registry.h b/chromeos/services/device_sync/cryptauth_key_registry.h index 7f06b72d1c580e..c27898dc8b8990 100644 --- a/chromeos/services/device_sync/cryptauth_key_registry.h +++ b/chromeos/services/device_sync/cryptauth_key_registry.h @@ -22,6 +22,9 @@ class CryptAuthKeyRegistry { using KeyBundleMap = base::flat_map; + CryptAuthKeyRegistry(const CryptAuthKeyRegistry&) = delete; + CryptAuthKeyRegistry& operator=(const CryptAuthKeyRegistry&) = delete; + virtual ~CryptAuthKeyRegistry(); // Returns the underlying map from the key-bundle name to the key bundle. @@ -66,8 +69,6 @@ class CryptAuthKeyRegistry { virtual void OnKeyRegistryUpdated() = 0; KeyBundleMap key_bundles_; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthKeyRegistry); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_metadata_syncer.h b/chromeos/services/device_sync/cryptauth_metadata_syncer.h index 7907ea1f2eeea8..c6216d92134757 100644 --- a/chromeos/services/device_sync/cryptauth_metadata_syncer.h +++ b/chromeos/services/device_sync/cryptauth_metadata_syncer.h @@ -79,6 +79,9 @@ class CryptAuthMetadataSyncer { const absl::optional&, CryptAuthDeviceSyncResult::ResultCode)>; + CryptAuthMetadataSyncer(const CryptAuthMetadataSyncer&) = delete; + CryptAuthMetadataSyncer& operator=(const CryptAuthMetadataSyncer&) = delete; + virtual ~CryptAuthMetadataSyncer(); // Starts the SyncMetadata portion of the CryptAuth v2 DeviceSync flow. @@ -107,8 +110,6 @@ class CryptAuthMetadataSyncer { private: SyncMetadataAttemptFinishedCallback callback_; bool was_sync_metadata_called_ = false; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthMetadataSyncer); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_scheduler.h b/chromeos/services/device_sync/cryptauth_scheduler.h index a7f2c4683286d3..92eccd7d739393 100644 --- a/chromeos/services/device_sync/cryptauth_scheduler.h +++ b/chromeos/services/device_sync/cryptauth_scheduler.h @@ -66,6 +66,9 @@ class CryptAuthScheduler { const cryptauthv2::ClientMetadata& client_metadata) = 0; }; + CryptAuthScheduler(const CryptAuthScheduler&) = delete; + CryptAuthScheduler& operator=(const CryptAuthScheduler&) = delete; + virtual ~CryptAuthScheduler(); // Note: These should only be called once. @@ -144,8 +147,6 @@ class CryptAuthScheduler { private: base::WeakPtr enrollment_delegate_; base::WeakPtr device_sync_delegate_; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthScheduler); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_v2_device_manager.h b/chromeos/services/device_sync/cryptauth_v2_device_manager.h index b26fa0c319b291..bafc5b4ce1e573 100644 --- a/chromeos/services/device_sync/cryptauth_v2_device_manager.h +++ b/chromeos/services/device_sync/cryptauth_v2_device_manager.h @@ -34,6 +34,9 @@ class CryptAuthV2DeviceManager { const CryptAuthDeviceSyncResult& device_sync_result) {} }; + CryptAuthV2DeviceManager(const CryptAuthV2DeviceManager&) = delete; + CryptAuthV2DeviceManager& operator=(const CryptAuthV2DeviceManager&) = delete; + virtual ~CryptAuthV2DeviceManager(); void AddObserver(Observer* observer); @@ -83,8 +86,6 @@ class CryptAuthV2DeviceManager { private: base::ObserverList observers_; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthV2DeviceManager); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_v2_enroller.h b/chromeos/services/device_sync/cryptauth_v2_enroller.h index 59ba1ddaf47322..ea0e94e8e32da6 100644 --- a/chromeos/services/device_sync/cryptauth_v2_enroller.h +++ b/chromeos/services/device_sync/cryptauth_v2_enroller.h @@ -52,6 +52,9 @@ class CryptAuthEnrollmentResult; // call. For a new Enrollment attempt, a new object should be created. class CryptAuthV2Enroller { public: + CryptAuthV2Enroller(const CryptAuthV2Enroller&) = delete; + CryptAuthV2Enroller& operator=(const CryptAuthV2Enroller&) = delete; + virtual ~CryptAuthV2Enroller(); using EnrollmentAttemptFinishedCallback = @@ -90,8 +93,6 @@ class CryptAuthV2Enroller { EnrollmentAttemptFinishedCallback callback_; bool was_enroll_called_ = false; - - DISALLOW_COPY_AND_ASSIGN(CryptAuthV2Enroller); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/cryptauth_v2_enroller_impl_unittest.cc b/chromeos/services/device_sync/cryptauth_v2_enroller_impl_unittest.cc index 6f0a9b2235c1b7..13fb20d14fd258 100644 --- a/chromeos/services/device_sync/cryptauth_v2_enroller_impl_unittest.cc +++ b/chromeos/services/device_sync/cryptauth_v2_enroller_impl_unittest.cc @@ -119,6 +119,11 @@ class FakeCryptAuthKeyProofComputerFactory public: FakeCryptAuthKeyProofComputerFactory() = default; + FakeCryptAuthKeyProofComputerFactory( + const FakeCryptAuthKeyProofComputerFactory&) = delete; + FakeCryptAuthKeyProofComputerFactory& operator=( + const FakeCryptAuthKeyProofComputerFactory&) = delete; + ~FakeCryptAuthKeyProofComputerFactory() override = default; void set_should_return_null_key_proof(bool should_return_null_key_proof) { @@ -134,8 +139,6 @@ class FakeCryptAuthKeyProofComputerFactory } bool should_return_null_key_proof_ = false; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthKeyProofComputerFactory); }; class SyncSingleKeyResponseData { diff --git a/chromeos/services/device_sync/cryptauth_v2_enrollment_manager_impl_unittest.cc b/chromeos/services/device_sync/cryptauth_v2_enrollment_manager_impl_unittest.cc index 97f534b10fe354..e5f80fdb573529 100644 --- a/chromeos/services/device_sync/cryptauth_v2_enrollment_manager_impl_unittest.cc +++ b/chromeos/services/device_sync/cryptauth_v2_enrollment_manager_impl_unittest.cc @@ -73,6 +73,11 @@ class FakeCryptAuthV2EnrollerFactory : public CryptAuthV2EnrollerImpl::Factory { : expected_key_registry_(expected_key_registry), expected_client_factory_(expected_client_factory) {} + FakeCryptAuthV2EnrollerFactory(const FakeCryptAuthV2EnrollerFactory&) = + delete; + FakeCryptAuthV2EnrollerFactory& operator=( + const FakeCryptAuthV2EnrollerFactory&) = delete; + ~FakeCryptAuthV2EnrollerFactory() override = default; const std::vector& created_instances() { @@ -99,8 +104,6 @@ class FakeCryptAuthV2EnrollerFactory : public CryptAuthV2EnrollerImpl::Factory { const CryptAuthClientFactory* expected_client_factory_; std::vector created_instances_; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthV2EnrollerFactory); }; } // namespace diff --git a/chromeos/services/device_sync/device_sync_base.h b/chromeos/services/device_sync/device_sync_base.h index 00877463077496..3d58f020a739b7 100644 --- a/chromeos/services/device_sync/device_sync_base.h +++ b/chromeos/services/device_sync/device_sync_base.h @@ -19,6 +19,9 @@ namespace device_sync { // Base DeviceSync implementation. class DeviceSyncBase : public mojom::DeviceSync { public: + DeviceSyncBase(const DeviceSyncBase&) = delete; + DeviceSyncBase& operator=(const DeviceSyncBase&) = delete; + ~DeviceSyncBase() override; // mojom::DeviceSync: @@ -46,8 +49,6 @@ class DeviceSyncBase : public mojom::DeviceSync { mojo::RemoteSet observers_; mojo::ReceiverSet receivers_; - - DISALLOW_COPY_AND_ASSIGN(DeviceSyncBase); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_cryptauth_device_manager.h b/chromeos/services/device_sync/fake_cryptauth_device_manager.h index 1a167198cab955..b1156c171358b8 100644 --- a/chromeos/services/device_sync/fake_cryptauth_device_manager.h +++ b/chromeos/services/device_sync/fake_cryptauth_device_manager.h @@ -20,6 +20,11 @@ namespace device_sync { class FakeCryptAuthDeviceManager : public CryptAuthDeviceManager { public: FakeCryptAuthDeviceManager(); + + FakeCryptAuthDeviceManager(const FakeCryptAuthDeviceManager&) = delete; + FakeCryptAuthDeviceManager& operator=(const FakeCryptAuthDeviceManager&) = + delete; + ~FakeCryptAuthDeviceManager() override; bool has_started() { return has_started_; } @@ -123,8 +128,6 @@ class FakeCryptAuthDeviceManager : public CryptAuthDeviceManager { std::vector pixel_unlock_keys_; std::vector tether_hosts_; std::vector pixel_tether_hosts_; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthDeviceManager); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_cryptauth_device_notifier.h b/chromeos/services/device_sync/fake_cryptauth_device_notifier.h index 874b20f799c5cd..59656cb62982fb 100644 --- a/chromeos/services/device_sync/fake_cryptauth_device_notifier.h +++ b/chromeos/services/device_sync/fake_cryptauth_device_notifier.h @@ -51,6 +51,11 @@ class FakeCryptAuthDeviceNotifier : public CryptAuthDeviceNotifier { }; FakeCryptAuthDeviceNotifier(); + + FakeCryptAuthDeviceNotifier(const FakeCryptAuthDeviceNotifier&) = delete; + FakeCryptAuthDeviceNotifier& operator=(const FakeCryptAuthDeviceNotifier&) = + delete; + ~FakeCryptAuthDeviceNotifier() override; void set_delegate(Delegate* delegate) { delegate_ = delegate; } @@ -68,14 +73,18 @@ class FakeCryptAuthDeviceNotifier : public CryptAuthDeviceNotifier { Delegate* delegate_ = nullptr; std::vector requests_; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthDeviceNotifier); }; class FakeCryptAuthDeviceNotifierFactory : public CryptAuthDeviceNotifierImpl::Factory { public: FakeCryptAuthDeviceNotifierFactory(); + + FakeCryptAuthDeviceNotifierFactory( + const FakeCryptAuthDeviceNotifierFactory&) = delete; + FakeCryptAuthDeviceNotifierFactory& operator=( + const FakeCryptAuthDeviceNotifierFactory&) = delete; + ~FakeCryptAuthDeviceNotifierFactory() override; const std::vector& instances() const { @@ -104,8 +113,6 @@ class FakeCryptAuthDeviceNotifierFactory std::string last_instance_id_; std::string last_instance_id_token_; CryptAuthClientFactory* last_client_factory_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthDeviceNotifierFactory); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_cryptauth_device_syncer.h b/chromeos/services/device_sync/fake_cryptauth_device_syncer.h index 4b0b59bdfd69e6..4341c35aced1c6 100644 --- a/chromeos/services/device_sync/fake_cryptauth_device_syncer.h +++ b/chromeos/services/device_sync/fake_cryptauth_device_syncer.h @@ -26,6 +26,11 @@ class CryptAuthDeviceSyncResult; class FakeCryptAuthDeviceSyncer : public CryptAuthDeviceSyncer { public: FakeCryptAuthDeviceSyncer(); + + FakeCryptAuthDeviceSyncer(const FakeCryptAuthDeviceSyncer&) = delete; + FakeCryptAuthDeviceSyncer& operator=(const FakeCryptAuthDeviceSyncer&) = + delete; + ~FakeCryptAuthDeviceSyncer() override; const absl::optional& client_metadata() const { @@ -47,14 +52,18 @@ class FakeCryptAuthDeviceSyncer : public CryptAuthDeviceSyncer { absl::optional client_metadata_; absl::optional client_app_metadata_; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthDeviceSyncer); }; class FakeCryptAuthDeviceSyncerFactory : public CryptAuthDeviceSyncerImpl::Factory { public: FakeCryptAuthDeviceSyncerFactory(); + + FakeCryptAuthDeviceSyncerFactory(const FakeCryptAuthDeviceSyncerFactory&) = + delete; + FakeCryptAuthDeviceSyncerFactory& operator=( + const FakeCryptAuthDeviceSyncerFactory&) = delete; + ~FakeCryptAuthDeviceSyncerFactory() override; const std::vector& instances() const { @@ -92,8 +101,6 @@ class FakeCryptAuthDeviceSyncerFactory SyncedBluetoothAddressTracker* last_synced_bluetooth_address_tracker_ = nullptr; PrefService* last_pref_service_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthDeviceSyncerFactory); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_cryptauth_ecies_encryptor.h b/chromeos/services/device_sync/fake_cryptauth_ecies_encryptor.h index 87c24e732aab33..5a95cc17cb62c5 100644 --- a/chromeos/services/device_sync/fake_cryptauth_ecies_encryptor.h +++ b/chromeos/services/device_sync/fake_cryptauth_ecies_encryptor.h @@ -20,6 +20,11 @@ class FakeCryptAuthEciesEncryptor : public CryptAuthEciesEncryptor { enum class Action { kUndefined, kEncryption, kDecryption }; FakeCryptAuthEciesEncryptor(); + + FakeCryptAuthEciesEncryptor(const FakeCryptAuthEciesEncryptor&) = delete; + FakeCryptAuthEciesEncryptor& operator=(const FakeCryptAuthEciesEncryptor&) = + delete; + ~FakeCryptAuthEciesEncryptor() override; void FinishAttempt(Action expected_action, @@ -33,14 +38,18 @@ class FakeCryptAuthEciesEncryptor : public CryptAuthEciesEncryptor { void OnBatchDecryptionStarted() override; Action action_ = Action::kUndefined; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthEciesEncryptor); }; class FakeCryptAuthEciesEncryptorFactory : public CryptAuthEciesEncryptorImpl::Factory { public: FakeCryptAuthEciesEncryptorFactory(); + + FakeCryptAuthEciesEncryptorFactory( + const FakeCryptAuthEciesEncryptorFactory&) = delete; + FakeCryptAuthEciesEncryptorFactory& operator=( + const FakeCryptAuthEciesEncryptorFactory&) = delete; + ~FakeCryptAuthEciesEncryptorFactory() override; FakeCryptAuthEciesEncryptor* instance() { return instance_; } @@ -50,8 +59,6 @@ class FakeCryptAuthEciesEncryptorFactory std::unique_ptr CreateInstance() override; FakeCryptAuthEciesEncryptor* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthEciesEncryptorFactory); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_cryptauth_enrollment_manager.h b/chromeos/services/device_sync/fake_cryptauth_enrollment_manager.h index a2844f6df1ecd8..e5e77bdf2608cf 100644 --- a/chromeos/services/device_sync/fake_cryptauth_enrollment_manager.h +++ b/chromeos/services/device_sync/fake_cryptauth_enrollment_manager.h @@ -22,6 +22,12 @@ namespace device_sync { class FakeCryptAuthEnrollmentManager : public CryptAuthEnrollmentManager { public: FakeCryptAuthEnrollmentManager(); + + FakeCryptAuthEnrollmentManager(const FakeCryptAuthEnrollmentManager&) = + delete; + FakeCryptAuthEnrollmentManager& operator=( + const FakeCryptAuthEnrollmentManager&) = delete; + ~FakeCryptAuthEnrollmentManager() override; void set_last_enrollment_time(base::Time last_enrollment_time) { @@ -92,8 +98,6 @@ class FakeCryptAuthEnrollmentManager : public CryptAuthEnrollmentManager { base::TimeDelta time_to_next_attempt_; std::string user_public_key_; std::string user_private_key_; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthEnrollmentManager); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_cryptauth_feature_status_getter.h b/chromeos/services/device_sync/fake_cryptauth_feature_status_getter.h index e0ad85ab9191b1..d6cccca21cfebb 100644 --- a/chromeos/services/device_sync/fake_cryptauth_feature_status_getter.h +++ b/chromeos/services/device_sync/fake_cryptauth_feature_status_getter.h @@ -27,6 +27,12 @@ class CryptAuthClientFactory; class FakeCryptAuthFeatureStatusGetter : public CryptAuthFeatureStatusGetter { public: FakeCryptAuthFeatureStatusGetter(); + + FakeCryptAuthFeatureStatusGetter(const FakeCryptAuthFeatureStatusGetter&) = + delete; + FakeCryptAuthFeatureStatusGetter& operator=( + const FakeCryptAuthFeatureStatusGetter&) = delete; + ~FakeCryptAuthFeatureStatusGetter() override; // The RequestContext passed to GetFeatureStatuses(). Returns null if @@ -54,14 +60,18 @@ class FakeCryptAuthFeatureStatusGetter : public CryptAuthFeatureStatusGetter { absl::optional request_context_; absl::optional> device_ids_; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthFeatureStatusGetter); }; class FakeCryptAuthFeatureStatusGetterFactory : public CryptAuthFeatureStatusGetterImpl::Factory { public: FakeCryptAuthFeatureStatusGetterFactory(); + + FakeCryptAuthFeatureStatusGetterFactory( + const FakeCryptAuthFeatureStatusGetterFactory&) = delete; + FakeCryptAuthFeatureStatusGetterFactory& operator=( + const FakeCryptAuthFeatureStatusGetterFactory&) = delete; + ~FakeCryptAuthFeatureStatusGetterFactory() override; // Returns a vector of all FakeCryptAuthFeatureStatusGetter instances created @@ -83,8 +93,6 @@ class FakeCryptAuthFeatureStatusGetterFactory std::vector instances_; CryptAuthClientFactory* last_client_factory_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthFeatureStatusGetterFactory); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_cryptauth_feature_status_setter.h b/chromeos/services/device_sync/fake_cryptauth_feature_status_setter.h index 9d233f89234d4b..edeedd052335dc 100644 --- a/chromeos/services/device_sync/fake_cryptauth_feature_status_setter.h +++ b/chromeos/services/device_sync/fake_cryptauth_feature_status_setter.h @@ -50,6 +50,12 @@ class FakeCryptAuthFeatureStatusSetter : public CryptAuthFeatureStatusSetter { }; FakeCryptAuthFeatureStatusSetter(); + + FakeCryptAuthFeatureStatusSetter(const FakeCryptAuthFeatureStatusSetter&) = + delete; + FakeCryptAuthFeatureStatusSetter& operator=( + const FakeCryptAuthFeatureStatusSetter&) = delete; + ~FakeCryptAuthFeatureStatusSetter() override; void set_delegate(Delegate* delegate) { delegate_ = delegate; } @@ -67,14 +73,18 @@ class FakeCryptAuthFeatureStatusSetter : public CryptAuthFeatureStatusSetter { Delegate* delegate_ = nullptr; std::vector requests_; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthFeatureStatusSetter); }; class FakeCryptAuthFeatureStatusSetterFactory : public CryptAuthFeatureStatusSetterImpl::Factory { public: FakeCryptAuthFeatureStatusSetterFactory(); + + FakeCryptAuthFeatureStatusSetterFactory( + const FakeCryptAuthFeatureStatusSetterFactory&) = delete; + FakeCryptAuthFeatureStatusSetterFactory& operator=( + const FakeCryptAuthFeatureStatusSetterFactory&) = delete; + ~FakeCryptAuthFeatureStatusSetterFactory() override; const std::vector& instances() const { @@ -103,8 +113,6 @@ class FakeCryptAuthFeatureStatusSetterFactory std::string last_instance_id_; std::string last_instance_id_token_; CryptAuthClientFactory* last_client_factory_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthFeatureStatusSetterFactory); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_cryptauth_gcm_manager.h b/chromeos/services/device_sync/fake_cryptauth_gcm_manager.h index 2a13dbe376e820..a6b4fc5a138d54 100644 --- a/chromeos/services/device_sync/fake_cryptauth_gcm_manager.h +++ b/chromeos/services/device_sync/fake_cryptauth_gcm_manager.h @@ -25,6 +25,10 @@ class FakeCryptAuthGCMManager : public CryptAuthGCMManager { // enrollment. Pass in an empty |registration_id| to simulate never having // registered successfully. explicit FakeCryptAuthGCMManager(const std::string& registration_id); + + FakeCryptAuthGCMManager(const FakeCryptAuthGCMManager&) = delete; + FakeCryptAuthGCMManager& operator=(const FakeCryptAuthGCMManager&) = delete; + ~FakeCryptAuthGCMManager() override; bool registration_in_progress() { return registration_in_progress_; } @@ -65,8 +69,6 @@ class FakeCryptAuthGCMManager : public CryptAuthGCMManager { std::string registration_id_; base::ObserverList::Unchecked observers_; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthGCMManager); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_cryptauth_group_private_key_sharer.h b/chromeos/services/device_sync/fake_cryptauth_group_private_key_sharer.h index c44216db86d551..6f41500aaa91fd 100644 --- a/chromeos/services/device_sync/fake_cryptauth_group_private_key_sharer.h +++ b/chromeos/services/device_sync/fake_cryptauth_group_private_key_sharer.h @@ -26,6 +26,12 @@ class FakeCryptAuthGroupPrivateKeySharer : public CryptAuthGroupPrivateKeySharer { public: FakeCryptAuthGroupPrivateKeySharer(); + + FakeCryptAuthGroupPrivateKeySharer( + const FakeCryptAuthGroupPrivateKeySharer&) = delete; + FakeCryptAuthGroupPrivateKeySharer& operator=( + const FakeCryptAuthGroupPrivateKeySharer&) = delete; + ~FakeCryptAuthGroupPrivateKeySharer() override; // The RequestContext passed to ShareGroupPrivateKey(). Returns null if @@ -57,14 +63,18 @@ class FakeCryptAuthGroupPrivateKeySharer absl::optional request_context_; std::unique_ptr group_key_; absl::optional id_to_encrypting_key_map_; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthGroupPrivateKeySharer); }; class FakeCryptAuthGroupPrivateKeySharerFactory : public CryptAuthGroupPrivateKeySharerImpl::Factory { public: FakeCryptAuthGroupPrivateKeySharerFactory(); + + FakeCryptAuthGroupPrivateKeySharerFactory( + const FakeCryptAuthGroupPrivateKeySharerFactory&) = delete; + FakeCryptAuthGroupPrivateKeySharerFactory& operator=( + const FakeCryptAuthGroupPrivateKeySharerFactory&) = delete; + ~FakeCryptAuthGroupPrivateKeySharerFactory() override; // Returns a vector of all FakeCryptAuthGroupPrivateKeySharer instances @@ -86,8 +96,6 @@ class FakeCryptAuthGroupPrivateKeySharerFactory std::vector instances_; CryptAuthClientFactory* last_client_factory_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthGroupPrivateKeySharerFactory); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_cryptauth_key_creator.h b/chromeos/services/device_sync/fake_cryptauth_key_creator.h index 8c26066ac5ce2a..8a99440135e7cf 100644 --- a/chromeos/services/device_sync/fake_cryptauth_key_creator.h +++ b/chromeos/services/device_sync/fake_cryptauth_key_creator.h @@ -20,6 +20,10 @@ namespace device_sync { class FakeCryptAuthKeyCreator : public CryptAuthKeyCreator { public: FakeCryptAuthKeyCreator(); + + FakeCryptAuthKeyCreator(const FakeCryptAuthKeyCreator&) = delete; + FakeCryptAuthKeyCreator& operator=(const FakeCryptAuthKeyCreator&) = delete; + ~FakeCryptAuthKeyCreator() override; // CryptAuthKeyCreator: @@ -43,13 +47,17 @@ class FakeCryptAuthKeyCreator : public CryptAuthKeyCreator { base::flat_map keys_to_create_; absl::optional server_ephemeral_dh_; CreateKeysCallback create_keys_callback_; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthKeyCreator); }; class FakeCryptAuthKeyCreatorFactory : public CryptAuthKeyCreatorImpl::Factory { public: FakeCryptAuthKeyCreatorFactory(); + + FakeCryptAuthKeyCreatorFactory(const FakeCryptAuthKeyCreatorFactory&) = + delete; + FakeCryptAuthKeyCreatorFactory& operator=( + const FakeCryptAuthKeyCreatorFactory&) = delete; + ~FakeCryptAuthKeyCreatorFactory() override; FakeCryptAuthKeyCreator* instance() { return instance_; } @@ -59,8 +67,6 @@ class FakeCryptAuthKeyCreatorFactory : public CryptAuthKeyCreatorImpl::Factory { std::unique_ptr CreateInstance() override; FakeCryptAuthKeyCreator* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthKeyCreatorFactory); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_cryptauth_key_proof_computer.h b/chromeos/services/device_sync/fake_cryptauth_key_proof_computer.h index 2799fdfdf434eb..dcd0191c8b02b0 100644 --- a/chromeos/services/device_sync/fake_cryptauth_key_proof_computer.h +++ b/chromeos/services/device_sync/fake_cryptauth_key_proof_computer.h @@ -21,6 +21,11 @@ class CryptAuthKey; class FakeCryptAuthKeyProofComputer : public CryptAuthKeyProofComputer { public: FakeCryptAuthKeyProofComputer(); + + FakeCryptAuthKeyProofComputer(const FakeCryptAuthKeyProofComputer&) = delete; + FakeCryptAuthKeyProofComputer& operator=( + const FakeCryptAuthKeyProofComputer&) = delete; + ~FakeCryptAuthKeyProofComputer() override; // CryptAuthKeyProofComputer: @@ -38,8 +43,6 @@ class FakeCryptAuthKeyProofComputer : public CryptAuthKeyProofComputer { private: // If true, ComputeKeyProof() returns absl::nullopt. bool should_return_null_ = false; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthKeyProofComputer); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_cryptauth_metadata_syncer.h b/chromeos/services/device_sync/fake_cryptauth_metadata_syncer.h index a8b3d2838457b4..06e55820ccd688 100644 --- a/chromeos/services/device_sync/fake_cryptauth_metadata_syncer.h +++ b/chromeos/services/device_sync/fake_cryptauth_metadata_syncer.h @@ -30,6 +30,11 @@ class CryptAuthKey; class FakeCryptAuthMetadataSyncer : public CryptAuthMetadataSyncer { public: FakeCryptAuthMetadataSyncer(); + + FakeCryptAuthMetadataSyncer(const FakeCryptAuthMetadataSyncer&) = delete; + FakeCryptAuthMetadataSyncer& operator=(const FakeCryptAuthMetadataSyncer&) = + delete; + ~FakeCryptAuthMetadataSyncer() override; // The RequestContext passed to SyncMetadata(). Returns null if @@ -70,14 +75,18 @@ class FakeCryptAuthMetadataSyncer : public CryptAuthMetadataSyncer { absl::optional local_device_metadata_; absl::optional initial_group_key_; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthMetadataSyncer); }; class FakeCryptAuthMetadataSyncerFactory : public CryptAuthMetadataSyncerImpl::Factory { public: FakeCryptAuthMetadataSyncerFactory(); + + FakeCryptAuthMetadataSyncerFactory( + const FakeCryptAuthMetadataSyncerFactory&) = delete; + FakeCryptAuthMetadataSyncerFactory& operator=( + const FakeCryptAuthMetadataSyncerFactory&) = delete; + ~FakeCryptAuthMetadataSyncerFactory() override; // Returns a vector of all FakeCryptAuthMetadataSyncer instances created @@ -104,8 +113,6 @@ class FakeCryptAuthMetadataSyncerFactory std::vector instances_; CryptAuthClientFactory* last_client_factory_ = nullptr; PrefService* last_pref_service_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthMetadataSyncerFactory); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_cryptauth_scheduler.h b/chromeos/services/device_sync/fake_cryptauth_scheduler.h index cbb4df39c79631..2459e15439c4c4 100644 --- a/chromeos/services/device_sync/fake_cryptauth_scheduler.h +++ b/chromeos/services/device_sync/fake_cryptauth_scheduler.h @@ -29,6 +29,10 @@ class FakeCryptAuthScheduler : public CryptAuthScheduler { base::TimeDelta::FromHours(12); FakeCryptAuthScheduler(); + + FakeCryptAuthScheduler(const FakeCryptAuthScheduler&) = delete; + FakeCryptAuthScheduler& operator=(const FakeCryptAuthScheduler&) = delete; + ~FakeCryptAuthScheduler() override; size_t num_enrollment_requests() const { return num_enrollment_requests_; } @@ -125,8 +129,6 @@ class FakeCryptAuthScheduler : public CryptAuthScheduler { size_t num_consecutive_device_sync_failures_ = 0u; bool is_waiting_for_enrollment_result_ = false; bool is_waiting_for_device_sync_result_ = false; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthScheduler); }; // Fake CryptAuthScheduler::EnrollmentDelegate implementation. @@ -134,6 +136,12 @@ class FakeCryptAuthSchedulerEnrollmentDelegate : public CryptAuthScheduler::EnrollmentDelegate { public: FakeCryptAuthSchedulerEnrollmentDelegate(); + + FakeCryptAuthSchedulerEnrollmentDelegate( + const FakeCryptAuthSchedulerEnrollmentDelegate&) = delete; + FakeCryptAuthSchedulerEnrollmentDelegate& operator=( + const FakeCryptAuthSchedulerEnrollmentDelegate&) = delete; + ~FakeCryptAuthSchedulerEnrollmentDelegate() override; base::WeakPtr GetWeakPtr(); @@ -160,8 +168,6 @@ class FakeCryptAuthSchedulerEnrollmentDelegate policy_references_from_enrollment_requests_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthSchedulerEnrollmentDelegate); }; // Fake CryptAuthScheduler::DeviceSyncDelegate implementation. @@ -169,6 +175,12 @@ class FakeCryptAuthSchedulerDeviceSyncDelegate : public CryptAuthScheduler::DeviceSyncDelegate { public: FakeCryptAuthSchedulerDeviceSyncDelegate(); + + FakeCryptAuthSchedulerDeviceSyncDelegate( + const FakeCryptAuthSchedulerDeviceSyncDelegate&) = delete; + FakeCryptAuthSchedulerDeviceSyncDelegate& operator=( + const FakeCryptAuthSchedulerDeviceSyncDelegate&) = delete; + ~FakeCryptAuthSchedulerDeviceSyncDelegate() override; base::WeakPtr GetWeakPtr(); @@ -187,8 +199,6 @@ class FakeCryptAuthSchedulerDeviceSyncDelegate client_metadata_from_device_sync_requests_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthSchedulerDeviceSyncDelegate); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_cryptauth_v2_device_manager.h b/chromeos/services/device_sync/fake_cryptauth_v2_device_manager.h index 0b517979e712b1..14fc1f1e60f862 100644 --- a/chromeos/services/device_sync/fake_cryptauth_v2_device_manager.h +++ b/chromeos/services/device_sync/fake_cryptauth_v2_device_manager.h @@ -29,6 +29,11 @@ namespace device_sync { class FakeCryptAuthV2DeviceManager : public CryptAuthV2DeviceManager { public: FakeCryptAuthV2DeviceManager(); + + FakeCryptAuthV2DeviceManager(const FakeCryptAuthV2DeviceManager&) = delete; + FakeCryptAuthV2DeviceManager& operator=(const FakeCryptAuthV2DeviceManager&) = + delete; + ~FakeCryptAuthV2DeviceManager() override; // CryptAuthV2DeviceManager: @@ -79,8 +84,6 @@ class FakeCryptAuthV2DeviceManager : public CryptAuthV2DeviceManager { absl::optional time_to_next_attempt_; CryptAuthDeviceRegistry::InstanceIdToDeviceMap synced_devices_; base::queue force_device_sync_now_requests_; - - DISALLOW_COPY_AND_ASSIGN(FakeCryptAuthV2DeviceManager); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_device_sync.h b/chromeos/services/device_sync/fake_device_sync.h index c40b4c439faed3..f73a961a74ffe6 100644 --- a/chromeos/services/device_sync/fake_device_sync.h +++ b/chromeos/services/device_sync/fake_device_sync.h @@ -18,6 +18,10 @@ namespace device_sync { class FakeDeviceSync : public DeviceSyncBase { public: FakeDeviceSync(); + + FakeDeviceSync(const FakeDeviceSync&) = delete; + FakeDeviceSync& operator=(const FakeDeviceSync&) = delete; + ~FakeDeviceSync() override; using DeviceSyncBase::NotifyOnEnrollmentFinished; @@ -95,8 +99,6 @@ class FakeDeviceSync : public DeviceSyncBase { std::queue get_devices_activity_status_callback_queue_; std::queue get_debug_info_callback_queue_; - - DISALLOW_COPY_AND_ASSIGN(FakeDeviceSync); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_device_sync_observer.h b/chromeos/services/device_sync/fake_device_sync_observer.h index c65c4a550a84d2..46149145f90aa5 100644 --- a/chromeos/services/device_sync/fake_device_sync_observer.h +++ b/chromeos/services/device_sync/fake_device_sync_observer.h @@ -18,6 +18,10 @@ namespace device_sync { class FakeDeviceSyncObserver : public mojom::DeviceSyncObserver { public: FakeDeviceSyncObserver(); + + FakeDeviceSyncObserver(const FakeDeviceSyncObserver&) = delete; + FakeDeviceSyncObserver& operator=(const FakeDeviceSyncObserver&) = delete; + ~FakeDeviceSyncObserver() override; mojo::PendingRemote GenerateRemote(); @@ -34,8 +38,6 @@ class FakeDeviceSyncObserver : public mojom::DeviceSyncObserver { size_t num_sync_events_ = 0u; mojo::ReceiverSet receivers_; - - DISALLOW_COPY_AND_ASSIGN(FakeDeviceSyncObserver); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_remote_device_provider.h b/chromeos/services/device_sync/fake_remote_device_provider.h index ae35de0cc45499..dcd0456bcf3a99 100644 --- a/chromeos/services/device_sync/fake_remote_device_provider.h +++ b/chromeos/services/device_sync/fake_remote_device_provider.h @@ -15,6 +15,10 @@ namespace device_sync { class FakeRemoteDeviceProvider : public RemoteDeviceProvider { public: FakeRemoteDeviceProvider(); + + FakeRemoteDeviceProvider(const FakeRemoteDeviceProvider&) = delete; + FakeRemoteDeviceProvider& operator=(const FakeRemoteDeviceProvider&) = delete; + ~FakeRemoteDeviceProvider() override; void set_synced_remote_devices( @@ -29,8 +33,6 @@ class FakeRemoteDeviceProvider : public RemoteDeviceProvider { private: multidevice::RemoteDeviceList synced_remote_devices_; - - DISALLOW_COPY_AND_ASSIGN(FakeRemoteDeviceProvider); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/fake_software_feature_manager.h b/chromeos/services/device_sync/fake_software_feature_manager.h index 9542d620f55d72..638017df9268ae 100644 --- a/chromeos/services/device_sync/fake_software_feature_manager.h +++ b/chromeos/services/device_sync/fake_software_feature_manager.h @@ -38,6 +38,11 @@ class FakeSoftwareFeatureManager : public SoftwareFeatureManager { base::OnceClosure success_callback, base::OnceCallback error_callback, bool is_exclusive); + + SetSoftwareFeatureStateArgs(const SetSoftwareFeatureStateArgs&) = delete; + SetSoftwareFeatureStateArgs& operator=(const SetSoftwareFeatureStateArgs&) = + delete; + ~SetSoftwareFeatureStateArgs(); std::string public_key; @@ -46,9 +51,6 @@ class FakeSoftwareFeatureManager : public SoftwareFeatureManager { base::OnceClosure success_callback; base::OnceCallback error_callback; bool is_exclusive; - - private: - DISALLOW_COPY_AND_ASSIGN(SetSoftwareFeatureStateArgs); }; struct SetFeatureStatusArgs { @@ -58,6 +60,10 @@ class FakeSoftwareFeatureManager : public SoftwareFeatureManager { FeatureStatusChange status_change, base::OnceClosure success_callback, base::OnceCallback error_callback); + + SetFeatureStatusArgs(const SetFeatureStatusArgs&) = delete; + SetFeatureStatusArgs& operator=(const SetFeatureStatusArgs&) = delete; + ~SetFeatureStatusArgs(); std::string device_id; @@ -65,9 +71,6 @@ class FakeSoftwareFeatureManager : public SoftwareFeatureManager { FeatureStatusChange status_change; base::OnceClosure success_callback; base::OnceCallback error_callback; - - private: - DISALLOW_COPY_AND_ASSIGN(SetFeatureStatusArgs); }; struct FindEligibleDevicesArgs { @@ -77,6 +80,10 @@ class FakeSoftwareFeatureManager : public SoftwareFeatureManager { const std::vector&, const std::vector&)> success_callback, base::OnceCallback error_callback); + + FindEligibleDevicesArgs(const FindEligibleDevicesArgs&) = delete; + FindEligibleDevicesArgs& operator=(const FindEligibleDevicesArgs&) = delete; + ~FindEligibleDevicesArgs(); multidevice::SoftwareFeature software_feature; @@ -84,12 +91,14 @@ class FakeSoftwareFeatureManager : public SoftwareFeatureManager { const std::vector&)> success_callback; base::OnceCallback error_callback; - - private: - DISALLOW_COPY_AND_ASSIGN(FindEligibleDevicesArgs); }; FakeSoftwareFeatureManager(); + + FakeSoftwareFeatureManager(const FakeSoftwareFeatureManager&) = delete; + FakeSoftwareFeatureManager& operator=(const FakeSoftwareFeatureManager&) = + delete; + ~FakeSoftwareFeatureManager() override; void set_delegate(Delegate* delegate) { delegate_ = delegate; } @@ -138,8 +147,6 @@ class FakeSoftwareFeatureManager : public SoftwareFeatureManager { std::vector> set_feature_status_calls_; std::vector> find_eligible_multidevice_host_calls_; - - DISALLOW_COPY_AND_ASSIGN(FakeSoftwareFeatureManager); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/mock_cryptauth_client.h b/chromeos/services/device_sync/mock_cryptauth_client.h index 5996009e4dcc48..5c1c4007ed8d88 100644 --- a/chromeos/services/device_sync/mock_cryptauth_client.h +++ b/chromeos/services/device_sync/mock_cryptauth_client.h @@ -21,6 +21,10 @@ namespace device_sync { class MockCryptAuthClient : public CryptAuthClient { public: MockCryptAuthClient(); + + MockCryptAuthClient(const MockCryptAuthClient&) = delete; + MockCryptAuthClient& operator=(const MockCryptAuthClient&) = delete; + ~MockCryptAuthClient() override; // TODO(https://crbug.com/997268): Update these to use MOCK_METHOD. @@ -98,9 +102,6 @@ class MockCryptAuthClient : public CryptAuthClient { GetDevicesActivityStatusCallback callback, ErrorCallback error_callback)); MOCK_METHOD0(GetAccessTokenUsed, std::string()); - - private: - DISALLOW_COPY_AND_ASSIGN(MockCryptAuthClient); }; class MockCryptAuthClientFactory : public CryptAuthClientFactory { @@ -119,6 +120,11 @@ class MockCryptAuthClientFactory : public CryptAuthClientFactory { // If |mock_type| is STRICT, then StrictMocks will be created. Otherwise, // NiceMocks will be created. explicit MockCryptAuthClientFactory(MockType mock_type); + + MockCryptAuthClientFactory(const MockCryptAuthClientFactory&) = delete; + MockCryptAuthClientFactory& operator=(const MockCryptAuthClientFactory&) = + delete; + ~MockCryptAuthClientFactory() override; // CryptAuthClientFactory: @@ -133,8 +139,6 @@ class MockCryptAuthClientFactory : public CryptAuthClientFactory { // Observers of the factory. base::ObserverList::Unchecked observer_list_; - - DISALLOW_COPY_AND_ASSIGN(MockCryptAuthClientFactory); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/mock_sync_scheduler.h b/chromeos/services/device_sync/mock_sync_scheduler.h index 67f022dfb29ea8..d259af308735c5 100644 --- a/chromeos/services/device_sync/mock_sync_scheduler.h +++ b/chromeos/services/device_sync/mock_sync_scheduler.h @@ -17,6 +17,10 @@ namespace device_sync { class MockSyncScheduler : public SyncScheduler { public: MockSyncScheduler(); + + MockSyncScheduler(const MockSyncScheduler&) = delete; + MockSyncScheduler& operator=(const MockSyncScheduler&) = delete; + ~MockSyncScheduler() override; // SyncScheduler: @@ -28,9 +32,6 @@ class MockSyncScheduler : public SyncScheduler { MOCK_CONST_METHOD0(GetStrategy, Strategy(void)); MOCK_CONST_METHOD0(GetSyncState, SyncState(void)); MOCK_METHOD1(OnSyncCompleted, void(bool success)); - - private: - DISALLOW_COPY_AND_ASSIGN(MockSyncScheduler); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/public/cpp/client_app_metadata_provider.h b/chromeos/services/device_sync/public/cpp/client_app_metadata_provider.h index e3ec30a5e9fa44..2def71c13acf0f 100644 --- a/chromeos/services/device_sync/public/cpp/client_app_metadata_provider.h +++ b/chromeos/services/device_sync/public/cpp/client_app_metadata_provider.h @@ -24,6 +24,11 @@ namespace device_sync { class ClientAppMetadataProvider { public: ClientAppMetadataProvider() = default; + + ClientAppMetadataProvider(const ClientAppMetadataProvider&) = delete; + ClientAppMetadataProvider& operator=(const ClientAppMetadataProvider&) = + delete; + virtual ~ClientAppMetadataProvider() = default; using GetMetadataCallback = base::OnceCallback metadata_requests_; - - DISALLOW_COPY_AND_ASSIGN(FakeClientAppMetadataProvider); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/public/cpp/fake_device_sync_client.h b/chromeos/services/device_sync/public/cpp/fake_device_sync_client.h index 4d7b92908892ec..381c5d1f95a5da 100644 --- a/chromeos/services/device_sync/public/cpp/fake_device_sync_client.h +++ b/chromeos/services/device_sync/public/cpp/fake_device_sync_client.h @@ -84,6 +84,10 @@ class FakeDeviceSyncClient : public DeviceSyncClient { }; FakeDeviceSyncClient(); + + FakeDeviceSyncClient(const FakeDeviceSyncClient&) = delete; + FakeDeviceSyncClient& operator=(const FakeDeviceSyncClient&) = delete; + ~FakeDeviceSyncClient() override; const base::circular_deque& @@ -192,8 +196,6 @@ class FakeDeviceSyncClient : public DeviceSyncClient { get_devices_activity_status_callback_queue_; base::circular_deque get_debug_info_callback_queue_; - - DISALLOW_COPY_AND_ASSIGN(FakeDeviceSyncClient); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/public/cpp/fake_gcm_device_info_provider.h b/chromeos/services/device_sync/public/cpp/fake_gcm_device_info_provider.h index f5d9d589f39058..ba910d721a8068 100644 --- a/chromeos/services/device_sync/public/cpp/fake_gcm_device_info_provider.h +++ b/chromeos/services/device_sync/public/cpp/fake_gcm_device_info_provider.h @@ -18,6 +18,11 @@ class FakeGcmDeviceInfoProvider : public GcmDeviceInfoProvider { public: explicit FakeGcmDeviceInfoProvider( const cryptauth::GcmDeviceInfo& gcm_device_info); + + FakeGcmDeviceInfoProvider(const FakeGcmDeviceInfoProvider&) = delete; + FakeGcmDeviceInfoProvider& operator=(const FakeGcmDeviceInfoProvider&) = + delete; + ~FakeGcmDeviceInfoProvider() override; // GcmDeviceInfoProvider: @@ -25,8 +30,6 @@ class FakeGcmDeviceInfoProvider : public GcmDeviceInfoProvider { private: const cryptauth::GcmDeviceInfo gcm_device_info_; - - DISALLOW_COPY_AND_ASSIGN(FakeGcmDeviceInfoProvider); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/public/cpp/gcm_device_info_provider.h b/chromeos/services/device_sync/public/cpp/gcm_device_info_provider.h index 89884c9904aee9..ab863aabe92188 100644 --- a/chromeos/services/device_sync/public/cpp/gcm_device_info_provider.h +++ b/chromeos/services/device_sync/public/cpp/gcm_device_info_provider.h @@ -18,12 +18,13 @@ namespace device_sync { class GcmDeviceInfoProvider { public: GcmDeviceInfoProvider() = default; + + GcmDeviceInfoProvider(const GcmDeviceInfoProvider&) = delete; + GcmDeviceInfoProvider& operator=(const GcmDeviceInfoProvider&) = delete; + virtual ~GcmDeviceInfoProvider() = default; virtual const cryptauth::GcmDeviceInfo& GetGcmDeviceInfo() const = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(GcmDeviceInfoProvider); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/remote_device_loader_unittest.cc b/chromeos/services/device_sync/remote_device_loader_unittest.cc index 61d6efa2424a40..94ce2be8c4b0a1 100644 --- a/chromeos/services/device_sync/remote_device_loader_unittest.cc +++ b/chromeos/services/device_sync/remote_device_loader_unittest.cc @@ -63,6 +63,11 @@ class DeviceSyncRemoteDeviceLoaderTest : public testing::Test { user_private_key_(secure_message_delegate_->GetPrivateKeyForPublicKey( kUserPublicKey)) {} + DeviceSyncRemoteDeviceLoaderTest(const DeviceSyncRemoteDeviceLoaderTest&) = + delete; + DeviceSyncRemoteDeviceLoaderTest& operator=( + const DeviceSyncRemoteDeviceLoaderTest&) = delete; + ~DeviceSyncRemoteDeviceLoaderTest() {} void OnRemoteDevicesLoaded( @@ -84,8 +89,6 @@ class DeviceSyncRemoteDeviceLoaderTest : public testing::Test { // Stores the result of the RemoteDeviceLoader. multidevice::RemoteDeviceList remote_devices_; - - DISALLOW_COPY_AND_ASSIGN(DeviceSyncRemoteDeviceLoaderTest); }; TEST_F(DeviceSyncRemoteDeviceLoaderTest, LoadZeroDevices) { diff --git a/chromeos/services/device_sync/sync_scheduler.h b/chromeos/services/device_sync/sync_scheduler.h index 69b8aa94bebc72..d7caaaadc351b3 100644 --- a/chromeos/services/device_sync/sync_scheduler.h +++ b/chromeos/services/device_sync/sync_scheduler.h @@ -38,6 +38,10 @@ class SyncScheduler { class SyncRequest { public: explicit SyncRequest(base::WeakPtr sync_scheduler); + + SyncRequest(const SyncRequest&) = delete; + SyncRequest& operator=(const SyncRequest&) = delete; + ~SyncRequest(); void OnDidComplete(bool success); @@ -49,8 +53,6 @@ class SyncScheduler { // True if |OnDidComplete()| has been called. bool completed_; - - DISALLOW_COPY_AND_ASSIGN(SyncRequest); }; // Handles the actual sync operation. diff --git a/chromeos/services/device_sync/sync_scheduler_impl.h b/chromeos/services/device_sync/sync_scheduler_impl.h index e40933702d8ac6..70fa64731866ee 100644 --- a/chromeos/services/device_sync/sync_scheduler_impl.h +++ b/chromeos/services/device_sync/sync_scheduler_impl.h @@ -33,6 +33,9 @@ class SyncSchedulerImpl : public SyncScheduler { double max_jitter_ratio, const std::string& scheduler_name); + SyncSchedulerImpl(const SyncSchedulerImpl&) = delete; + SyncSchedulerImpl& operator=(const SyncSchedulerImpl&) = delete; + ~SyncSchedulerImpl() override; // SyncScheduler: @@ -97,8 +100,6 @@ class SyncSchedulerImpl : public SyncScheduler { std::unique_ptr timer_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl); }; } // namespace device_sync diff --git a/chromeos/services/device_sync/sync_scheduler_impl_unittest.cc b/chromeos/services/device_sync/sync_scheduler_impl_unittest.cc index 2b44273277b100..b94ececa74bdfe 100644 --- a/chromeos/services/device_sync/sync_scheduler_impl_unittest.cc +++ b/chromeos/services/device_sync/sync_scheduler_impl_unittest.cc @@ -54,6 +54,9 @@ class TestSyncSchedulerImpl : public SyncSchedulerImpl { max_jitter_ratio, kTestSchedulerName) {} + TestSyncSchedulerImpl(const TestSyncSchedulerImpl&) = delete; + TestSyncSchedulerImpl& operator=(const TestSyncSchedulerImpl&) = delete; + ~TestSyncSchedulerImpl() override {} base::MockOneShotTimer* timer() { return mock_timer_; } @@ -66,8 +69,6 @@ class TestSyncSchedulerImpl : public SyncSchedulerImpl { // A timer instance for testing. Owned by the parent scheduler. base::MockOneShotTimer* mock_timer_; - - DISALLOW_COPY_AND_ASSIGN(TestSyncSchedulerImpl); }; } // namespace diff --git a/chromeos/services/ime/decoder/decoder_engine.h b/chromeos/services/ime/decoder/decoder_engine.h index 6502268e25b1e8..3397be549cc902 100644 --- a/chromeos/services/ime/decoder/decoder_engine.h +++ b/chromeos/services/ime/decoder/decoder_engine.h @@ -26,6 +26,10 @@ namespace ime { class DecoderEngine : public mojom::InputChannel { public: explicit DecoderEngine(ImeCrosPlatform* platform); + + DecoderEngine(const DecoderEngine&) = delete; + DecoderEngine& operator=(const DecoderEngine&) = delete; + ~DecoderEngine() override; // Binds the mojom::InputChannel interface to this object and returns true if @@ -52,8 +56,6 @@ class DecoderEngine : public mojom::InputChannel { absl::optional decoder_entry_points_; mojo::ReceiverSet decoder_channel_receivers_; - - DISALLOW_COPY_AND_ASSIGN(DecoderEngine); }; } // namespace ime diff --git a/chromeos/services/ime/ime_service.h b/chromeos/services/ime/ime_service.h index 8035f5a2d5fe0f..28a8edcab75a2d 100644 --- a/chromeos/services/ime/ime_service.h +++ b/chromeos/services/ime/ime_service.h @@ -28,6 +28,10 @@ class ImeService : public mojom::ImeService, public ImeCrosPlatform { public: explicit ImeService(mojo::PendingReceiver receiver); + + ImeService(const ImeService&) = delete; + ImeService& operator=(const ImeService&) = delete; + ~ImeService() override; private: @@ -90,8 +94,6 @@ class ImeService : public mojom::ImeService, // Platform delegate for access to privilege resources. mojo::Remote platform_access_; mojo::ReceiverSet manager_receivers_; - - DISALLOW_COPY_AND_ASSIGN(ImeService); }; } // namespace ime diff --git a/chromeos/services/ime/ime_service_unittest.cc b/chromeos/services/ime/ime_service_unittest.cc index b35d1f68d699e4..120564e5279182 100644 --- a/chromeos/services/ime/ime_service_unittest.cc +++ b/chromeos/services/ime/ime_service_unittest.cc @@ -144,6 +144,10 @@ struct MockInputMethodHost : public mojom::InputMethodHost { class ImeServiceTest : public testing::Test, public mojom::InputMethodHost { public: ImeServiceTest() : service_(remote_service_.BindNewPipeAndPassReceiver()) {} + + ImeServiceTest(const ImeServiceTest&) = delete; + ImeServiceTest& operator=(const ImeServiceTest&) = delete; + ~ImeServiceTest() override = default; void CommitText(const std::u16string& text, @@ -182,8 +186,6 @@ class ImeServiceTest : public testing::Test, public mojom::InputMethodHost { base::test::ScopedFeatureList feature_list_; ImeService service_; TestDecoderState state_; - - DISALLOW_COPY_AND_ASSIGN(ImeServiceTest); }; } // namespace diff --git a/chromeos/services/ime/public/cpp/rulebased/engine.h b/chromeos/services/ime/public/cpp/rulebased/engine.h index 9d4b3d288d2d4b..a5f8fc2f345d41 100644 --- a/chromeos/services/ime/public/cpp/rulebased/engine.h +++ b/chromeos/services/ime/public/cpp/rulebased/engine.h @@ -33,6 +33,10 @@ struct ProcessKeyResult { class Engine { public: Engine(); + + Engine(const Engine&) = delete; + Engine& operator=(const Engine&) = delete; + ~Engine(); static bool IsImeSupported(const std::string& id); @@ -62,8 +66,6 @@ class Engine { int history_transat_ = -1; // The history ambiguous string which matches the history prune regexp. std::string history_ambi_; - - DISALLOW_COPY_AND_ASSIGN(Engine); }; } // namespace rulebased diff --git a/chromeos/services/ime/public/cpp/rulebased/rules_data.h b/chromeos/services/ime/public/cpp/rulebased/rules_data.h index 8ebafbbb3c845e..4e1245a8355ff1 100644 --- a/chromeos/services/ime/public/cpp/rulebased/rules_data.h +++ b/chromeos/services/ime/public/cpp/rulebased/rules_data.h @@ -28,6 +28,10 @@ using TransformRule = std::pair, std::string>; class RulesData { public: RulesData(); + + RulesData(const RulesData&) = delete; + RulesData& operator=(const RulesData&) = delete; + ~RulesData(); // Creates the RulesData by the given raw data. @@ -84,8 +88,6 @@ class RulesData { // The history prune regexp which is only used by client code of RulesData. std::unique_ptr history_prune_re_; - - DISALLOW_COPY_AND_ASSIGN(RulesData); }; } // namespace rulebased diff --git a/chromeos/services/libassistant/audio/audio_device_owner.h b/chromeos/services/libassistant/audio/audio_device_owner.h index 63b3178632492e..6ac958e602a6e8 100644 --- a/chromeos/services/libassistant/audio/audio_device_owner.h +++ b/chromeos/services/libassistant/audio/audio_device_owner.h @@ -29,6 +29,10 @@ class AudioDeviceOwner : public media::AudioRendererSink::RenderCallback, media_session::mojom::MediaSessionObserver { public: explicit AudioDeviceOwner(const std::string& device_id); + + AudioDeviceOwner(const AudioDeviceOwner&) = delete; + AudioDeviceOwner& operator=(const AudioDeviceOwner&) = delete; + ~AudioDeviceOwner() override; void Start( @@ -102,8 +106,6 @@ class AudioDeviceOwner : public media::AudioRendererSink::RenderCallback, // so this sequence checker prevents the other methods from being called on // the render sequence. SEQUENCE_CHECKER(sequence_checker_); - - DISALLOW_COPY_AND_ASSIGN(AudioDeviceOwner); }; } // namespace libassistant diff --git a/chromeos/services/libassistant/audio/audio_media_data_source.h b/chromeos/services/libassistant/audio/audio_media_data_source.h index 587f036b3fb32a..85416b53ce01ed 100644 --- a/chromeos/services/libassistant/audio/audio_media_data_source.h +++ b/chromeos/services/libassistant/audio/audio_media_data_source.h @@ -26,6 +26,10 @@ class AudioMediaDataSource explicit AudioMediaDataSource( mojo::PendingReceiver< chromeos::assistant::mojom::AssistantMediaDataSource> receiver); + + AudioMediaDataSource(const AudioMediaDataSource&) = delete; + AudioMediaDataSource& operator=(const AudioMediaDataSource&) = delete; + ~AudioMediaDataSource() override; // chromeos::assistant::mojom::MediaDataSource implementation. @@ -55,8 +59,6 @@ class AudioMediaDataSource ReadCallback read_callback_; base::WeakPtrFactory weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(AudioMediaDataSource); }; } // namespace libassistant diff --git a/chromeos/services/libassistant/audio/audio_output_provider_impl.cc b/chromeos/services/libassistant/audio/audio_output_provider_impl.cc index 6addbe3215cbe1..2bd3ee8353a328 100644 --- a/chromeos/services/libassistant/audio/audio_output_provider_impl.cc +++ b/chromeos/services/libassistant/audio/audio_output_provider_impl.cc @@ -56,6 +56,9 @@ class AudioOutputImpl : public assistant_client::AudioOutput { weak_ptr_factory_.GetWeakPtr(), device_id)); } + AudioOutputImpl(const AudioOutputImpl&) = delete; + AudioOutputImpl& operator=(const AudioOutputImpl&) = delete; + ~AudioOutputImpl() override { main_task_runner_->DeleteSoon(FROM_HERE, device_owner_.release()); main_task_runner_->DeleteSoon(FROM_HERE, audio_stream_handler_.release()); @@ -149,8 +152,6 @@ class AudioOutputImpl : public assistant_client::AudioOutput { SEQUENCE_CHECKER(main_sequence_checker_); base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(AudioOutputImpl); }; } // namespace diff --git a/chromeos/services/libassistant/audio/audio_output_provider_impl.h b/chromeos/services/libassistant/audio/audio_output_provider_impl.h index e0f4c814950799..e7ea10928acb74 100644 --- a/chromeos/services/libassistant/audio/audio_output_provider_impl.h +++ b/chromeos/services/libassistant/audio/audio_output_provider_impl.h @@ -34,6 +34,10 @@ namespace libassistant { class AudioOutputProviderImpl : public assistant_client::AudioOutputProvider { public: explicit AudioOutputProviderImpl(const std::string& device_id); + + AudioOutputProviderImpl(const AudioOutputProviderImpl&) = delete; + AudioOutputProviderImpl& operator=(const AudioOutputProviderImpl&) = delete; + ~AudioOutputProviderImpl() override; void Bind( @@ -83,8 +87,6 @@ class AudioOutputProviderImpl : public assistant_client::AudioOutputProvider { audio_decoder_factory_; std::string device_id_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(AudioOutputProviderImpl); }; } // namespace libassistant diff --git a/chromeos/services/libassistant/audio/audio_output_provider_impl_unittest.cc b/chromeos/services/libassistant/audio/audio_output_provider_impl_unittest.cc index 1eafa58072d63f..5ac1c57c3e3403 100644 --- a/chromeos/services/libassistant/audio/audio_output_provider_impl_unittest.cc +++ b/chromeos/services/libassistant/audio/audio_output_provider_impl_unittest.cc @@ -25,6 +25,9 @@ class FakeAudioOutputDelegate : public assistant_client::AudioOutput::Delegate { public: FakeAudioOutputDelegate() : thread_("assistant") { thread_.Start(); } + FakeAudioOutputDelegate(const FakeAudioOutputDelegate&) = delete; + FakeAudioOutputDelegate& operator=(const FakeAudioOutputDelegate&) = delete; + ~FakeAudioOutputDelegate() override = default; // assistant_client::AudioOutput::Delegate overrides: @@ -81,8 +84,6 @@ class FakeAudioOutputDelegate : public assistant_client::AudioOutput::Delegate { std::unique_ptr run_loop_; int num_bytes_to_fill_ = 0; bool end_of_stream_ = false; - - DISALLOW_COPY_AND_ASSIGN(FakeAudioOutputDelegate); }; class FakeAudioOutputDelegateMojom @@ -110,12 +111,14 @@ class AssistantAudioDeviceOwnerTest : public testing::Test { base::test::TaskEnvironment::MainThreadType::DEFAULT, base::test::TaskEnvironment::ThreadPoolExecutionMode::QUEUED) {} + AssistantAudioDeviceOwnerTest(const AssistantAudioDeviceOwnerTest&) = delete; + AssistantAudioDeviceOwnerTest& operator=( + const AssistantAudioDeviceOwnerTest&) = delete; + ~AssistantAudioDeviceOwnerTest() override { task_env_.RunUntilIdle(); } private: base::test::TaskEnvironment task_env_; - - DISALLOW_COPY_AND_ASSIGN(AssistantAudioDeviceOwnerTest); }; TEST_F(AssistantAudioDeviceOwnerTest, BufferFilling) { diff --git a/chromeos/services/libassistant/audio/audio_stream_handler.h b/chromeos/services/libassistant/audio/audio_stream_handler.h index 709d6048120c27..e42c5a00d94784 100644 --- a/chromeos/services/libassistant/audio/audio_stream_handler.h +++ b/chromeos/services/libassistant/audio/audio_stream_handler.h @@ -26,6 +26,10 @@ class AudioStreamHandler base::OnceCallback; AudioStreamHandler(); + + AudioStreamHandler(const AudioStreamHandler&) = delete; + AudioStreamHandler& operator=(const AudioStreamHandler&) = delete; + ~AudioStreamHandler() override; void StartAudioDecoder( @@ -98,8 +102,6 @@ class AudioStreamHandler SEQUENCE_CHECKER(sequence_checker_); base::WeakPtrFactory weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(AudioStreamHandler); }; } // namespace libassistant diff --git a/chromeos/services/libassistant/audio/volume_control_impl.h b/chromeos/services/libassistant/audio/volume_control_impl.h index 574afa2305cb59..241db85dd3b651 100644 --- a/chromeos/services/libassistant/audio/volume_control_impl.h +++ b/chromeos/services/libassistant/audio/volume_control_impl.h @@ -20,6 +20,10 @@ class VolumeControlImpl : public assistant_client::VolumeControl, public ash::mojom::VolumeObserver { public: VolumeControlImpl(); + + VolumeControlImpl(const VolumeControlImpl&) = delete; + VolumeControlImpl& operator=(const VolumeControlImpl&) = delete; + ~VolumeControlImpl() override; void Initialize(mojom::AudioOutputDelegate* audio_output_delegate, @@ -55,8 +59,6 @@ class VolumeControlImpl : public assistant_client::VolumeControl, bool mute_ = false; base::WeakPtrFactory weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(VolumeControlImpl); }; } // namespace libassistant diff --git a/chromeos/services/libassistant/chromium_api_delegate.h b/chromeos/services/libassistant/chromium_api_delegate.h index 2990b59e8cc91f..420f10af4c2d29 100644 --- a/chromeos/services/libassistant/chromium_api_delegate.h +++ b/chromeos/services/libassistant/chromium_api_delegate.h @@ -28,6 +28,10 @@ class ChromiumApiDelegate : public assistant_client::ChromeOSApiDelegate { explicit ChromiumApiDelegate( std::unique_ptr pending_url_loader_factory); + + ChromiumApiDelegate(const ChromiumApiDelegate&) = delete; + ChromiumApiDelegate& operator=(const ChromiumApiDelegate&) = delete; + ~ChromiumApiDelegate() override; // assistant_client::FuchsiaApiDelegate overrides: assistant_client::HttpConnectionFactory* GetHttpConnectionFactory() override; @@ -38,7 +42,6 @@ class ChromiumApiDelegate : public assistant_client::ChromeOSApiDelegate { private: ChromiumHttpConnectionFactory http_connection_factory_; - DISALLOW_COPY_AND_ASSIGN(ChromiumApiDelegate); }; } // namespace libassistant diff --git a/chromeos/services/libassistant/chromium_http_connection.h b/chromeos/services/libassistant/chromium_http_connection.h index f6e2f8159d8e25..622b55cd459098 100644 --- a/chromeos/services/libassistant/chromium_http_connection.h +++ b/chromeos/services/libassistant/chromium_http_connection.h @@ -136,6 +136,11 @@ class ChromiumHttpConnectionFactory explicit ChromiumHttpConnectionFactory( std::unique_ptr pending_url_loader_factory); + + ChromiumHttpConnectionFactory(const ChromiumHttpConnectionFactory&) = delete; + ChromiumHttpConnectionFactory& operator=( + const ChromiumHttpConnectionFactory&) = delete; + ~ChromiumHttpConnectionFactory() override; // assistant_client::HttpConnectionFactory implementation: @@ -144,8 +149,6 @@ class ChromiumHttpConnectionFactory private: scoped_refptr url_loader_factory_; - - DISALLOW_COPY_AND_ASSIGN(ChromiumHttpConnectionFactory); }; } // namespace libassistant diff --git a/chromeos/services/libassistant/file_provider_impl.h b/chromeos/services/libassistant/file_provider_impl.h index 1f7c9a61b06bfb..78ec467c5a0dcd 100644 --- a/chromeos/services/libassistant/file_provider_impl.h +++ b/chromeos/services/libassistant/file_provider_impl.h @@ -17,6 +17,10 @@ namespace libassistant { class FileProviderImpl : public assistant_client::FileProvider { public: FileProviderImpl(); + + FileProviderImpl(const FileProviderImpl&) = delete; + FileProviderImpl& operator=(const FileProviderImpl&) = delete; + ~FileProviderImpl() override; // assistant_client::FileProvider overrides: @@ -31,8 +35,6 @@ class FileProviderImpl : public assistant_client::FileProvider { private: // Root path which other paths are relative to. const base::FilePath root_path_; - - DISALLOW_COPY_AND_ASSIGN(FileProviderImpl); }; } // namespace libassistant diff --git a/chromeos/services/libassistant/network_provider_impl.h b/chromeos/services/libassistant/network_provider_impl.h index 863c31ac111d57..10e27894d5fbc3 100644 --- a/chromeos/services/libassistant/network_provider_impl.h +++ b/chromeos/services/libassistant/network_provider_impl.h @@ -22,6 +22,10 @@ class COMPONENT_EXPORT(ASSISTANT_SERVICE) NetworkProviderImpl public network_config::mojom::CrosNetworkConfigObserver { public: NetworkProviderImpl(); + + NetworkProviderImpl(const NetworkProviderImpl&) = delete; + NetworkProviderImpl& operator=(const NetworkProviderImpl&) = delete; + ~NetworkProviderImpl() override; void Initialize(mojom::PlatformDelegate* platform_delegate); @@ -48,8 +52,6 @@ class COMPONENT_EXPORT(ASSISTANT_SERVICE) NetworkProviderImpl this}; mojo::Remote cros_network_config_remote_; - - DISALLOW_COPY_AND_ASSIGN(NetworkProviderImpl); }; } // namespace libassistant diff --git a/chromeos/services/libassistant/network_provider_impl_unittest.cc b/chromeos/services/libassistant/network_provider_impl_unittest.cc index 29b1379b311ec9..ae7740b3bf3e05 100644 --- a/chromeos/services/libassistant/network_provider_impl_unittest.cc +++ b/chromeos/services/libassistant/network_provider_impl_unittest.cc @@ -26,6 +26,12 @@ class AssistantNetworkProviderImplTest : public ::testing::Test { AssistantNetworkProviderImplTest() { network_provider_.Initialize(&platform_delegate_); } + + AssistantNetworkProviderImplTest(const AssistantNetworkProviderImplTest&) = + delete; + AssistantNetworkProviderImplTest& operator=( + const AssistantNetworkProviderImplTest&) = delete; + ~AssistantNetworkProviderImplTest() override = default; void PublishConnectionStateType(ConnectionStateType connection_type) { @@ -65,8 +71,6 @@ class AssistantNetworkProviderImplTest : public ::testing::Test { base::test::TaskEnvironment task_environment; assistant::FakePlatformDelegate platform_delegate_; NetworkProviderImpl network_provider_; - - DISALLOW_COPY_AND_ASSIGN(AssistantNetworkProviderImplTest); }; TEST_F(AssistantNetworkProviderImplTest, StartWithStatusUnknown) { diff --git a/chromeos/services/libassistant/power_manager_provider_impl.h b/chromeos/services/libassistant/power_manager_provider_impl.h index 0957abe52fe2d1..5d266ea59a27e3 100644 --- a/chromeos/services/libassistant/power_manager_provider_impl.h +++ b/chromeos/services/libassistant/power_manager_provider_impl.h @@ -39,6 +39,10 @@ class COMPONENT_EXPORT(ASSISTANT_SERVICE) PowerManagerProviderImpl : public assistant_client::PowerManagerProvider { public: PowerManagerProviderImpl(); + + PowerManagerProviderImpl(const PowerManagerProviderImpl&) = delete; + PowerManagerProviderImpl& operator=(const PowerManagerProviderImpl&) = delete; + ~PowerManagerProviderImpl() override; void Initialize(chromeos::libassistant::mojom::PlatformDelegate* delegate); @@ -112,8 +116,6 @@ class COMPONENT_EXPORT(ASSISTANT_SERVICE) PowerManagerProviderImpl const base::TickClock* tick_clock_ = nullptr; base::WeakPtrFactory weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(PowerManagerProviderImpl); }; } // namespace libassistant diff --git a/chromeos/services/libassistant/power_manager_provider_impl_unittest.cc b/chromeos/services/libassistant/power_manager_provider_impl_unittest.cc index 6c3fb4ad97f7d6..f04a13943023b9 100644 --- a/chromeos/services/libassistant/power_manager_provider_impl_unittest.cc +++ b/chromeos/services/libassistant/power_manager_provider_impl_unittest.cc @@ -44,6 +44,12 @@ class AssistantPowerManagerProviderImplTest : public testing::Test { AssistantPowerManagerProviderImplTest() : task_environment_(base::test::TaskEnvironment::MainThreadType::IO, base::test::TaskEnvironment::TimeSource::MOCK_TIME) {} + + AssistantPowerManagerProviderImplTest( + const AssistantPowerManagerProviderImplTest&) = delete; + AssistantPowerManagerProviderImplTest& operator=( + const AssistantPowerManagerProviderImplTest&) = delete; + ~AssistantPowerManagerProviderImplTest() override = default; void SetUp() override { @@ -128,8 +134,6 @@ class AssistantPowerManagerProviderImplTest : public testing::Test { FakePlatformDelegateImpl platform_delegate_{&wake_lock_provider_}; std::unique_ptr power_manager_provider_impl_; - - DISALLOW_COPY_AND_ASSIGN(AssistantPowerManagerProviderImplTest); }; TEST_F(AssistantPowerManagerProviderImplTest, CheckAcquireAndReleaseWakeLock) { diff --git a/chromeos/services/libassistant/system_provider_impl.h b/chromeos/services/libassistant/system_provider_impl.h index b5bb8212b2e1b8..04750aaa124924 100644 --- a/chromeos/services/libassistant/system_provider_impl.h +++ b/chromeos/services/libassistant/system_provider_impl.h @@ -28,6 +28,10 @@ class SystemProviderImpl : public assistant_client::SystemProvider { // platform power manager provider is available. explicit SystemProviderImpl( std::unique_ptr power_manager_provider); + + SystemProviderImpl(const SystemProviderImpl&) = delete; + SystemProviderImpl& operator=(const SystemProviderImpl&) = delete; + ~SystemProviderImpl() override; void Initialize( @@ -51,8 +55,6 @@ class SystemProviderImpl : public assistant_client::SystemProvider { mojo::Remote battery_monitor_; device::mojom::BatteryStatusPtr current_battery_status_; - - DISALLOW_COPY_AND_ASSIGN(SystemProviderImpl); }; } // namespace libassistant diff --git a/chromeos/services/machine_learning/public/cpp/fake_service_connection.h b/chromeos/services/machine_learning/public/cpp/fake_service_connection.h index ba395c6d54692f..277079c25e958e 100644 --- a/chromeos/services/machine_learning/public/cpp/fake_service_connection.h +++ b/chromeos/services/machine_learning/public/cpp/fake_service_connection.h @@ -53,6 +53,11 @@ class COMPONENT_EXPORT(CHROMEOS_MLSERVICE) FakeServiceConnectionImpl public web_platform::mojom::HandwritingRecognizer { public: FakeServiceConnectionImpl(); + + FakeServiceConnectionImpl(const FakeServiceConnectionImpl&) = delete; + FakeServiceConnectionImpl& operator=(const FakeServiceConnectionImpl&) = + delete; + ~FakeServiceConnectionImpl() override; // ServiceConnection: @@ -379,8 +384,6 @@ class COMPONENT_EXPORT(CHROMEOS_MLSERVICE) FakeServiceConnectionImpl bool async_mode_; std::vector pending_calls_; - - DISALLOW_COPY_AND_ASSIGN(FakeServiceConnectionImpl); }; } // namespace machine_learning diff --git a/chromeos/services/multidevice_setup/account_status_change_delegate_notifier.h b/chromeos/services/multidevice_setup/account_status_change_delegate_notifier.h index f081280e8b7fff..5cc825891f820c 100644 --- a/chromeos/services/multidevice_setup/account_status_change_delegate_notifier.h +++ b/chromeos/services/multidevice_setup/account_status_change_delegate_notifier.h @@ -21,6 +21,11 @@ namespace multidevice_setup { // (3) a new Chromebook has been added to an account for someone who has. class AccountStatusChangeDelegateNotifier { public: + AccountStatusChangeDelegateNotifier( + const AccountStatusChangeDelegateNotifier&) = delete; + AccountStatusChangeDelegateNotifier& operator=( + const AccountStatusChangeDelegateNotifier&) = delete; + virtual ~AccountStatusChangeDelegateNotifier(); void SetAccountStatusChangeDelegateRemote( @@ -47,8 +52,6 @@ class AccountStatusChangeDelegateNotifier { void FlushForTesting(); mojo::Remote delegate_remote_; - - DISALLOW_COPY_AND_ASSIGN(AccountStatusChangeDelegateNotifier); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/eligible_host_devices_provider.h b/chromeos/services/multidevice_setup/eligible_host_devices_provider.h index be093ce89135cd..a11e518cc97b76 100644 --- a/chromeos/services/multidevice_setup/eligible_host_devices_provider.h +++ b/chromeos/services/multidevice_setup/eligible_host_devices_provider.h @@ -16,6 +16,10 @@ namespace multidevice_setup { // Provides all remote devices which are eligible to be MultiDevice hosts. class EligibleHostDevicesProvider { public: + EligibleHostDevicesProvider(const EligibleHostDevicesProvider&) = delete; + EligibleHostDevicesProvider& operator=(const EligibleHostDevicesProvider&) = + delete; + virtual ~EligibleHostDevicesProvider() = default; // Returns all eligible host devices sorted by the last time they were updated @@ -34,9 +38,6 @@ class EligibleHostDevicesProvider { protected: EligibleHostDevicesProvider() = default; - - private: - DISALLOW_COPY_AND_ASSIGN(EligibleHostDevicesProvider); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/fake_account_status_change_delegate.h b/chromeos/services/multidevice_setup/fake_account_status_change_delegate.h index 8cacd8da3f8b64..0b8ea591dee18f 100644 --- a/chromeos/services/multidevice_setup/fake_account_status_change_delegate.h +++ b/chromeos/services/multidevice_setup/fake_account_status_change_delegate.h @@ -19,6 +19,12 @@ class FakeAccountStatusChangeDelegate : public mojom::AccountStatusChangeDelegate { public: FakeAccountStatusChangeDelegate(); + + FakeAccountStatusChangeDelegate(const FakeAccountStatusChangeDelegate&) = + delete; + FakeAccountStatusChangeDelegate& operator=( + const FakeAccountStatusChangeDelegate&) = delete; + ~FakeAccountStatusChangeDelegate() override; mojo::PendingRemote GenerateRemote(); @@ -60,8 +66,6 @@ class FakeAccountStatusChangeDelegate size_t num_eligible_for_wifi_sync_events_handled_ = 0u; mojo::ReceiverSet receivers_; - - DISALLOW_COPY_AND_ASSIGN(FakeAccountStatusChangeDelegate); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/fake_account_status_change_delegate_notifier.h b/chromeos/services/multidevice_setup/fake_account_status_change_delegate_notifier.h index 0aaf1cf9c3fc97..d50039e4e55b32 100644 --- a/chromeos/services/multidevice_setup/fake_account_status_change_delegate_notifier.h +++ b/chromeos/services/multidevice_setup/fake_account_status_change_delegate_notifier.h @@ -17,12 +17,15 @@ class FakeAccountStatusChangeDelegateNotifier : public AccountStatusChangeDelegateNotifier { public: FakeAccountStatusChangeDelegateNotifier() = default; + + FakeAccountStatusChangeDelegateNotifier( + const FakeAccountStatusChangeDelegateNotifier&) = delete; + FakeAccountStatusChangeDelegateNotifier& operator=( + const FakeAccountStatusChangeDelegateNotifier&) = delete; + ~FakeAccountStatusChangeDelegateNotifier() override = default; using AccountStatusChangeDelegateNotifier::delegate; - - private: - DISALLOW_COPY_AND_ASSIGN(FakeAccountStatusChangeDelegateNotifier); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/fake_eligible_host_devices_provider.h b/chromeos/services/multidevice_setup/fake_eligible_host_devices_provider.h index 9c37b7c732cc36..f24226192ae7bb 100644 --- a/chromeos/services/multidevice_setup/fake_eligible_host_devices_provider.h +++ b/chromeos/services/multidevice_setup/fake_eligible_host_devices_provider.h @@ -17,6 +17,12 @@ namespace multidevice_setup { class FakeEligibleHostDevicesProvider : public EligibleHostDevicesProvider { public: FakeEligibleHostDevicesProvider(); + + FakeEligibleHostDevicesProvider(const FakeEligibleHostDevicesProvider&) = + delete; + FakeEligibleHostDevicesProvider& operator=( + const FakeEligibleHostDevicesProvider&) = delete; + ~FakeEligibleHostDevicesProvider() override; void set_eligible_host_devices( @@ -38,8 +44,6 @@ class FakeEligibleHostDevicesProvider : public EligibleHostDevicesProvider { multidevice::RemoteDeviceRefList eligible_host_devices_; multidevice::DeviceWithConnectivityStatusList eligible_active_host_devices_; - - DISALLOW_COPY_AND_ASSIGN(FakeEligibleHostDevicesProvider); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/fake_feature_state_manager.h b/chromeos/services/multidevice_setup/fake_feature_state_manager.h index caa32261fa854a..53381a8dcb5095 100644 --- a/chromeos/services/multidevice_setup/fake_feature_state_manager.h +++ b/chromeos/services/multidevice_setup/fake_feature_state_manager.h @@ -18,6 +18,10 @@ namespace multidevice_setup { class FakeFeatureStateManager : public FeatureStateManager { public: FakeFeatureStateManager(); + + FakeFeatureStateManager(const FakeFeatureStateManager&) = delete; + FakeFeatureStateManager& operator=(const FakeFeatureStateManager&) = delete; + ~FakeFeatureStateManager() override; mojom::FeatureState GetFeatureState(mojom::Feature feature); @@ -33,14 +37,18 @@ class FakeFeatureStateManager : public FeatureStateManager { bool enabled) override; FeatureStatesMap feature_states_map_; - - DISALLOW_COPY_AND_ASSIGN(FakeFeatureStateManager); }; // Test FeatureStateManager::Observer implementation. class FakeFeatureStateManagerObserver : public FeatureStateManager::Observer { public: FakeFeatureStateManagerObserver(); + + FakeFeatureStateManagerObserver(const FakeFeatureStateManagerObserver&) = + delete; + FakeFeatureStateManagerObserver& operator=( + const FakeFeatureStateManagerObserver&) = delete; + ~FakeFeatureStateManagerObserver() override; const std::vector& @@ -54,8 +62,6 @@ class FakeFeatureStateManagerObserver : public FeatureStateManager::Observer { const FeatureStateManager::FeatureStatesMap& feature_states_map) override; std::vector feature_state_updates_; - - DISALLOW_COPY_AND_ASSIGN(FakeFeatureStateManagerObserver); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/fake_feature_state_observer.h b/chromeos/services/multidevice_setup/fake_feature_state_observer.h index 61d29267b049ee..e870e1a1ac5be7 100644 --- a/chromeos/services/multidevice_setup/fake_feature_state_observer.h +++ b/chromeos/services/multidevice_setup/fake_feature_state_observer.h @@ -19,6 +19,10 @@ namespace multidevice_setup { class FakeFeatureStateObserver : public mojom::FeatureStateObserver { public: FakeFeatureStateObserver(); + + FakeFeatureStateObserver(const FakeFeatureStateObserver&) = delete; + FakeFeatureStateObserver& operator=(const FakeFeatureStateObserver&) = delete; + ~FakeFeatureStateObserver() override; mojo::PendingRemote GenerateRemote(); @@ -38,8 +42,6 @@ class FakeFeatureStateObserver : public mojom::FeatureStateObserver { feature_state_updates_; mojo::ReceiverSet receivers_; - - DISALLOW_COPY_AND_ASSIGN(FakeFeatureStateObserver); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/fake_host_backend_delegate.h b/chromeos/services/multidevice_setup/fake_host_backend_delegate.h index 690071f2fdb4a7..39caba2faf1de5 100644 --- a/chromeos/services/multidevice_setup/fake_host_backend_delegate.h +++ b/chromeos/services/multidevice_setup/fake_host_backend_delegate.h @@ -18,6 +18,10 @@ namespace multidevice_setup { class FakeHostBackendDelegate : public HostBackendDelegate { public: FakeHostBackendDelegate(); + + FakeHostBackendDelegate(const FakeHostBackendDelegate&) = delete; + FakeHostBackendDelegate& operator=(const FakeHostBackendDelegate&) = delete; + ~FakeHostBackendDelegate() override; // Changes the backend host to |host_device_on_backend| and notifies @@ -44,14 +48,18 @@ class FakeHostBackendDelegate : public HostBackendDelegate { absl::optional> pending_host_request_; absl::optional host_device_on_backend_; - - DISALLOW_COPY_AND_ASSIGN(FakeHostBackendDelegate); }; // Test HostBackendDelegate::Observer implementation. class FakeHostBackendDelegateObserver : public HostBackendDelegate::Observer { public: FakeHostBackendDelegateObserver(); + + FakeHostBackendDelegateObserver(const FakeHostBackendDelegateObserver&) = + delete; + FakeHostBackendDelegateObserver& operator=( + const FakeHostBackendDelegateObserver&) = delete; + ~FakeHostBackendDelegateObserver() override; size_t num_changes_on_backend() const { return num_changes_on_backend_; } @@ -71,8 +79,6 @@ class FakeHostBackendDelegateObserver : public HostBackendDelegate::Observer { size_t num_changes_on_backend_ = 0u; size_t num_failed_backend_requests_ = 0u; size_t num_pending_host_request_changes_ = 0u; - - DISALLOW_COPY_AND_ASSIGN(FakeHostBackendDelegateObserver); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/fake_host_status_observer.h b/chromeos/services/multidevice_setup/fake_host_status_observer.h index 174a457195b33c..97aea55314d371 100644 --- a/chromeos/services/multidevice_setup/fake_host_status_observer.h +++ b/chromeos/services/multidevice_setup/fake_host_status_observer.h @@ -19,6 +19,10 @@ namespace multidevice_setup { class FakeHostStatusObserver : public mojom::HostStatusObserver { public: FakeHostStatusObserver(); + + FakeHostStatusObserver(const FakeHostStatusObserver&) = delete; + FakeHostStatusObserver& operator=(const FakeHostStatusObserver&) = delete; + ~FakeHostStatusObserver() override; mojo::PendingRemote GenerateRemote(); @@ -40,8 +44,6 @@ class FakeHostStatusObserver : public mojom::HostStatusObserver { host_status_updates_; mojo::ReceiverSet receivers_; - - DISALLOW_COPY_AND_ASSIGN(FakeHostStatusObserver); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/fake_host_status_provider.h b/chromeos/services/multidevice_setup/fake_host_status_provider.h index d377e31bae430b..06fb4b173ed2b8 100644 --- a/chromeos/services/multidevice_setup/fake_host_status_provider.h +++ b/chromeos/services/multidevice_setup/fake_host_status_provider.h @@ -18,6 +18,10 @@ namespace multidevice_setup { class FakeHostStatusProvider : public HostStatusProvider { public: FakeHostStatusProvider(); + + FakeHostStatusProvider(const FakeHostStatusProvider&) = delete; + FakeHostStatusProvider& operator=(const FakeHostStatusProvider&) = delete; + ~FakeHostStatusProvider() override; void SetHostWithStatus( @@ -30,14 +34,18 @@ class FakeHostStatusProvider : public HostStatusProvider { private: mojom::HostStatus host_status_ = mojom::HostStatus::kNoEligibleHosts; absl::optional host_device_; - - DISALLOW_COPY_AND_ASSIGN(FakeHostStatusProvider); }; // Test HostStatusProvider::Observer implementation. class FakeHostStatusProviderObserver : public HostStatusProvider::Observer { public: FakeHostStatusProviderObserver(); + + FakeHostStatusProviderObserver(const FakeHostStatusProviderObserver&) = + delete; + FakeHostStatusProviderObserver& operator=( + const FakeHostStatusProviderObserver&) = delete; + ~FakeHostStatusProviderObserver() override; const std::vector& @@ -51,8 +59,6 @@ class FakeHostStatusProviderObserver : public HostStatusProvider::Observer { host_status_with_device) override; std::vector host_status_updates_; - - DISALLOW_COPY_AND_ASSIGN(FakeHostStatusProviderObserver); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/fake_host_verifier.h b/chromeos/services/multidevice_setup/fake_host_verifier.h index ce7ed5ee6f2a5a..31ee28159fa086 100644 --- a/chromeos/services/multidevice_setup/fake_host_verifier.h +++ b/chromeos/services/multidevice_setup/fake_host_verifier.h @@ -16,6 +16,10 @@ namespace multidevice_setup { class FakeHostVerifier : public HostVerifier { public: FakeHostVerifier(); + + FakeHostVerifier(const FakeHostVerifier&) = delete; + FakeHostVerifier& operator=(const FakeHostVerifier&) = delete; + ~FakeHostVerifier() override; void set_is_host_verified(bool is_host_verified) { @@ -33,14 +37,16 @@ class FakeHostVerifier : public HostVerifier { bool is_host_verified_ = false; size_t num_verify_now_attempts_ = 0u; - - DISALLOW_COPY_AND_ASSIGN(FakeHostVerifier); }; // Test HostVerifier::Observer implementation. class FakeHostVerifierObserver : public HostVerifier::Observer { public: FakeHostVerifierObserver(); + + FakeHostVerifierObserver(const FakeHostVerifierObserver&) = delete; + FakeHostVerifierObserver& operator=(const FakeHostVerifierObserver&) = delete; + ~FakeHostVerifierObserver() override; size_t num_host_verifications() { return num_host_verifications_; } @@ -50,8 +56,6 @@ class FakeHostVerifierObserver : public HostVerifier::Observer { void OnHostVerified() override; size_t num_host_verifications_ = 0u; - - DISALLOW_COPY_AND_ASSIGN(FakeHostVerifierObserver); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/feature_state_manager.h b/chromeos/services/multidevice_setup/feature_state_manager.h index 08447c75276ced..a8225996673bc4 100644 --- a/chromeos/services/multidevice_setup/feature_state_manager.h +++ b/chromeos/services/multidevice_setup/feature_state_manager.h @@ -31,6 +31,9 @@ class FeatureStateManager { const FeatureStatesMap& feature_states_map) = 0; }; + FeatureStateManager(const FeatureStateManager&) = delete; + FeatureStateManager& operator=(const FeatureStateManager&) = delete; + virtual ~FeatureStateManager(); virtual FeatureStatesMap GetFeatureStates() = 0; @@ -57,8 +60,6 @@ class FeatureStateManager { private: base::ObserverList::Unchecked observer_list_; - - DISALLOW_COPY_AND_ASSIGN(FeatureStateManager); }; std::ostream& operator<<(std::ostream& stream, diff --git a/chromeos/services/multidevice_setup/host_backend_delegate.h b/chromeos/services/multidevice_setup/host_backend_delegate.h index 23a0d119689445..4a2aa148685ad5 100644 --- a/chromeos/services/multidevice_setup/host_backend_delegate.h +++ b/chromeos/services/multidevice_setup/host_backend_delegate.h @@ -43,6 +43,9 @@ class HostBackendDelegate { virtual void OnPendingHostRequestChange() {} }; + HostBackendDelegate(const HostBackendDelegate&) = delete; + HostBackendDelegate& operator=(const HostBackendDelegate&) = delete; + virtual ~HostBackendDelegate(); // Attempts to set |host_device| as the host on the back-end. If |host_device| @@ -90,8 +93,6 @@ class HostBackendDelegate { private: base::ObserverList::Unchecked observer_list_; - - DISALLOW_COPY_AND_ASSIGN(HostBackendDelegate); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/host_device_timestamp_manager.h b/chromeos/services/multidevice_setup/host_device_timestamp_manager.h index f6c90a80e81a61..bdb45600095d7c 100644 --- a/chromeos/services/multidevice_setup/host_device_timestamp_manager.h +++ b/chromeos/services/multidevice_setup/host_device_timestamp_manager.h @@ -17,6 +17,10 @@ namespace multidevice_setup { // on this device. class HostDeviceTimestampManager { public: + HostDeviceTimestampManager(const HostDeviceTimestampManager&) = delete; + HostDeviceTimestampManager& operator=(const HostDeviceTimestampManager&) = + delete; + virtual ~HostDeviceTimestampManager() = default; // Returns true when there is a host set (not necessarily verified) for the @@ -37,9 +41,6 @@ class HostDeviceTimestampManager { protected: HostDeviceTimestampManager() = default; - - private: - DISALLOW_COPY_AND_ASSIGN(HostDeviceTimestampManager); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/host_status_provider.h b/chromeos/services/multidevice_setup/host_status_provider.h index b8c777151f1a1b..a7a70479759b0d 100644 --- a/chromeos/services/multidevice_setup/host_status_provider.h +++ b/chromeos/services/multidevice_setup/host_status_provider.h @@ -51,6 +51,9 @@ class HostStatusProvider { const HostStatusWithDevice& host_status_with_device) = 0; }; + HostStatusProvider(const HostStatusProvider&) = delete; + HostStatusProvider& operator=(const HostStatusProvider&) = delete; + virtual ~HostStatusProvider(); virtual HostStatusWithDevice GetHostWithStatus() const = 0; @@ -67,8 +70,6 @@ class HostStatusProvider { private: base::ObserverList::Unchecked observer_list_; - - DISALLOW_COPY_AND_ASSIGN(HostStatusProvider); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/host_verifier.h b/chromeos/services/multidevice_setup/host_verifier.h index fedd5f27e572a4..26859ef76a9c09 100644 --- a/chromeos/services/multidevice_setup/host_verifier.h +++ b/chromeos/services/multidevice_setup/host_verifier.h @@ -32,6 +32,9 @@ class HostVerifier { virtual void OnHostVerified() = 0; }; + HostVerifier(const HostVerifier&) = delete; + HostVerifier& operator=(const HostVerifier&) = delete; + virtual ~HostVerifier(); // Returns whether verification for the current MultiDevice host device has @@ -55,8 +58,6 @@ class HostVerifier { private: base::ObserverList::Unchecked observer_list_; - - DISALLOW_COPY_AND_ASSIGN(HostVerifier); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/multidevice_setup_base.h b/chromeos/services/multidevice_setup/multidevice_setup_base.h index 8903fa08f17bc7..dbbe06509dead4 100644 --- a/chromeos/services/multidevice_setup/multidevice_setup_base.h +++ b/chromeos/services/multidevice_setup/multidevice_setup_base.h @@ -16,6 +16,9 @@ namespace multidevice_setup { // MultiDeviceSetup implementation which accepts receivers to bind to it. class MultiDeviceSetupBase : public mojom::MultiDeviceSetup { public: + MultiDeviceSetupBase(const MultiDeviceSetupBase&) = delete; + MultiDeviceSetupBase& operator=(const MultiDeviceSetupBase&) = delete; + ~MultiDeviceSetupBase() override; void BindReceiver(mojo::PendingReceiver receiver); @@ -34,8 +37,6 @@ class MultiDeviceSetupBase : public mojom::MultiDeviceSetup { private: mojo::ReceiverSet receivers_; - - DISALLOW_COPY_AND_ASSIGN(MultiDeviceSetupBase); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/multidevice_setup_impl_unittest.cc b/chromeos/services/multidevice_setup/multidevice_setup_impl_unittest.cc index d9aec2e9ce2a43..5220084530f876 100644 --- a/chromeos/services/multidevice_setup/multidevice_setup_impl_unittest.cc +++ b/chromeos/services/multidevice_setup/multidevice_setup_impl_unittest.cc @@ -79,6 +79,11 @@ class FakeEligibleHostDevicesProviderFactory device_sync::FakeDeviceSyncClient* expected_device_sync_client) : expected_device_sync_client_(expected_device_sync_client) {} + FakeEligibleHostDevicesProviderFactory( + const FakeEligibleHostDevicesProviderFactory&) = delete; + FakeEligibleHostDevicesProviderFactory& operator=( + const FakeEligibleHostDevicesProviderFactory&) = delete; + ~FakeEligibleHostDevicesProviderFactory() override = default; FakeEligibleHostDevicesProvider* instance() { return instance_; } @@ -98,8 +103,6 @@ class FakeEligibleHostDevicesProviderFactory device_sync::FakeDeviceSyncClient* expected_device_sync_client_; FakeEligibleHostDevicesProvider* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeEligibleHostDevicesProviderFactory); }; class FakeHostBackendDelegateFactory : public HostBackendDelegateImpl::Factory { @@ -115,6 +118,11 @@ class FakeHostBackendDelegateFactory : public HostBackendDelegateImpl::Factory { expected_testing_pref_service_(expected_testing_pref_service), expected_device_sync_client_(expected_device_sync_client) {} + FakeHostBackendDelegateFactory(const FakeHostBackendDelegateFactory&) = + delete; + FakeHostBackendDelegateFactory& operator=( + const FakeHostBackendDelegateFactory&) = delete; + ~FakeHostBackendDelegateFactory() override = default; FakeHostBackendDelegate* instance() { return instance_; } @@ -143,8 +151,6 @@ class FakeHostBackendDelegateFactory : public HostBackendDelegateImpl::Factory { device_sync::FakeDeviceSyncClient* expected_device_sync_client_; FakeHostBackendDelegate* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeHostBackendDelegateFactory); }; class FakeHostVerifierFactory : public HostVerifierImpl::Factory { @@ -158,6 +164,9 @@ class FakeHostVerifierFactory : public HostVerifierImpl::Factory { expected_device_sync_client_(expected_device_sync_client), expected_testing_pref_service_(expected_testing_pref_service) {} + FakeHostVerifierFactory(const FakeHostVerifierFactory&) = delete; + FakeHostVerifierFactory& operator=(const FakeHostVerifierFactory&) = delete; + ~FakeHostVerifierFactory() override = default; FakeHostVerifier* instance() { return instance_; } @@ -187,8 +196,6 @@ class FakeHostVerifierFactory : public HostVerifierImpl::Factory { sync_preferences::TestingPrefServiceSyncable* expected_testing_pref_service_; FakeHostVerifier* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeHostVerifierFactory); }; class FakeHostStatusProviderFactory : public HostStatusProviderImpl::Factory { @@ -205,6 +212,10 @@ class FakeHostStatusProviderFactory : public HostStatusProviderImpl::Factory { fake_host_verifier_factory_(fake_host_verifier_factory), expected_device_sync_client_(expected_device_sync_client) {} + FakeHostStatusProviderFactory(const FakeHostStatusProviderFactory&) = delete; + FakeHostStatusProviderFactory& operator=( + const FakeHostStatusProviderFactory&) = delete; + ~FakeHostStatusProviderFactory() override = default; FakeHostStatusProvider* instance() { return instance_; } @@ -236,8 +247,6 @@ class FakeHostStatusProviderFactory : public HostStatusProviderImpl::Factory { device_sync::FakeDeviceSyncClient* expected_device_sync_client_; FakeHostStatusProvider* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeHostStatusProviderFactory); }; class FakeWifiSyncFeatureManagerFactory @@ -252,6 +261,11 @@ class FakeWifiSyncFeatureManagerFactory expected_testing_pref_service_(expected_testing_pref_service), expected_device_sync_client_(expected_device_sync_client) {} + FakeWifiSyncFeatureManagerFactory(const FakeWifiSyncFeatureManagerFactory&) = + delete; + FakeWifiSyncFeatureManagerFactory& operator=( + const FakeWifiSyncFeatureManagerFactory&) = delete; + ~FakeWifiSyncFeatureManagerFactory() override = default; FakeWifiSyncFeatureManager* instance() { return instance_; } @@ -280,8 +294,6 @@ class FakeWifiSyncFeatureManagerFactory device_sync::FakeDeviceSyncClient* expected_device_sync_client_; FakeWifiSyncFeatureManager* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeWifiSyncFeatureManagerFactory); }; class FakeGrandfatheredEasyUnlockHostDisablerFactory @@ -296,6 +308,11 @@ class FakeGrandfatheredEasyUnlockHostDisablerFactory expected_device_sync_client_(expected_device_sync_client), expected_testing_pref_service_(expected_testing_pref_service) {} + FakeGrandfatheredEasyUnlockHostDisablerFactory( + const FakeGrandfatheredEasyUnlockHostDisablerFactory&) = delete; + FakeGrandfatheredEasyUnlockHostDisablerFactory& operator=( + const FakeGrandfatheredEasyUnlockHostDisablerFactory&) = delete; + ~FakeGrandfatheredEasyUnlockHostDisablerFactory() override = default; private: @@ -317,8 +334,6 @@ class FakeGrandfatheredEasyUnlockHostDisablerFactory FakeHostBackendDelegateFactory* fake_host_backend_delegate_factory_; device_sync::FakeDeviceSyncClient* expected_device_sync_client_; sync_preferences::TestingPrefServiceSyncable* expected_testing_pref_service_; - - DISALLOW_COPY_AND_ASSIGN(FakeGrandfatheredEasyUnlockHostDisablerFactory); }; class FakeFeatureStateManagerFactory : public FeatureStateManagerImpl::Factory { @@ -338,6 +353,11 @@ class FakeFeatureStateManagerFactory : public FeatureStateManagerImpl::Factory { expected_android_sms_pairing_state_tracker), expected_is_secondary_user_(expected_is_secondary_user) {} + FakeFeatureStateManagerFactory(const FakeFeatureStateManagerFactory&) = + delete; + FakeFeatureStateManagerFactory& operator=( + const FakeFeatureStateManagerFactory&) = delete; + ~FakeFeatureStateManagerFactory() override = default; FakeFeatureStateManager* instance() { return instance_; } @@ -373,8 +393,6 @@ class FakeFeatureStateManagerFactory : public FeatureStateManagerImpl::Factory { bool expected_is_secondary_user_; FakeFeatureStateManager* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeFeatureStateManagerFactory); }; class FakeHostDeviceTimestampManagerFactory @@ -387,6 +405,11 @@ class FakeHostDeviceTimestampManagerFactory : fake_host_status_provider_factory_(fake_host_status_provider_factory), expected_testing_pref_service_(expected_testing_pref_service) {} + FakeHostDeviceTimestampManagerFactory( + const FakeHostDeviceTimestampManagerFactory&) = delete; + FakeHostDeviceTimestampManagerFactory& operator=( + const FakeHostDeviceTimestampManagerFactory&) = delete; + ~FakeHostDeviceTimestampManagerFactory() override = default; FakeHostDeviceTimestampManager* instance() { return instance_; } @@ -411,8 +434,6 @@ class FakeHostDeviceTimestampManagerFactory sync_preferences::TestingPrefServiceSyncable* expected_testing_pref_service_; FakeHostDeviceTimestampManager* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeHostDeviceTimestampManagerFactory); }; class FakeAccountStatusChangeDelegateNotifierFactory @@ -431,6 +452,11 @@ class FakeAccountStatusChangeDelegateNotifierFactory fake_host_device_timestamp_manager_factory), expected_oobe_completion_tracker_(expected_oobe_completion_tracker) {} + FakeAccountStatusChangeDelegateNotifierFactory( + const FakeAccountStatusChangeDelegateNotifierFactory&) = delete; + FakeAccountStatusChangeDelegateNotifierFactory& operator=( + const FakeAccountStatusChangeDelegateNotifierFactory&) = delete; + ~FakeAccountStatusChangeDelegateNotifierFactory() override = default; FakeAccountStatusChangeDelegateNotifier* instance() { return instance_; } @@ -463,8 +489,6 @@ class FakeAccountStatusChangeDelegateNotifierFactory OobeCompletionTracker* expected_oobe_completion_tracker_; FakeAccountStatusChangeDelegateNotifier* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeAccountStatusChangeDelegateNotifierFactory); }; class FakeAndroidSmsAppInstallingStatusObserverFactory @@ -479,6 +503,11 @@ class FakeAndroidSmsAppInstallingStatusObserverFactory expected_android_sms_app_helper_delegate_( expected_android_sms_app_helper_delegate) {} + FakeAndroidSmsAppInstallingStatusObserverFactory( + const FakeAndroidSmsAppInstallingStatusObserverFactory&) = delete; + FakeAndroidSmsAppInstallingStatusObserverFactory& operator=( + const FakeAndroidSmsAppInstallingStatusObserverFactory&) = delete; + ~FakeAndroidSmsAppInstallingStatusObserverFactory() override = default; private: @@ -501,8 +530,6 @@ class FakeAndroidSmsAppInstallingStatusObserverFactory FakeHostStatusProviderFactory* fake_host_status_provider_factory_; FakeFeatureStateManagerFactory* fake_feature_state_manager_factory_; AndroidSmsAppHelperDelegate* expected_android_sms_app_helper_delegate_; - - DISALLOW_COPY_AND_ASSIGN(FakeAndroidSmsAppInstallingStatusObserverFactory); }; } // namespace diff --git a/chromeos/services/multidevice_setup/multidevice_setup_service.h b/chromeos/services/multidevice_setup/multidevice_setup_service.h index a464fc73df6cd7..334b880f138def 100644 --- a/chromeos/services/multidevice_setup/multidevice_setup_service.h +++ b/chromeos/services/multidevice_setup/multidevice_setup_service.h @@ -42,6 +42,10 @@ class MultiDeviceSetupService { AndroidSmsPairingStateTracker* android_sms_pairing_state_tracker, const device_sync::GcmDeviceInfoProvider* gcm_device_info_provider, bool is_secondary_user); + + MultiDeviceSetupService(const MultiDeviceSetupService&) = delete; + MultiDeviceSetupService& operator=(const MultiDeviceSetupService&) = delete; + ~MultiDeviceSetupService(); static void RegisterProfilePrefs(PrefRegistrySimple* registry); @@ -55,8 +59,6 @@ class MultiDeviceSetupService { std::unique_ptr multidevice_setup_; std::unique_ptr privileged_host_device_setter_; - - DISALLOW_COPY_AND_ASSIGN(MultiDeviceSetupService); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/multidevice_setup_service_unittest.cc b/chromeos/services/multidevice_setup/multidevice_setup_service_unittest.cc index 58ef352c687f16..84c7d4d319021f 100644 --- a/chromeos/services/multidevice_setup/multidevice_setup_service_unittest.cc +++ b/chromeos/services/multidevice_setup/multidevice_setup_service_unittest.cc @@ -59,6 +59,10 @@ class FakeMultiDeviceSetupFactory : public MultiDeviceSetupImpl::Factory { expected_gcm_device_info_provider_(expected_gcm_device_info_provider), expected_is_secondary_user_(expected_is_secondary_user) {} + FakeMultiDeviceSetupFactory(const FakeMultiDeviceSetupFactory&) = delete; + FakeMultiDeviceSetupFactory& operator=(const FakeMultiDeviceSetupFactory&) = + delete; + ~FakeMultiDeviceSetupFactory() override = default; FakeMultiDeviceSetup* instance() { return instance_; } @@ -102,8 +106,6 @@ class FakeMultiDeviceSetupFactory : public MultiDeviceSetupImpl::Factory { bool expected_is_secondary_user_; FakeMultiDeviceSetup* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeMultiDeviceSetupFactory); }; } // namespace diff --git a/chromeos/services/multidevice_setup/privileged_host_device_setter_base.h b/chromeos/services/multidevice_setup/privileged_host_device_setter_base.h index 1febfb02684746..689319ef3827bd 100644 --- a/chromeos/services/multidevice_setup/privileged_host_device_setter_base.h +++ b/chromeos/services/multidevice_setup/privileged_host_device_setter_base.h @@ -18,6 +18,11 @@ namespace multidevice_setup { class PrivilegedHostDeviceSetterBase : public mojom::PrivilegedHostDeviceSetter { public: + PrivilegedHostDeviceSetterBase(const PrivilegedHostDeviceSetterBase&) = + delete; + PrivilegedHostDeviceSetterBase& operator=( + const PrivilegedHostDeviceSetterBase&) = delete; + ~PrivilegedHostDeviceSetterBase() override; void BindReceiver( @@ -28,8 +33,6 @@ class PrivilegedHostDeviceSetterBase private: mojo::ReceiverSet receivers_; - - DISALLOW_COPY_AND_ASSIGN(PrivilegedHostDeviceSetterBase); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/public/cpp/android_sms_app_helper_delegate.h b/chromeos/services/multidevice_setup/public/cpp/android_sms_app_helper_delegate.h index 8240f6b7fea9f0..4198a797544619 100644 --- a/chromeos/services/multidevice_setup/public/cpp/android_sms_app_helper_delegate.h +++ b/chromeos/services/multidevice_setup/public/cpp/android_sms_app_helper_delegate.h @@ -14,6 +14,10 @@ namespace multidevice_setup { // A delegate class used to install the Messages for Web PWA. class AndroidSmsAppHelperDelegate { public: + AndroidSmsAppHelperDelegate(const AndroidSmsAppHelperDelegate&) = delete; + AndroidSmsAppHelperDelegate& operator=(const AndroidSmsAppHelperDelegate&) = + delete; + virtual ~AndroidSmsAppHelperDelegate() = default; // Sets up the Messages for Web PWA. Handles retries and errors internally. @@ -38,9 +42,6 @@ class AndroidSmsAppHelperDelegate { protected: AndroidSmsAppHelperDelegate() = default; - - private: - DISALLOW_COPY_AND_ASSIGN(AndroidSmsAppHelperDelegate); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/public/cpp/auth_token_validator.h b/chromeos/services/multidevice_setup/public/cpp/auth_token_validator.h index 2618c49428b8bb..e6544220df9370 100644 --- a/chromeos/services/multidevice_setup/public/cpp/auth_token_validator.h +++ b/chromeos/services/multidevice_setup/public/cpp/auth_token_validator.h @@ -17,12 +17,13 @@ namespace multidevice_setup { class AuthTokenValidator { public: AuthTokenValidator() = default; + + AuthTokenValidator(const AuthTokenValidator&) = delete; + AuthTokenValidator& operator=(const AuthTokenValidator&) = delete; + virtual ~AuthTokenValidator() = default; virtual bool IsAuthTokenValid(const std::string& auth_token) = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(AuthTokenValidator); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/public/cpp/fake_android_sms_app_helper_delegate.h b/chromeos/services/multidevice_setup/public/cpp/fake_android_sms_app_helper_delegate.h index 42a06be6d3122a..4975d244c72b6c 100644 --- a/chromeos/services/multidevice_setup/public/cpp/fake_android_sms_app_helper_delegate.h +++ b/chromeos/services/multidevice_setup/public/cpp/fake_android_sms_app_helper_delegate.h @@ -16,6 +16,12 @@ class FakeAndroidSmsAppHelperDelegate : virtual public AndroidSmsAppHelperDelegate { public: FakeAndroidSmsAppHelperDelegate(); + + FakeAndroidSmsAppHelperDelegate(const FakeAndroidSmsAppHelperDelegate&) = + delete; + FakeAndroidSmsAppHelperDelegate& operator=( + const FakeAndroidSmsAppHelperDelegate&) = delete; + ~FakeAndroidSmsAppHelperDelegate() override; bool has_installed_app() const { return has_installed_app_; } @@ -55,8 +61,6 @@ class FakeAndroidSmsAppHelperDelegate bool is_default_to_persist_cookie_set_ = false; bool has_app_been_manually_uninstalled_ = false; bool is_app_registry_ready_ = false; - - DISALLOW_COPY_AND_ASSIGN(FakeAndroidSmsAppHelperDelegate); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/public/cpp/fake_android_sms_pairing_state_tracker.h b/chromeos/services/multidevice_setup/public/cpp/fake_android_sms_pairing_state_tracker.h index db4bcd14ebee9c..5db760a7e3990c 100644 --- a/chromeos/services/multidevice_setup/public/cpp/fake_android_sms_pairing_state_tracker.h +++ b/chromeos/services/multidevice_setup/public/cpp/fake_android_sms_pairing_state_tracker.h @@ -14,6 +14,12 @@ namespace multidevice_setup { class FakeAndroidSmsPairingStateTracker : public AndroidSmsPairingStateTracker { public: FakeAndroidSmsPairingStateTracker(); + + FakeAndroidSmsPairingStateTracker(const FakeAndroidSmsPairingStateTracker&) = + delete; + FakeAndroidSmsPairingStateTracker& operator=( + const FakeAndroidSmsPairingStateTracker&) = delete; + ~FakeAndroidSmsPairingStateTracker() override; void SetPairingComplete(bool is_pairing_complete); @@ -22,8 +28,6 @@ class FakeAndroidSmsPairingStateTracker : public AndroidSmsPairingStateTracker { private: bool is_pairing_complete_ = false; - - DISALLOW_COPY_AND_ASSIGN(FakeAndroidSmsPairingStateTracker); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/public/cpp/fake_auth_token_validator.h b/chromeos/services/multidevice_setup/public/cpp/fake_auth_token_validator.h index 2d0de0d697e186..fe92c93687566f 100644 --- a/chromeos/services/multidevice_setup/public/cpp/fake_auth_token_validator.h +++ b/chromeos/services/multidevice_setup/public/cpp/fake_auth_token_validator.h @@ -19,6 +19,10 @@ namespace multidevice_setup { class FakeAuthTokenValidator : public AuthTokenValidator { public: FakeAuthTokenValidator(); + + FakeAuthTokenValidator(const FakeAuthTokenValidator&) = delete; + FakeAuthTokenValidator& operator=(const FakeAuthTokenValidator&) = delete; + ~FakeAuthTokenValidator() override; // AuthTokenValidator: @@ -30,8 +34,6 @@ class FakeAuthTokenValidator : public AuthTokenValidator { private: absl::optional expected_auth_token_; - - DISALLOW_COPY_AND_ASSIGN(FakeAuthTokenValidator); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/public/cpp/fake_multidevice_setup.h b/chromeos/services/multidevice_setup/public/cpp/fake_multidevice_setup.h index 40c5213efd1c6b..fc22332ebb1bd1 100644 --- a/chromeos/services/multidevice_setup/public/cpp/fake_multidevice_setup.h +++ b/chromeos/services/multidevice_setup/public/cpp/fake_multidevice_setup.h @@ -23,6 +23,10 @@ namespace multidevice_setup { class FakeMultiDeviceSetup : public MultiDeviceSetupBase { public: FakeMultiDeviceSetup(); + + FakeMultiDeviceSetup(const FakeMultiDeviceSetup&) = delete; + FakeMultiDeviceSetup& operator=(const FakeMultiDeviceSetup&) = delete; + ~FakeMultiDeviceSetup() override; void FlushForTesting(); @@ -141,8 +145,6 @@ class FakeMultiDeviceSetup : public MultiDeviceSetupBase { std::pair> set_host_without_auth_args_; - - DISALLOW_COPY_AND_ASSIGN(FakeMultiDeviceSetup); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/public/cpp/fake_multidevice_setup_client.h b/chromeos/services/multidevice_setup/public/cpp/fake_multidevice_setup_client.h index 0879577b9f82c8..c75be77338317f 100644 --- a/chromeos/services/multidevice_setup/public/cpp/fake_multidevice_setup_client.h +++ b/chromeos/services/multidevice_setup/public/cpp/fake_multidevice_setup_client.h @@ -25,6 +25,11 @@ namespace multidevice_setup { class FakeMultiDeviceSetupClient : public MultiDeviceSetupClient { public: FakeMultiDeviceSetupClient(); + + FakeMultiDeviceSetupClient(const FakeMultiDeviceSetupClient&) = delete; + FakeMultiDeviceSetupClient& operator=(const FakeMultiDeviceSetupClient&) = + delete; + ~FakeMultiDeviceSetupClient() override; void SetHostStatusWithDevice( @@ -103,8 +108,6 @@ class FakeMultiDeviceSetupClient : public MultiDeviceSetupClient { HostStatusWithDevice host_status_with_device_; FeatureStatesMap feature_states_map_; - - DISALLOW_COPY_AND_ASSIGN(FakeMultiDeviceSetupClient); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/public/cpp/fake_privileged_host_device_setter.h b/chromeos/services/multidevice_setup/public/cpp/fake_privileged_host_device_setter.h index 63bc5be8cf1863..8e847fc76c703b 100644 --- a/chromeos/services/multidevice_setup/public/cpp/fake_privileged_host_device_setter.h +++ b/chromeos/services/multidevice_setup/public/cpp/fake_privileged_host_device_setter.h @@ -19,6 +19,12 @@ namespace multidevice_setup { class FakePrivilegedHostDeviceSetter : public PrivilegedHostDeviceSetterBase { public: FakePrivilegedHostDeviceSetter(); + + FakePrivilegedHostDeviceSetter(const FakePrivilegedHostDeviceSetter&) = + delete; + FakePrivilegedHostDeviceSetter& operator=( + const FakePrivilegedHostDeviceSetter&) = delete; + ~FakePrivilegedHostDeviceSetter() override; std::vector>& set_host_args() { @@ -31,8 +37,6 @@ class FakePrivilegedHostDeviceSetter : public PrivilegedHostDeviceSetterBase { SetHostDeviceCallback callback) override; std::vector> set_host_args_; - - DISALLOW_COPY_AND_ASSIGN(FakePrivilegedHostDeviceSetter); }; } // namespace multidevice_setup diff --git a/chromeos/services/multidevice_setup/public/cpp/multidevice_setup_client_impl_unittest.cc b/chromeos/services/multidevice_setup/public/cpp/multidevice_setup_client_impl_unittest.cc index c9dc193c7e5bd1..de1d8ab6c87457 100644 --- a/chromeos/services/multidevice_setup/public/cpp/multidevice_setup_client_impl_unittest.cc +++ b/chromeos/services/multidevice_setup/public/cpp/multidevice_setup_client_impl_unittest.cc @@ -62,6 +62,12 @@ class TestMultiDeviceSetupClientObserver : public MultiDeviceSetupClient::Observer { public: TestMultiDeviceSetupClientObserver() = default; + + TestMultiDeviceSetupClientObserver( + const TestMultiDeviceSetupClientObserver&) = delete; + TestMultiDeviceSetupClientObserver& operator=( + const TestMultiDeviceSetupClientObserver&) = delete; + ~TestMultiDeviceSetupClientObserver() override = default; const std::vector& @@ -89,8 +95,6 @@ class TestMultiDeviceSetupClientObserver std::vector host_status_updates_; std::vector feature_state_updates_; - - DISALLOW_COPY_AND_ASSIGN(TestMultiDeviceSetupClientObserver); }; absl::optional GetRemoteDeviceFromRef( diff --git a/chromeos/services/network_config/cros_network_config.h b/chromeos/services/network_config/cros_network_config.h index a73a094e606627..5222e04fbc6a48 100644 --- a/chromeos/services/network_config/cros_network_config.h +++ b/chromeos/services/network_config/cros_network_config.h @@ -51,6 +51,10 @@ class CrosNetworkConfig : public mojom::CrosNetworkConfig, NetworkConnectionHandler* network_connection_handler, NetworkCertificateHandler* network_certificate_handler, NetworkProfileHandler* network_profile_handler); + + CrosNetworkConfig(const CrosNetworkConfig&) = delete; + CrosNetworkConfig& operator=(const CrosNetworkConfig&) = delete; + ~CrosNetworkConfig() override; void BindReceiver(mojo::PendingReceiver receiver); @@ -213,8 +217,6 @@ class CrosNetworkConfig : public mojom::CrosNetworkConfig, std::vector vpn_providers_; base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(CrosNetworkConfig); }; } // namespace network_config diff --git a/chromeos/services/network_config/cros_network_config_unittest.cc b/chromeos/services/network_config/cros_network_config_unittest.cc index fc4bba0e95caef..47dafae99fd5d2 100644 --- a/chromeos/services/network_config/cros_network_config_unittest.cc +++ b/chromeos/services/network_config/cros_network_config_unittest.cc @@ -141,6 +141,9 @@ class CrosNetworkConfigTest : public testing::Test { SetupNetworks(); } + CrosNetworkConfigTest(const CrosNetworkConfigTest&) = delete; + CrosNetworkConfigTest& operator=(const CrosNetworkConfigTest&) = delete; + ~CrosNetworkConfigTest() override { cros_network_config_.reset(); helper_.reset(); @@ -678,8 +681,6 @@ class CrosNetworkConfigTest : public testing::Test { std::unique_ptr observer_; std::string wifi1_path_; std::string vpn_path_; - - DISALLOW_COPY_AND_ASSIGN(CrosNetworkConfigTest); }; TEST_F(CrosNetworkConfigTest, GetNetworkState) { diff --git a/chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h b/chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h index e627469eb3d703..b52233a17112c5 100644 --- a/chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h +++ b/chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h @@ -32,6 +32,10 @@ class CrosNetworkConfigTestHelper { // separately initialized via Initialize(ManagedNetworkConfigurationHandler*). explicit CrosNetworkConfigTestHelper(bool initialize); + CrosNetworkConfigTestHelper(const CrosNetworkConfigTestHelper&) = delete; + CrosNetworkConfigTestHelper& operator=(const CrosNetworkConfigTestHelper&) = + delete; + ~CrosNetworkConfigTestHelper(); mojom::NetworkStatePropertiesPtr CreateStandaloneNetworkProperties( @@ -55,9 +59,6 @@ class CrosNetworkConfigTestHelper { NetworkStateTestHelper network_state_helper_{ /*use_default_devices_and_services=*/false}; std::unique_ptr cros_network_config_impl_; - - private: - DISALLOW_COPY_AND_ASSIGN(CrosNetworkConfigTestHelper); }; } // namespace network_config diff --git a/chromeos/services/network_config/public/cpp/cros_network_config_test_observer.h b/chromeos/services/network_config/public/cpp/cros_network_config_test_observer.h index d1829419f9cd66..902c68c5c5ebe2 100644 --- a/chromeos/services/network_config/public/cpp/cros_network_config_test_observer.h +++ b/chromeos/services/network_config/public/cpp/cros_network_config_test_observer.h @@ -19,6 +19,11 @@ namespace network_config { class CrosNetworkConfigTestObserver : public mojom::CrosNetworkConfigObserver { public: CrosNetworkConfigTestObserver(); + + CrosNetworkConfigTestObserver(const CrosNetworkConfigTestObserver&) = delete; + CrosNetworkConfigTestObserver& operator=( + const CrosNetworkConfigTestObserver&) = delete; + ~CrosNetworkConfigTestObserver() override; mojo::PendingRemote GenerateRemote(); @@ -59,8 +64,6 @@ class CrosNetworkConfigTestObserver : public mojom::CrosNetworkConfigObserver { int device_state_list_changed_ = 0; int vpn_providers_changed_ = 0; int network_certificates_changed_ = 0; - - DISALLOW_COPY_AND_ASSIGN(CrosNetworkConfigTestObserver); }; } // namespace network_config diff --git a/chromeos/services/secure_channel/active_connection_manager.h b/chromeos/services/secure_channel/active_connection_manager.h index 34c201082bc2f1..dd930850ec64eb 100644 --- a/chromeos/services/secure_channel/active_connection_manager.h +++ b/chromeos/services/secure_channel/active_connection_manager.h @@ -37,6 +37,9 @@ class ActiveConnectionManager { kDisconnectingConnectionExists }; + ActiveConnectionManager(const ActiveConnectionManager&) = delete; + ActiveConnectionManager& operator=(const ActiveConnectionManager&) = delete; + virtual ~ActiveConnectionManager(); virtual ConnectionState GetConnectionState( @@ -76,8 +79,6 @@ class ActiveConnectionManager { private: Delegate* delegate_; - - DISALLOW_COPY_AND_ASSIGN(ActiveConnectionManager); }; std::ostream& operator<<( diff --git a/chromeos/services/secure_channel/active_connection_manager_impl_unittest.cc b/chromeos/services/secure_channel/active_connection_manager_impl_unittest.cc index 66e49b4babba6d..bdb9a11c53a7ab 100644 --- a/chromeos/services/secure_channel/active_connection_manager_impl_unittest.cc +++ b/chromeos/services/secure_channel/active_connection_manager_impl_unittest.cc @@ -32,6 +32,11 @@ class FakeMultiplexedChannelFactory : public MultiplexedChannelImpl::Factory { explicit FakeMultiplexedChannelFactory( MultiplexedChannel::Delegate* expected_delegate) : expected_delegate_(expected_delegate) {} + + FakeMultiplexedChannelFactory(const FakeMultiplexedChannelFactory&) = delete; + FakeMultiplexedChannelFactory& operator=( + const FakeMultiplexedChannelFactory&) = delete; + ~FakeMultiplexedChannelFactory() override = default; base::flat_map& @@ -83,8 +88,6 @@ class FakeMultiplexedChannelFactory : public MultiplexedChannelImpl::Factory { base::flat_map connection_details_to_active_channel_map_; - - DISALLOW_COPY_AND_ASSIGN(FakeMultiplexedChannelFactory); }; std::vector ClientListToIdList( diff --git a/chromeos/services/secure_channel/authenticated_channel.h b/chromeos/services/secure_channel/authenticated_channel.h index d51f52cfcd4720..7fea651228f7e7 100644 --- a/chromeos/services/secure_channel/authenticated_channel.h +++ b/chromeos/services/secure_channel/authenticated_channel.h @@ -29,6 +29,9 @@ class AuthenticatedChannel { const std::string& payload) = 0; }; + AuthenticatedChannel(const AuthenticatedChannel&) = delete; + AuthenticatedChannel& operator=(const AuthenticatedChannel&) = delete; + virtual ~AuthenticatedChannel(); virtual void GetConnectionMetadata( @@ -74,8 +77,6 @@ class AuthenticatedChannel { private: base::ObserverList::Unchecked observer_list_; bool is_disconnected_ = false; - - DISALLOW_COPY_AND_ASSIGN(AuthenticatedChannel); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/background_eid_generator.h b/chromeos/services/secure_channel/background_eid_generator.h index 559a32764b211e..bbfdc8a2f4d9b5 100644 --- a/chromeos/services/secure_channel/background_eid_generator.h +++ b/chromeos/services/secure_channel/background_eid_generator.h @@ -41,6 +41,10 @@ class RawEidGenerator; class BackgroundEidGenerator { public: BackgroundEidGenerator(); + + BackgroundEidGenerator(const BackgroundEidGenerator&) = delete; + BackgroundEidGenerator& operator=(const BackgroundEidGenerator&) = delete; + virtual ~BackgroundEidGenerator(); // Returns a list of the nearest EIDs from the current time. Note that the @@ -70,8 +74,6 @@ class BackgroundEidGenerator { std::unique_ptr raw_eid_generator_; base::Clock* clock_; - - DISALLOW_COPY_AND_ASSIGN(BackgroundEidGenerator); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/background_eid_generator_unittest.cc b/chromeos/services/secure_channel/background_eid_generator_unittest.cc index 8bb21ed5a7d097..c3e2716511da64 100644 --- a/chromeos/services/secure_channel/background_eid_generator_unittest.cc +++ b/chromeos/services/secure_channel/background_eid_generator_unittest.cc @@ -67,6 +67,10 @@ DataWithTimestamp CreateDataWithTimestamp( class TestRawEidGenerator : public RawEidGeneratorImpl { public: TestRawEidGenerator() {} + + TestRawEidGenerator(const TestRawEidGenerator&) = delete; + TestRawEidGenerator& operator=(const TestRawEidGenerator&) = delete; + ~TestRawEidGenerator() override {} // RawEidGenerator: @@ -77,9 +81,6 @@ class TestRawEidGenerator : public RawEidGeneratorImpl { return RawEidGeneratorImpl::GenerateEid( eid_seed, start_of_period_timestamp_ms, extra_entropy); } - - private: - DISALLOW_COPY_AND_ASSIGN(TestRawEidGenerator); }; } // namespace diff --git a/chromeos/services/secure_channel/ble_advertisement_generator.h b/chromeos/services/secure_channel/ble_advertisement_generator.h index e8cbe8fb555d43..549ef397da99fa 100644 --- a/chromeos/services/secure_channel/ble_advertisement_generator.h +++ b/chromeos/services/secure_channel/ble_advertisement_generator.h @@ -28,6 +28,10 @@ class BleAdvertisementGenerator { multidevice::RemoteDeviceRef remote_device, const std::string& local_device_public_key); + BleAdvertisementGenerator(const BleAdvertisementGenerator&) = delete; + BleAdvertisementGenerator& operator=(const BleAdvertisementGenerator&) = + delete; + virtual ~BleAdvertisementGenerator(); protected: @@ -50,8 +54,6 @@ class BleAdvertisementGenerator { std::unique_ptr test_eid_generator); std::unique_ptr eid_generator_; - - DISALLOW_COPY_AND_ASSIGN(BleAdvertisementGenerator); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/ble_advertiser.h b/chromeos/services/secure_channel/ble_advertiser.h index 4a63af7cc49392..ba3f52a64b7718 100644 --- a/chromeos/services/secure_channel/ble_advertiser.h +++ b/chromeos/services/secure_channel/ble_advertiser.h @@ -33,6 +33,9 @@ class BleAdvertiser { const DeviceIdPair& device_id_pair) = 0; }; + BleAdvertiser(const BleAdvertiser&) = delete; + BleAdvertiser& operator=(const BleAdvertiser&) = delete; + virtual ~BleAdvertiser(); // Adds a request for the given DeviceIdPair to advertise at the given @@ -66,8 +69,6 @@ class BleAdvertiser { private: Delegate* delegate_; - - DISALLOW_COPY_AND_ASSIGN(BleAdvertiser); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/ble_advertiser_impl_unittest.cc b/chromeos/services/secure_channel/ble_advertiser_impl_unittest.cc index b5e66b613c361f..abe1aeb35708bf 100644 --- a/chromeos/services/secure_channel/ble_advertiser_impl_unittest.cc +++ b/chromeos/services/secure_channel/ble_advertiser_impl_unittest.cc @@ -35,6 +35,12 @@ class FakeErrorTolerantBleAdvertisementFactory BleSynchronizerBase* ble_synchronizer_base) : bluetooth_helper_(bluetooth_helper), ble_synchronizer_base_(ble_synchronizer_base) {} + + FakeErrorTolerantBleAdvertisementFactory( + const FakeErrorTolerantBleAdvertisementFactory&) = delete; + FakeErrorTolerantBleAdvertisementFactory& operator=( + const FakeErrorTolerantBleAdvertisementFactory&) = delete; + ~FakeErrorTolerantBleAdvertisementFactory() override = default; const absl::optional& last_created_device_id_pair() const { @@ -89,8 +95,6 @@ class FakeErrorTolerantBleAdvertisementFactory base::flat_map device_id_pair_to_active_advertisement_map_; size_t num_instances_created_ = 0u; - - DISALLOW_COPY_AND_ASSIGN(FakeErrorTolerantBleAdvertisementFactory); }; const int64_t kDefaultStartTimestamp = 1337; diff --git a/chromeos/services/secure_channel/ble_characteristics_finder.h b/chromeos/services/secure_channel/ble_characteristics_finder.h index 02369c3c8d82dd..b345481bbc05db 100644 --- a/chromeos/services/secure_channel/ble_characteristics_finder.h +++ b/chromeos/services/secure_channel/ble_characteristics_finder.h @@ -64,6 +64,11 @@ class BluetoothLowEnergyCharacteristicsFinder scoped_refptr task_runner = base::ThreadTaskRunnerHandle::Get()); + BluetoothLowEnergyCharacteristicsFinder( + const BluetoothLowEnergyCharacteristicsFinder&) = delete; + BluetoothLowEnergyCharacteristicsFinder& operator=( + const BluetoothLowEnergyCharacteristicsFinder&) = delete; + ~BluetoothLowEnergyCharacteristicsFinder() override; protected: @@ -140,8 +145,6 @@ class BluetoothLowEnergyCharacteristicsFinder base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyCharacteristicsFinder); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/ble_connection_manager.h b/chromeos/services/secure_channel/ble_connection_manager.h index 9ded5eef94ed3e..548a18b6cf0419 100644 --- a/chromeos/services/secure_channel/ble_connection_manager.h +++ b/chromeos/services/secure_channel/ble_connection_manager.h @@ -38,6 +38,9 @@ class AuthenticatedChannel; // scanning/advertising. class BleConnectionManager { public: + BleConnectionManager(const BleConnectionManager&) = delete; + BleConnectionManager& operator=(const BleConnectionManager&) = delete; + virtual ~BleConnectionManager(); using ConnectionSuccessCallback = @@ -147,8 +150,6 @@ class BleConnectionManager { base::flat_map> id_pair_to_listener_metadata_map_; - - DISALLOW_COPY_AND_ASSIGN(BleConnectionManager); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/ble_connection_manager_impl_unittest.cc b/chromeos/services/secure_channel/ble_connection_manager_impl_unittest.cc index 3dcd0b3100cf7d..204a66db453553 100644 --- a/chromeos/services/secure_channel/ble_connection_manager_impl_unittest.cc +++ b/chromeos/services/secure_channel/ble_connection_manager_impl_unittest.cc @@ -62,6 +62,9 @@ class FakeBleAdvertiserFactory : public BleAdvertiserImpl::Factory { expected_fake_ble_synchronizer_(expected_fake_ble_synchronizer), expected_fake_timer_factory_(expected_fake_timer_factory) {} + FakeBleAdvertiserFactory(const FakeBleAdvertiserFactory&) = delete; + FakeBleAdvertiserFactory& operator=(const FakeBleAdvertiserFactory&) = delete; + ~FakeBleAdvertiserFactory() override = default; FakeBleAdvertiser* instance() { return instance_; } @@ -89,8 +92,6 @@ class FakeBleAdvertiserFactory : public BleAdvertiserImpl::Factory { FakeBluetoothHelper* expected_fake_bluetooth_helper_; FakeBleSynchronizer* expected_fake_ble_synchronizer_; FakeTimerFactory* expected_fake_timer_factory_; - - DISALLOW_COPY_AND_ASSIGN(FakeBleAdvertiserFactory); }; class FakeWeaveClientConnectionFactory @@ -101,6 +102,11 @@ class FakeWeaveClientConnectionFactory expected_mock_adapter) : expected_mock_adapter_(expected_mock_adapter) {} + FakeWeaveClientConnectionFactory(const FakeWeaveClientConnectionFactory&) = + delete; + FakeWeaveClientConnectionFactory& operator=( + const FakeWeaveClientConnectionFactory&) = delete; + virtual ~FakeWeaveClientConnectionFactory() = default; void set_expected_bluetooth_device( @@ -132,8 +138,6 @@ class FakeWeaveClientConnectionFactory device::MockBluetoothDevice* expected_bluetooth_device_; FakeConnection* last_created_instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeWeaveClientConnectionFactory); }; class FakeSecureChannelFactory : public SecureChannel::Factory { @@ -143,6 +147,9 @@ class FakeSecureChannelFactory : public SecureChannel::Factory { : fake_weave_client_connection_factory_( fake_weave_client_connection_factory) {} + FakeSecureChannelFactory(const FakeSecureChannelFactory&) = delete; + FakeSecureChannelFactory& operator=(const FakeSecureChannelFactory&) = delete; + virtual ~FakeSecureChannelFactory() = default; FakeSecureChannelConnection* last_created_instance() { @@ -165,14 +172,18 @@ class FakeSecureChannelFactory : public SecureChannel::Factory { FakeWeaveClientConnectionFactory* fake_weave_client_connection_factory_; FakeSecureChannelConnection* last_created_instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeSecureChannelFactory); }; class FakeAuthenticatedChannelFactory : public AuthenticatedChannelImpl::Factory { public: FakeAuthenticatedChannelFactory() = default; + + FakeAuthenticatedChannelFactory(const FakeAuthenticatedChannelFactory&) = + delete; + FakeAuthenticatedChannelFactory& operator=( + const FakeAuthenticatedChannelFactory&) = delete; + ~FakeAuthenticatedChannelFactory() override = default; void SetExpectationsForNextCall( @@ -214,8 +225,6 @@ class FakeAuthenticatedChannelFactory bool expected_to_be_background_advertisement_ = false; FakeAuthenticatedChannel* last_created_instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeAuthenticatedChannelFactory); }; } // namespace diff --git a/chromeos/services/secure_channel/ble_scanner.h b/chromeos/services/secure_channel/ble_scanner.h index 53841469ea012d..f207903aef5702 100644 --- a/chromeos/services/secure_channel/ble_scanner.h +++ b/chromeos/services/secure_channel/ble_scanner.h @@ -41,6 +41,9 @@ class BleScanner { const std::vector& eid) = 0; }; + BleScanner(const BleScanner&) = delete; + BleScanner& operator=(const BleScanner&) = delete; + virtual ~BleScanner(); // Adds a scan request for the provided ConnectionAttemptDetails. If no scan @@ -80,8 +83,6 @@ class BleScanner { base::ObserverList observer_list_; base::flat_set scan_requests_; - - DISALLOW_COPY_AND_ASSIGN(BleScanner); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/ble_scanner_impl_unittest.cc b/chromeos/services/secure_channel/ble_scanner_impl_unittest.cc index 880381535f3442..6411699ee5502a 100644 --- a/chromeos/services/secure_channel/ble_scanner_impl_unittest.cc +++ b/chromeos/services/secure_channel/ble_scanner_impl_unittest.cc @@ -83,6 +83,12 @@ class SecureChannelBleScannerImplTest : public testing::Test { SecureChannelBleScannerImplTest() : test_devices_(multidevice::CreateRemoteDeviceRefListForTest(3)) {} + + SecureChannelBleScannerImplTest(const SecureChannelBleScannerImplTest&) = + delete; + SecureChannelBleScannerImplTest& operator=( + const SecureChannelBleScannerImplTest&) = delete; + ~SecureChannelBleScannerImplTest() override = default; // testing::Test: @@ -277,9 +283,6 @@ class SecureChannelBleScannerImplTest : public testing::Test { base::WeakPtr discovery_session_weak_ptr_; std::unique_ptr ble_scanner_; - - private: - DISALLOW_COPY_AND_ASSIGN(SecureChannelBleScannerImplTest); }; TEST_F(SecureChannelBleScannerImplTest, UnrelatedScanResults) { diff --git a/chromeos/services/secure_channel/ble_synchronizer_base.h b/chromeos/services/secure_channel/ble_synchronizer_base.h index 05deed11c3742d..49a2e7748baf12 100644 --- a/chromeos/services/secure_channel/ble_synchronizer_base.h +++ b/chromeos/services/secure_channel/ble_synchronizer_base.h @@ -25,6 +25,10 @@ namespace secure_channel { class BleSynchronizerBase { public: BleSynchronizerBase(); + + BleSynchronizerBase(const BleSynchronizerBase&) = delete; + BleSynchronizerBase& operator=(const BleSynchronizerBase&) = delete; + virtual ~BleSynchronizerBase(); // Advertisement wrappers. @@ -124,8 +128,6 @@ class BleSynchronizerBase { private: std::deque> command_queue_; - - DISALLOW_COPY_AND_ASSIGN(BleSynchronizerBase); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/ble_weave_client_connection_unittest.cc b/chromeos/services/secure_channel/ble_weave_client_connection_unittest.cc index 2ad662d382054a..d7b0d8ed92755b 100644 --- a/chromeos/services/secure_channel/ble_weave_client_connection_unittest.cc +++ b/chromeos/services/secure_channel/ble_weave_client_connection_unittest.cc @@ -225,6 +225,11 @@ class TestBluetoothLowEnergyWeaveClientConnection device_address, should_set_low_connection_latency) {} + TestBluetoothLowEnergyWeaveClientConnection( + const TestBluetoothLowEnergyWeaveClientConnection&) = delete; + TestBluetoothLowEnergyWeaveClientConnection& operator=( + const TestBluetoothLowEnergyWeaveClientConnection&) = delete; + ~TestBluetoothLowEnergyWeaveClientConnection() override {} bool should_set_low_connection_latency() { @@ -253,9 +258,6 @@ class TestBluetoothLowEnergyWeaveClientConnection // Exposing inherited protected fields for testing. using BluetoothLowEnergyWeaveClientConnection::status; using BluetoothLowEnergyWeaveClientConnection::sub_status; - - private: - DISALLOW_COPY_AND_ASSIGN(TestBluetoothLowEnergyWeaveClientConnection); }; class MockBluetoothLowEnergyCharacteristicsFinder @@ -264,10 +266,13 @@ class MockBluetoothLowEnergyCharacteristicsFinder MockBluetoothLowEnergyCharacteristicsFinder( multidevice::RemoteDeviceRef remote_device) : BluetoothLowEnergyCharacteristicsFinder(remote_device) {} - ~MockBluetoothLowEnergyCharacteristicsFinder() override {} - private: - DISALLOW_COPY_AND_ASSIGN(MockBluetoothLowEnergyCharacteristicsFinder); + MockBluetoothLowEnergyCharacteristicsFinder( + const MockBluetoothLowEnergyCharacteristicsFinder&) = delete; + MockBluetoothLowEnergyCharacteristicsFinder& operator=( + const MockBluetoothLowEnergyCharacteristicsFinder&) = delete; + + ~MockBluetoothLowEnergyCharacteristicsFinder() override {} }; class MockConnectionObserver : public ConnectionObserver { diff --git a/chromeos/services/secure_channel/bluetooth_helper.h b/chromeos/services/secure_channel/bluetooth_helper.h index 37123c632f7604..3cc449ad074f10 100644 --- a/chromeos/services/secure_channel/bluetooth_helper.h +++ b/chromeos/services/secure_channel/bluetooth_helper.h @@ -27,6 +27,9 @@ namespace secure_channel { // device for use in Bluetooth Classic connections. class BluetoothHelper { public: + BluetoothHelper(const BluetoothHelper&) = delete; + BluetoothHelper& operator=(const BluetoothHelper&) = delete; + virtual ~BluetoothHelper(); // Generates service data to be used in a foreground BLE advertisement from @@ -61,8 +64,6 @@ class BluetoothHelper { virtual absl::optional PerformIdentifyRemoteDevice( const std::string& service_data, const DeviceIdPairSet& device_id_pair_set) = 0; - - DISALLOW_COPY_AND_ASSIGN(BluetoothHelper); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/channel_impl.h b/chromeos/services/secure_channel/channel_impl.h index 0850de9c63d32c..097f2143ee2bf7 100644 --- a/chromeos/services/secure_channel/channel_impl.h +++ b/chromeos/services/secure_channel/channel_impl.h @@ -36,6 +36,10 @@ class ChannelImpl : public mojom::Channel { }; explicit ChannelImpl(Delegate* delegate); + + ChannelImpl(const ChannelImpl&) = delete; + ChannelImpl& operator=(const ChannelImpl&) = delete; + ~ChannelImpl() override; // Generates a mojo::PendingRemote for this instance; can only be @@ -63,8 +67,6 @@ class ChannelImpl : public mojom::Channel { mojo::Receiver receiver_{this}; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ChannelImpl); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/client_connection_parameters.h b/chromeos/services/secure_channel/client_connection_parameters.h index 1824e17d427cc9..b73578bc59da41 100644 --- a/chromeos/services/secure_channel/client_connection_parameters.h +++ b/chromeos/services/secure_channel/client_connection_parameters.h @@ -30,6 +30,11 @@ class ClientConnectionParameters { }; explicit ClientConnectionParameters(const std::string& feature); + + ClientConnectionParameters(const ClientConnectionParameters&) = delete; + ClientConnectionParameters& operator=(const ClientConnectionParameters&) = + delete; + virtual ~ClientConnectionParameters(); const base::UnguessableToken& id() const { return id_; } @@ -80,8 +85,6 @@ class ClientConnectionParameters { base::ObserverList::Unchecked observer_list_; bool has_invoked_delegate_function_ = false; - - DISALLOW_COPY_AND_ASSIGN(ClientConnectionParameters); }; std::ostream& operator<<(std::ostream& stream, diff --git a/chromeos/services/secure_channel/connect_to_device_operation.h b/chromeos/services/secure_channel/connect_to_device_operation.h index a5193dd55bed70..645aa9071cb124 100644 --- a/chromeos/services/secure_channel/connect_to_device_operation.h +++ b/chromeos/services/secure_channel/connect_to_device_operation.h @@ -29,6 +29,9 @@ class ConnectToDeviceOperation { using ConnectionFailedCallback = base::RepeatingCallback; + ConnectToDeviceOperation(const ConnectToDeviceOperation&) = delete; + ConnectToDeviceOperation& operator=(const ConnectToDeviceOperation&) = delete; + virtual ~ConnectToDeviceOperation() { if (has_finished_) return; @@ -107,8 +110,6 @@ class ConnectToDeviceOperation { ConnectionSuccessCallback success_callback_; ConnectionFailedCallback failure_callback_; ConnectionPriority connection_priority_; - - DISALLOW_COPY_AND_ASSIGN(ConnectToDeviceOperation); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/connection.h b/chromeos/services/secure_channel/connection.h index ed77b83001f899..9cd7fc0b7af38e 100644 --- a/chromeos/services/secure_channel/connection.h +++ b/chromeos/services/secure_channel/connection.h @@ -34,6 +34,10 @@ class Connection { // Constructs a connection to the given |remote_device|. explicit Connection(multidevice::RemoteDeviceRef remote_device); + + Connection(const Connection&) = delete; + Connection& operator=(const Connection&) = delete; + virtual ~Connection(); // Returns true iff the connection's status is CONNECTED. @@ -119,8 +123,6 @@ class Connection { // Whether a message is currently in the process of being sent. bool is_sending_message_; - - DISALLOW_COPY_AND_ASSIGN(Connection); }; std::ostream& operator<<(std::ostream& stream, diff --git a/chromeos/services/secure_channel/connection_attempt.h b/chromeos/services/secure_channel/connection_attempt.h index b8fd2fab4d10a5..15b2679860bf59 100644 --- a/chromeos/services/secure_channel/connection_attempt.h +++ b/chromeos/services/secure_channel/connection_attempt.h @@ -42,6 +42,9 @@ class ConnectionAttempt : public PendingConnectionRequestDelegate { return attempt->ExtractClientConnectionParameters(); } + ConnectionAttempt(const ConnectionAttempt&) = delete; + ConnectionAttempt& operator=(const ConnectionAttempt&) = delete; + virtual ~ConnectionAttempt() = default; const ConnectionAttemptDetails& connection_attempt_details() const { @@ -133,8 +136,6 @@ class ConnectionAttempt : public PendingConnectionRequestDelegate { const base::Time start_attempt_timestamp_; bool has_notified_delegate_of_success_ = false; - - DISALLOW_COPY_AND_ASSIGN(ConnectionAttempt); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/connection_attempt_base_unittest.cc b/chromeos/services/secure_channel/connection_attempt_base_unittest.cc index 413370241e1118..9b90927da0746d 100644 --- a/chromeos/services/secure_channel/connection_attempt_base_unittest.cc +++ b/chromeos/services/secure_channel/connection_attempt_base_unittest.cc @@ -48,6 +48,9 @@ class TestConnectionAttempt ConnectionMedium::kBluetoothLowEnergy, ConnectionRole::kListenerRole)) {} + TestConnectionAttempt(const TestConnectionAttempt&) = delete; + TestConnectionAttempt& operator=(const TestConnectionAttempt&) = delete; + ~TestConnectionAttempt() override = default; FakeConnectToDeviceOperation* fake_operation() { @@ -76,8 +79,6 @@ class TestConnectionAttempt FakeConnectToDeviceOperation* fake_operation_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(TestConnectionAttempt); }; } // namespace diff --git a/chromeos/services/secure_channel/connection_attempt_delegate.h b/chromeos/services/secure_channel/connection_attempt_delegate.h index a8f30c4f5d24bd..694ee4413abeb1 100644 --- a/chromeos/services/secure_channel/connection_attempt_delegate.h +++ b/chromeos/services/secure_channel/connection_attempt_delegate.h @@ -22,6 +22,11 @@ class AuthenticatedChannel; class ConnectionAttemptDelegate { public: ConnectionAttemptDelegate() = default; + + ConnectionAttemptDelegate(const ConnectionAttemptDelegate&) = delete; + ConnectionAttemptDelegate& operator=(const ConnectionAttemptDelegate&) = + delete; + virtual ~ConnectionAttemptDelegate() = default; // Invoked when a ConnectionAttempt has successfully resulted in a connection. @@ -37,9 +42,6 @@ class ConnectionAttemptDelegate { // ConnectionAttempt::attempt_id(). virtual void OnConnectionAttemptFinishedWithoutConnection( const ConnectionAttemptDetails& connection_attempt_details) = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(ConnectionAttemptDelegate); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/connection_unittest.cc b/chromeos/services/secure_channel/connection_unittest.cc index 3dd9e74b197acf..d1bc4fcb56c098 100644 --- a/chromeos/services/secure_channel/connection_unittest.cc +++ b/chromeos/services/secure_channel/connection_unittest.cc @@ -32,6 +32,10 @@ namespace { class MockConnection : public Connection { public: MockConnection() : Connection(multidevice::CreateRemoteDeviceRefForTest()) {} + + MockConnection(const MockConnection&) = delete; + MockConnection& operator=(const MockConnection&) = delete; + ~MockConnection() {} MOCK_METHOD1(SetPaused, void(bool paused)); @@ -58,14 +62,15 @@ class MockConnection : public Connection { using Connection::OnDidSendMessage; using Connection::SetStatus; using Connection::status; - - private: - DISALLOW_COPY_AND_ASSIGN(MockConnection); }; class MockConnectionObserver : public ConnectionObserver { public: MockConnectionObserver() {} + + MockConnectionObserver(const MockConnectionObserver&) = delete; + MockConnectionObserver& operator=(const MockConnectionObserver&) = delete; + virtual ~MockConnectionObserver() {} MOCK_METHOD3(OnConnectionStatusChanged, @@ -78,19 +83,17 @@ class MockConnectionObserver : public ConnectionObserver { void(const Connection& connection, const WireMessage& message, bool success)); - - private: - DISALLOW_COPY_AND_ASSIGN(MockConnectionObserver); }; // Unlike WireMessage, offers a public constructor. class TestWireMessage : public WireMessage { public: TestWireMessage() : WireMessage("payload", "feature") {} - ~TestWireMessage() override = default; - private: - DISALLOW_COPY_AND_ASSIGN(TestWireMessage); + TestWireMessage(const TestWireMessage&) = delete; + TestWireMessage& operator=(const TestWireMessage&) = delete; + + ~TestWireMessage() override = default; }; } // namespace diff --git a/chromeos/services/secure_channel/device_to_device_authenticator_unittest.cc b/chromeos/services/secure_channel/device_to_device_authenticator_unittest.cc index f3a7571142460f..0f9cf1c604e532 100644 --- a/chromeos/services/secure_channel/device_to_device_authenticator_unittest.cc +++ b/chromeos/services/secure_channel/device_to_device_authenticator_unittest.cc @@ -67,6 +67,10 @@ class FakeConnection : public Connection { public: explicit FakeConnection(multidevice::RemoteDeviceRef remote_device) : Connection(remote_device), connection_blocked_(false) {} + + FakeConnection(const FakeConnection&) = delete; + FakeConnection& operator=(const FakeConnection&) = delete; + ~FakeConnection() override {} // Connection: @@ -100,8 +104,6 @@ class FakeConnection : public Connection { std::vector> message_buffer_; bool connection_blocked_; - - DISALLOW_COPY_AND_ASSIGN(FakeConnection); }; // Harness for testing DeviceToDeviceAuthenticator. @@ -114,6 +116,12 @@ class DeviceToDeviceAuthenticatorForTest : public DeviceToDeviceAuthenticator { : DeviceToDeviceAuthenticator(connection, std::move(secure_message_delegate)), timer_(nullptr) {} + + DeviceToDeviceAuthenticatorForTest( + const DeviceToDeviceAuthenticatorForTest&) = delete; + DeviceToDeviceAuthenticatorForTest& operator=( + const DeviceToDeviceAuthenticatorForTest&) = delete; + ~DeviceToDeviceAuthenticatorForTest() override {} base::MockOneShotTimer* timer() { return timer_; } @@ -128,8 +136,6 @@ class DeviceToDeviceAuthenticatorForTest : public DeviceToDeviceAuthenticator { // This instance is owned by the super class. base::MockOneShotTimer* timer_; - - DISALLOW_COPY_AND_ASSIGN(DeviceToDeviceAuthenticatorForTest); }; } // namespace @@ -142,6 +148,12 @@ class SecureChannelDeviceToDeviceAuthenticatorTest : public testing::Test { secure_message_delegate_(new multidevice::FakeSecureMessageDelegate), authenticator_(&connection_, base::WrapUnique(secure_message_delegate_)) {} + + SecureChannelDeviceToDeviceAuthenticatorTest( + const SecureChannelDeviceToDeviceAuthenticatorTest&) = delete; + SecureChannelDeviceToDeviceAuthenticatorTest& operator=( + const SecureChannelDeviceToDeviceAuthenticatorTest&) = delete; + ~SecureChannelDeviceToDeviceAuthenticatorTest() override {} void SetUp() override { @@ -241,8 +253,6 @@ class SecureChannelDeviceToDeviceAuthenticatorTest : public testing::Test { // Stores the SecureContext returned after authentication succeeds. std::unique_ptr secure_context_; - - DISALLOW_COPY_AND_ASSIGN(SecureChannelDeviceToDeviceAuthenticatorTest); }; TEST_F(SecureChannelDeviceToDeviceAuthenticatorTest, AuthenticateSucceeds) { diff --git a/chromeos/services/secure_channel/device_to_device_initiator_helper.h b/chromeos/services/secure_channel/device_to_device_initiator_helper.h index dedbf010dc5371..2074ef08c12bcd 100644 --- a/chromeos/services/secure_channel/device_to_device_initiator_helper.h +++ b/chromeos/services/secure_channel/device_to_device_initiator_helper.h @@ -56,6 +56,11 @@ class DeviceToDeviceInitiatorHelper { ValidateResponderAuthCallback; DeviceToDeviceInitiatorHelper(); + + DeviceToDeviceInitiatorHelper(const DeviceToDeviceInitiatorHelper&) = delete; + DeviceToDeviceInitiatorHelper& operator=( + const DeviceToDeviceInitiatorHelper&) = delete; + virtual ~DeviceToDeviceInitiatorHelper(); // Creates the [Hello] message, which is the first message that is sent: @@ -185,8 +190,6 @@ class DeviceToDeviceInitiatorHelper { const securemessage::Header& header); base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(DeviceToDeviceInitiatorHelper); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/device_to_device_secure_context.h b/chromeos/services/secure_channel/device_to_device_secure_context.h index 648946a14a0e83..6df154bfc7d349 100644 --- a/chromeos/services/secure_channel/device_to_device_secure_context.h +++ b/chromeos/services/secure_channel/device_to_device_secure_context.h @@ -34,6 +34,10 @@ class DeviceToDeviceSecureContext : public SecureContext { const std::string& responder_auth_message_, ProtocolVersion protocol_version); + DeviceToDeviceSecureContext(const DeviceToDeviceSecureContext&) = delete; + DeviceToDeviceSecureContext& operator=(const DeviceToDeviceSecureContext&) = + delete; + ~DeviceToDeviceSecureContext() override; // SecureContext: @@ -75,8 +79,6 @@ class DeviceToDeviceSecureContext : public SecureContext { int last_decode_sequence_number_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(DeviceToDeviceSecureContext); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/error_tolerant_ble_advertisement.h b/chromeos/services/secure_channel/error_tolerant_ble_advertisement.h index 2f4a0700923c43..51ae5a4345a189 100644 --- a/chromeos/services/secure_channel/error_tolerant_ble_advertisement.h +++ b/chromeos/services/secure_channel/error_tolerant_ble_advertisement.h @@ -21,6 +21,10 @@ namespace secure_channel { // until the stop callback is invoked. class ErrorTolerantBleAdvertisement { public: + ErrorTolerantBleAdvertisement(const ErrorTolerantBleAdvertisement&) = delete; + ErrorTolerantBleAdvertisement& operator=( + const ErrorTolerantBleAdvertisement&) = delete; + virtual ~ErrorTolerantBleAdvertisement(); // Stops advertising. Because BLE advertisements start and stop @@ -40,8 +44,6 @@ class ErrorTolerantBleAdvertisement { private: const DeviceIdPair device_id_pair_; - - DISALLOW_COPY_AND_ASSIGN(ErrorTolerantBleAdvertisement); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_active_connection_manager.h b/chromeos/services/secure_channel/fake_active_connection_manager.h index dcbcedd6d2b1d3..6c6ecab4e1e241 100644 --- a/chromeos/services/secure_channel/fake_active_connection_manager.h +++ b/chromeos/services/secure_channel/fake_active_connection_manager.h @@ -27,6 +27,11 @@ class FakeActiveConnectionManager : public ActiveConnectionManager { public: explicit FakeActiveConnectionManager( ActiveConnectionManager::Delegate* delegate); + + FakeActiveConnectionManager(const FakeActiveConnectionManager&) = delete; + FakeActiveConnectionManager& operator=(const FakeActiveConnectionManager&) = + delete; + ~FakeActiveConnectionManager() override; using DetailsToMetadataMap = base::flat_map< @@ -55,8 +60,6 @@ class FakeActiveConnectionManager : public ActiveConnectionManager { const ConnectionDetails& connection_details) override; DetailsToMetadataMap connection_details_to_active_metadata_map_; - - DISALLOW_COPY_AND_ASSIGN(FakeActiveConnectionManager); }; // Test ActiveConnectionManager::Delegate implementation. @@ -64,6 +67,12 @@ class FakeActiveConnectionManagerDelegate : public ActiveConnectionManager::Delegate { public: FakeActiveConnectionManagerDelegate(); + + FakeActiveConnectionManagerDelegate( + const FakeActiveConnectionManagerDelegate&) = delete; + FakeActiveConnectionManagerDelegate& operator=( + const FakeActiveConnectionManagerDelegate&) = delete; + ~FakeActiveConnectionManagerDelegate() override; const base::flat_map& @@ -76,8 +85,6 @@ class FakeActiveConnectionManagerDelegate base::flat_map connection_details_to_num_disconnections_map_; - - DISALLOW_COPY_AND_ASSIGN(FakeActiveConnectionManagerDelegate); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_authenticated_channel.h b/chromeos/services/secure_channel/fake_authenticated_channel.h index 3ce0d944baabc3..a9d0b7a74f633e 100644 --- a/chromeos/services/secure_channel/fake_authenticated_channel.h +++ b/chromeos/services/secure_channel/fake_authenticated_channel.h @@ -22,6 +22,10 @@ namespace secure_channel { class FakeAuthenticatedChannel : public AuthenticatedChannel { public: FakeAuthenticatedChannel(); + + FakeAuthenticatedChannel(const FakeAuthenticatedChannel&) = delete; + FakeAuthenticatedChannel& operator=(const FakeAuthenticatedChannel&) = delete; + ~FakeAuthenticatedChannel() override; std::vector>& @@ -56,8 +60,6 @@ class FakeAuthenticatedChannel : public AuthenticatedChannel { bool has_disconnection_been_requested_ = false; std::vector> sent_messages_; - - DISALLOW_COPY_AND_ASSIGN(FakeAuthenticatedChannel); }; // Test AuthenticatedChannel::Observer implementation. diff --git a/chromeos/services/secure_channel/fake_authenticator.h b/chromeos/services/secure_channel/fake_authenticator.h index 9a7c4e04b014f7..f21c592ae451ae 100644 --- a/chromeos/services/secure_channel/fake_authenticator.h +++ b/chromeos/services/secure_channel/fake_authenticator.h @@ -17,6 +17,10 @@ namespace secure_channel { class FakeAuthenticator : public Authenticator { public: FakeAuthenticator(); + + FakeAuthenticator(const FakeAuthenticator&) = delete; + FakeAuthenticator& operator=(const FakeAuthenticator&) = delete; + ~FakeAuthenticator() override; // Authenticator: @@ -26,8 +30,6 @@ class FakeAuthenticator : public Authenticator { private: AuthenticationCallback last_callback_; - - DISALLOW_COPY_AND_ASSIGN(FakeAuthenticator); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_ble_advertisement_generator.h b/chromeos/services/secure_channel/fake_ble_advertisement_generator.h index 9e9e8340a9212a..3e29d1cd853c9d 100644 --- a/chromeos/services/secure_channel/fake_ble_advertisement_generator.h +++ b/chromeos/services/secure_channel/fake_ble_advertisement_generator.h @@ -17,6 +17,11 @@ namespace secure_channel { class FakeBleAdvertisementGenerator : public BleAdvertisementGenerator { public: FakeBleAdvertisementGenerator(); + + FakeBleAdvertisementGenerator(const FakeBleAdvertisementGenerator&) = delete; + FakeBleAdvertisementGenerator& operator=( + const FakeBleAdvertisementGenerator&) = delete; + ~FakeBleAdvertisementGenerator() override; // Sets the advertisement to be returned by the next call to @@ -34,8 +39,6 @@ class FakeBleAdvertisementGenerator : public BleAdvertisementGenerator { private: std::unique_ptr advertisement_; - - DISALLOW_COPY_AND_ASSIGN(FakeBleAdvertisementGenerator); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_ble_advertiser.h b/chromeos/services/secure_channel/fake_ble_advertiser.h index 3974c28e66719d..223433f82eadfd 100644 --- a/chromeos/services/secure_channel/fake_ble_advertiser.h +++ b/chromeos/services/secure_channel/fake_ble_advertiser.h @@ -27,6 +27,10 @@ namespace secure_channel { class FakeBleAdvertiser : public BleAdvertiser { public: explicit FakeBleAdvertiser(Delegate* delegate); + + FakeBleAdvertiser(const FakeBleAdvertiser&) = delete; + FakeBleAdvertiser& operator=(const FakeBleAdvertiser&) = delete; + ~FakeBleAdvertiser() override; const std::list& GetRequestsForPriority( @@ -64,14 +68,17 @@ class FakeBleAdvertiser : public BleAdvertiser { } std::unique_ptr scheduler_; - - DISALLOW_COPY_AND_ASSIGN(FakeBleAdvertiser); }; // Test BleAdvertiser::Delegate implementation. class FakeBleAdvertiserDelegate : public BleAdvertiser::Delegate { public: FakeBleAdvertiserDelegate(); + + FakeBleAdvertiserDelegate(const FakeBleAdvertiserDelegate&) = delete; + FakeBleAdvertiserDelegate& operator=(const FakeBleAdvertiserDelegate&) = + delete; + ~FakeBleAdvertiserDelegate() override; using SlotEndedEvent = std::pair; @@ -94,8 +101,6 @@ class FakeBleAdvertiserDelegate : public BleAdvertiser::Delegate { std::vector slot_ended_events_; std::vector advertisement_generation_failures_; - - DISALLOW_COPY_AND_ASSIGN(FakeBleAdvertiserDelegate); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_ble_connection_manager.h b/chromeos/services/secure_channel/fake_ble_connection_manager.h index d15a673fd36505..38760813c68613 100644 --- a/chromeos/services/secure_channel/fake_ble_connection_manager.h +++ b/chromeos/services/secure_channel/fake_ble_connection_manager.h @@ -20,6 +20,10 @@ namespace secure_channel { class FakeBleConnectionManager : public BleConnectionManager { public: FakeBleConnectionManager(); + + FakeBleConnectionManager(const FakeBleConnectionManager&) = delete; + FakeBleConnectionManager& operator=(const FakeBleConnectionManager&) = delete; + ~FakeBleConnectionManager() override; // Make public for testing. @@ -48,8 +52,6 @@ class FakeBleConnectionManager : public BleConnectionManager { ConnectionPriority connection_priority) override; void PerformCancelBleListenerConnectionAttempt( const DeviceIdPair& device_id_pair) override; - - DISALLOW_COPY_AND_ASSIGN(FakeBleConnectionManager); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_ble_scanner.h b/chromeos/services/secure_channel/fake_ble_scanner.h index ec3dc9da985dbe..a628041a3bb476 100644 --- a/chromeos/services/secure_channel/fake_ble_scanner.h +++ b/chromeos/services/secure_channel/fake_ble_scanner.h @@ -19,6 +19,10 @@ namespace secure_channel { class FakeBleScanner : public BleScanner { public: FakeBleScanner(); + + FakeBleScanner(const FakeBleScanner&) = delete; + FakeBleScanner& operator=(const FakeBleScanner&) = delete; + ~FakeBleScanner() override; size_t num_scan_request_changes_handled() const { @@ -36,8 +40,6 @@ class FakeBleScanner : public BleScanner { void HandleScanRequestChange() override; size_t num_scan_request_changes_handled_ = 0u; - - DISALLOW_COPY_AND_ASSIGN(FakeBleScanner); }; // Test BleScanner::Observer implementation. @@ -57,6 +59,10 @@ class FakeBleScannerObserver : public BleScanner::Observer { }; FakeBleScannerObserver(); + + FakeBleScannerObserver(const FakeBleScannerObserver&) = delete; + FakeBleScannerObserver& operator=(const FakeBleScannerObserver&) = delete; + ~FakeBleScannerObserver() override; const std::vector& handled_scan_results() const { @@ -71,8 +77,6 @@ class FakeBleScannerObserver : public BleScanner::Observer { const std::vector& eid) override; std::vector handled_scan_results_; - - DISALLOW_COPY_AND_ASSIGN(FakeBleScannerObserver); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_ble_synchronizer.h b/chromeos/services/secure_channel/fake_ble_synchronizer.h index 0d068385942fb1..da6aba1a9c5bae 100644 --- a/chromeos/services/secure_channel/fake_ble_synchronizer.h +++ b/chromeos/services/secure_channel/fake_ble_synchronizer.h @@ -19,6 +19,10 @@ namespace secure_channel { class FakeBleSynchronizer : public BleSynchronizerBase { public: FakeBleSynchronizer(); + + FakeBleSynchronizer(const FakeBleSynchronizer&) = delete; + FakeBleSynchronizer& operator=(const FakeBleSynchronizer&) = delete; + ~FakeBleSynchronizer() override; size_t GetNumCommands(); @@ -45,9 +49,6 @@ class FakeBleSynchronizer : public BleSynchronizerBase { protected: void ProcessQueue() override; - - private: - DISALLOW_COPY_AND_ASSIGN(FakeBleSynchronizer); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_bluetooth_helper.h b/chromeos/services/secure_channel/fake_bluetooth_helper.h index 30dc89256be285..ee3290515ecb9c 100644 --- a/chromeos/services/secure_channel/fake_bluetooth_helper.h +++ b/chromeos/services/secure_channel/fake_bluetooth_helper.h @@ -24,6 +24,10 @@ namespace secure_channel { class FakeBluetoothHelper : public BluetoothHelper { public: FakeBluetoothHelper(); + + FakeBluetoothHelper(const FakeBluetoothHelper&) = delete; + FakeBluetoothHelper& operator=(const FakeBluetoothHelper&) = delete; + ~FakeBluetoothHelper() override; // Sets the data to be returned by a GenerateForegroundAdvertisement() call. @@ -60,8 +64,6 @@ class FakeBluetoothHelper : public BluetoothHelper { std::unordered_map device_id_to_bluetooth_public_address_map_; - - DISALLOW_COPY_AND_ASSIGN(FakeBluetoothHelper); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_channel.h b/chromeos/services/secure_channel/fake_channel.h index 429dd46f66ff0d..3b132b42082216 100644 --- a/chromeos/services/secure_channel/fake_channel.h +++ b/chromeos/services/secure_channel/fake_channel.h @@ -22,6 +22,10 @@ namespace secure_channel { class FakeChannel : public mojom::Channel { public: FakeChannel(); + + FakeChannel(const FakeChannel&) = delete; + FakeChannel& operator=(const FakeChannel&) = delete; + ~FakeChannel() override; mojo::PendingRemote GenerateRemote(); @@ -47,8 +51,6 @@ class FakeChannel : public mojom::Channel { std::vector> sent_messages_; mojom::ConnectionMetadataPtr connection_metadata_for_next_call_; - - DISALLOW_COPY_AND_ASSIGN(FakeChannel); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_client_connection_parameters.h b/chromeos/services/secure_channel/fake_client_connection_parameters.h index 768357b29881ad..43d18bac04c818 100644 --- a/chromeos/services/secure_channel/fake_client_connection_parameters.h +++ b/chromeos/services/secure_channel/fake_client_connection_parameters.h @@ -28,6 +28,11 @@ class FakeClientConnectionParameters : public ClientConnectionParameters { destructor_callback = base::OnceCallback()); + FakeClientConnectionParameters(const FakeClientConnectionParameters&) = + delete; + FakeClientConnectionParameters& operator=( + const FakeClientConnectionParameters&) = delete; + ~FakeClientConnectionParameters() override; const absl::optional& @@ -74,8 +79,6 @@ class FakeClientConnectionParameters : public ClientConnectionParameters { base::OnceCallback destructor_callback_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FakeClientConnectionParameters); }; // Test ClientConnectionParameters::Observer implementation. @@ -83,6 +86,12 @@ class FakeClientConnectionParametersObserver : public ClientConnectionParameters::Observer { public: FakeClientConnectionParametersObserver(); + + FakeClientConnectionParametersObserver( + const FakeClientConnectionParametersObserver&) = delete; + FakeClientConnectionParametersObserver& operator=( + const FakeClientConnectionParametersObserver&) = delete; + ~FakeClientConnectionParametersObserver() override; void set_closure_for_next_callback( @@ -101,8 +110,6 @@ class FakeClientConnectionParametersObserver bool has_connection_request_been_canceled_ = false; base::OnceClosure closure_for_next_callback_; - - DISALLOW_COPY_AND_ASSIGN(FakeClientConnectionParametersObserver); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_connect_to_device_operation.h b/chromeos/services/secure_channel/fake_connect_to_device_operation.h index 071b2c978c27a5..39a0345d65b8ad 100644 --- a/chromeos/services/secure_channel/fake_connect_to_device_operation.h +++ b/chromeos/services/secure_channel/fake_connect_to_device_operation.h @@ -30,6 +30,10 @@ class FakeConnectToDeviceOperation std::move(failure_callback), connection_priority) {} + FakeConnectToDeviceOperation(const FakeConnectToDeviceOperation&) = delete; + FakeConnectToDeviceOperation& operator=(const FakeConnectToDeviceOperation&) = + delete; + ~FakeConnectToDeviceOperation() override = default; bool canceled() const { return canceled_; } @@ -69,8 +73,6 @@ class FakeConnectToDeviceOperation absl::optional updated_priority_; base::OnceClosure destructor_callback_; base::OnceClosure cancel_callback_; - - DISALLOW_COPY_AND_ASSIGN(FakeConnectToDeviceOperation); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_connection.h b/chromeos/services/secure_channel/fake_connection.h index b6cb4ff4cd57c9..17e61f63608f51 100644 --- a/chromeos/services/secure_channel/fake_connection.h +++ b/chromeos/services/secure_channel/fake_connection.h @@ -21,6 +21,10 @@ class FakeConnection : public Connection { FakeConnection(multidevice::RemoteDeviceRef remote_device); FakeConnection(multidevice::RemoteDeviceRef remote_device, bool should_auto_connect); + + FakeConnection(const FakeConnection&) = delete; + FakeConnection& operator=(const FakeConnection&) = delete; + ~FakeConnection() override; void set_rssi_to_return(const absl::optional& rssi_to_return) { @@ -75,8 +79,6 @@ class FakeConnection : public Connection { absl::optional rssi_to_return_; const bool should_auto_connect_; - - DISALLOW_COPY_AND_ASSIGN(FakeConnection); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_connection_attempt.h b/chromeos/services/secure_channel/fake_connection_attempt.h index 110440f4396976..37f8a2f3c4c6a0 100644 --- a/chromeos/services/secure_channel/fake_connection_attempt.h +++ b/chromeos/services/secure_channel/fake_connection_attempt.h @@ -36,6 +36,9 @@ class FakeConnectionAttempt : public ConnectionAttempt { connection_attempt_details), destructor_callback_(std::move(destructor_callback)) {} + FakeConnectionAttempt(const FakeConnectionAttempt&) = delete; + FakeConnectionAttempt& operator=(const FakeConnectionAttempt&) = delete; + ~FakeConnectionAttempt() override { if (destructor_callback_) std::move(destructor_callback_).Run(); @@ -86,8 +89,6 @@ class FakeConnectionAttempt : public ConnectionAttempt { std::vector> client_data_for_extraction_; - - DISALLOW_COPY_AND_ASSIGN(FakeConnectionAttempt); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_connection_attempt_delegate.h b/chromeos/services/secure_channel/fake_connection_attempt_delegate.h index cfd6981fb60ec9..f6c9051c63b594 100644 --- a/chromeos/services/secure_channel/fake_connection_attempt_delegate.h +++ b/chromeos/services/secure_channel/fake_connection_attempt_delegate.h @@ -21,6 +21,11 @@ class AuthenticatedChannel; class FakeConnectionAttemptDelegate : public ConnectionAttemptDelegate { public: FakeConnectionAttemptDelegate(); + + FakeConnectionAttemptDelegate(const FakeConnectionAttemptDelegate&) = delete; + FakeConnectionAttemptDelegate& operator=( + const FakeConnectionAttemptDelegate&) = delete; + ~FakeConnectionAttemptDelegate() override; const AuthenticatedChannel* authenticated_channel() const { @@ -47,8 +52,6 @@ class FakeConnectionAttemptDelegate : public ConnectionAttemptDelegate { absl::optional connection_attempt_details_; absl::optional connection_details_; std::unique_ptr authenticated_channel_; - - DISALLOW_COPY_AND_ASSIGN(FakeConnectionAttemptDelegate); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_connection_delegate.h b/chromeos/services/secure_channel/fake_connection_delegate.h index 7f163b9a67583b..00438814dc9f0a 100644 --- a/chromeos/services/secure_channel/fake_connection_delegate.h +++ b/chromeos/services/secure_channel/fake_connection_delegate.h @@ -20,6 +20,10 @@ namespace secure_channel { class FakeConnectionDelegate : public mojom::ConnectionDelegate { public: FakeConnectionDelegate(); + + FakeConnectionDelegate(const FakeConnectionDelegate&) = delete; + FakeConnectionDelegate& operator=(const FakeConnectionDelegate&) = delete; + ~FakeConnectionDelegate() override; mojo::PendingRemote GenerateRemote(); @@ -59,8 +63,6 @@ class FakeConnectionDelegate : public mojom::ConnectionDelegate { connection_attempt_failure_reason_; mojo::Remote channel_; mojo::PendingReceiver message_receiver_receiver_; - - DISALLOW_COPY_AND_ASSIGN(FakeConnectionDelegate); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_error_tolerant_ble_advertisement.h b/chromeos/services/secure_channel/fake_error_tolerant_ble_advertisement.h index cc8af608c43f60..2f27c4d6926d2f 100644 --- a/chromeos/services/secure_channel/fake_error_tolerant_ble_advertisement.h +++ b/chromeos/services/secure_channel/fake_error_tolerant_ble_advertisement.h @@ -21,6 +21,12 @@ class FakeErrorTolerantBleAdvertisement : public ErrorTolerantBleAdvertisement { FakeErrorTolerantBleAdvertisement( const DeviceIdPair& device_id_pair, base::OnceCallback destructor_callback); + + FakeErrorTolerantBleAdvertisement(const FakeErrorTolerantBleAdvertisement&) = + delete; + FakeErrorTolerantBleAdvertisement& operator=( + const FakeErrorTolerantBleAdvertisement&) = delete; + ~FakeErrorTolerantBleAdvertisement() override; const base::UnguessableToken& id() const { return id_; } @@ -36,8 +42,6 @@ class FakeErrorTolerantBleAdvertisement : public ErrorTolerantBleAdvertisement { base::OnceCallback destructor_callback_; base::OnceClosure stop_callback_; bool stopped_ = false; - - DISALLOW_COPY_AND_ASSIGN(FakeErrorTolerantBleAdvertisement); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_message_receiver.h b/chromeos/services/secure_channel/fake_message_receiver.h index f91dc63266c36a..8ac1d13f18bece 100644 --- a/chromeos/services/secure_channel/fake_message_receiver.h +++ b/chromeos/services/secure_channel/fake_message_receiver.h @@ -19,6 +19,10 @@ namespace secure_channel { class FakeMessageReceiver : public mojom::MessageReceiver { public: FakeMessageReceiver(); + + FakeMessageReceiver(const FakeMessageReceiver&) = delete; + FakeMessageReceiver& operator=(const FakeMessageReceiver&) = delete; + ~FakeMessageReceiver() override; const std::vector& received_messages() { @@ -30,8 +34,6 @@ class FakeMessageReceiver : public mojom::MessageReceiver { void OnMessageReceived(const std::string& message) override; std::vector received_messages_; - - DISALLOW_COPY_AND_ASSIGN(FakeMessageReceiver); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_multiplexed_channel.h b/chromeos/services/secure_channel/fake_multiplexed_channel.h index 4a86b1f7ccdc77..1e19b8fb1c803d 100644 --- a/chromeos/services/secure_channel/fake_multiplexed_channel.h +++ b/chromeos/services/secure_channel/fake_multiplexed_channel.h @@ -26,6 +26,10 @@ class FakeMultiplexedChannel : public MultiplexedChannel { ConnectionDetails connection_details, base::OnceCallback destructor_callback = base::OnceCallback()); + + FakeMultiplexedChannel(const FakeMultiplexedChannel&) = delete; + FakeMultiplexedChannel& operator=(const FakeMultiplexedChannel&) = delete; + ~FakeMultiplexedChannel() override; std::vector>& added_clients() { @@ -51,14 +55,18 @@ class FakeMultiplexedChannel : public MultiplexedChannel { std::vector> added_clients_; base::OnceCallback destructor_callback_; - - DISALLOW_COPY_AND_ASSIGN(FakeMultiplexedChannel); }; // Test MultiplexedChannel::Delegate implementation. class FakeMultiplexedChannelDelegate : public MultiplexedChannel::Delegate { public: FakeMultiplexedChannelDelegate(); + + FakeMultiplexedChannelDelegate(const FakeMultiplexedChannelDelegate&) = + delete; + FakeMultiplexedChannelDelegate& operator=( + const FakeMultiplexedChannelDelegate&) = delete; + ~FakeMultiplexedChannelDelegate() override; const absl::optional& disconnected_connection_details() { @@ -69,8 +77,6 @@ class FakeMultiplexedChannelDelegate : public MultiplexedChannel::Delegate { void OnDisconnected(const ConnectionDetails& connection_details) override; absl::optional disconnected_connection_details_; - - DISALLOW_COPY_AND_ASSIGN(FakeMultiplexedChannelDelegate); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_one_shot_timer.h b/chromeos/services/secure_channel/fake_one_shot_timer.h index e717d3e98c3cca..9d6b336ff861c0 100644 --- a/chromeos/services/secure_channel/fake_one_shot_timer.h +++ b/chromeos/services/secure_channel/fake_one_shot_timer.h @@ -20,6 +20,10 @@ class FakeOneShotTimer : public base::MockOneShotTimer { public: FakeOneShotTimer(base::OnceCallback destructor_callback); + + FakeOneShotTimer(const FakeOneShotTimer&) = delete; + FakeOneShotTimer& operator=(const FakeOneShotTimer&) = delete; + ~FakeOneShotTimer() override; const base::UnguessableToken& id() const { return id_; } @@ -27,8 +31,6 @@ class FakeOneShotTimer : public base::MockOneShotTimer { private: base::OnceCallback destructor_callback_; base::UnguessableToken id_; - - DISALLOW_COPY_AND_ASSIGN(FakeOneShotTimer); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_pending_connection_manager.h b/chromeos/services/secure_channel/fake_pending_connection_manager.h index 5a3c39925ad7c3..4dd3b1aac7a936 100644 --- a/chromeos/services/secure_channel/fake_pending_connection_manager.h +++ b/chromeos/services/secure_channel/fake_pending_connection_manager.h @@ -24,6 +24,11 @@ namespace secure_channel { class FakePendingConnectionManager : public PendingConnectionManager { public: FakePendingConnectionManager(Delegate* delegate); + + FakePendingConnectionManager(const FakePendingConnectionManager&) = delete; + FakePendingConnectionManager& operator=(const FakePendingConnectionManager&) = + delete; + ~FakePendingConnectionManager() override; using HandledRequestsList = @@ -50,8 +55,6 @@ class FakePendingConnectionManager : public PendingConnectionManager { ConnectionPriority connection_priority) override; HandledRequestsList handled_requests_; - - DISALLOW_COPY_AND_ASSIGN(FakePendingConnectionManager); }; // Test PendingConnectionManager::Delegate implementation. @@ -59,6 +62,12 @@ class FakePendingConnectionManagerDelegate : public PendingConnectionManager::Delegate { public: FakePendingConnectionManagerDelegate(); + + FakePendingConnectionManagerDelegate( + const FakePendingConnectionManagerDelegate&) = delete; + FakePendingConnectionManagerDelegate& operator=( + const FakePendingConnectionManagerDelegate&) = delete; + ~FakePendingConnectionManagerDelegate() override; using ReceivedConnectionsList = std::vector< @@ -76,8 +85,6 @@ class FakePendingConnectionManagerDelegate const ConnectionDetails& connection_details) override; ReceivedConnectionsList received_connections_list_; - - DISALLOW_COPY_AND_ASSIGN(FakePendingConnectionManagerDelegate); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_pending_connection_request.h b/chromeos/services/secure_channel/fake_pending_connection_request.h index 7ef89ed9fd7bbf..7a797f649f9bd2 100644 --- a/chromeos/services/secure_channel/fake_pending_connection_request.h +++ b/chromeos/services/secure_channel/fake_pending_connection_request.h @@ -30,6 +30,10 @@ class FakePendingConnectionRequest connection_priority), id_(base::UnguessableToken::Create()) {} + FakePendingConnectionRequest(const FakePendingConnectionRequest&) = delete; + FakePendingConnectionRequest& operator=(const FakePendingConnectionRequest&) = + delete; + ~FakePendingConnectionRequest() override = default; const std::vector& handled_failure_details() const { @@ -65,8 +69,6 @@ class FakePendingConnectionRequest std::vector handled_failure_details_; std::unique_ptr client_data_for_extraction_; - - DISALLOW_COPY_AND_ASSIGN(FakePendingConnectionRequest); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_pending_connection_request_delegate.h b/chromeos/services/secure_channel/fake_pending_connection_request_delegate.h index 6a6312b7a955ce..bfd80b559b13b0 100644 --- a/chromeos/services/secure_channel/fake_pending_connection_request_delegate.h +++ b/chromeos/services/secure_channel/fake_pending_connection_request_delegate.h @@ -21,6 +21,12 @@ class FakePendingConnectionRequestDelegate : public PendingConnectionRequestDelegate { public: FakePendingConnectionRequestDelegate(); + + FakePendingConnectionRequestDelegate( + const FakePendingConnectionRequestDelegate&) = delete; + FakePendingConnectionRequestDelegate& operator=( + const FakePendingConnectionRequestDelegate&) = delete; + ~FakePendingConnectionRequestDelegate() override; const absl::optional& GetFailedConnectionReasonForId( @@ -42,8 +48,6 @@ class FakePendingConnectionRequestDelegate request_id_to_failed_connection_reason_map_; base::OnceClosure closure_for_next_delegate_callback_; - - DISALLOW_COPY_AND_ASSIGN(FakePendingConnectionRequestDelegate); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_secure_channel.h b/chromeos/services/secure_channel/fake_secure_channel.h index 7145561dc1853c..8ae560ed5b145e 100644 --- a/chromeos/services/secure_channel/fake_secure_channel.h +++ b/chromeos/services/secure_channel/fake_secure_channel.h @@ -25,6 +25,10 @@ namespace secure_channel { class FakeSecureChannel : public SecureChannelBase { public: FakeSecureChannel(); + + FakeSecureChannel(const FakeSecureChannel&) = delete; + FakeSecureChannel& operator=(const FakeSecureChannel&) = delete; + ~FakeSecureChannel() override; mojo::Remote delegate_from_last_listen_call() { @@ -56,8 +60,6 @@ class FakeSecureChannel : public SecureChannelBase { mojo::Remote delegate_from_last_listen_call_; mojo::Remote delegate_from_last_initiate_call_; - - DISALLOW_COPY_AND_ASSIGN(FakeSecureChannel); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_secure_channel_connection.h b/chromeos/services/secure_channel/fake_secure_channel_connection.h index d11100783bad49..f005236cb77803 100644 --- a/chromeos/services/secure_channel/fake_secure_channel_connection.h +++ b/chromeos/services/secure_channel/fake_secure_channel_connection.h @@ -19,6 +19,11 @@ namespace secure_channel { class FakeSecureChannelConnection : public SecureChannel { public: FakeSecureChannelConnection(std::unique_ptr connection); + + FakeSecureChannelConnection(const FakeSecureChannelConnection&) = delete; + FakeSecureChannelConnection& operator=(const FakeSecureChannelConnection&) = + delete; + ~FakeSecureChannelConnection() override; void set_destructor_callback(base::OnceClosure destructor_callback) { @@ -71,8 +76,6 @@ class FakeSecureChannelConnection : public SecureChannel { absl::optional channel_binding_data_; base::OnceClosure destructor_callback_; - - DISALLOW_COPY_AND_ASSIGN(FakeSecureChannelConnection); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_secure_channel_disconnector.h b/chromeos/services/secure_channel/fake_secure_channel_disconnector.h index 4d531f1988a1ac..36f7d523d17b15 100644 --- a/chromeos/services/secure_channel/fake_secure_channel_disconnector.h +++ b/chromeos/services/secure_channel/fake_secure_channel_disconnector.h @@ -20,6 +20,11 @@ namespace secure_channel { class FakeSecureChannelDisconnector : public SecureChannelDisconnector { public: FakeSecureChannelDisconnector(); + + FakeSecureChannelDisconnector(const FakeSecureChannelDisconnector&) = delete; + FakeSecureChannelDisconnector& operator=( + const FakeSecureChannelDisconnector&) = delete; + ~FakeSecureChannelDisconnector() override; const base::flat_set>& handled_channels() { @@ -34,8 +39,6 @@ class FakeSecureChannelDisconnector : public SecureChannelDisconnector { std::unique_ptr channel_to_disconnect) override; base::flat_set> handled_channels_; - - DISALLOW_COPY_AND_ASSIGN(FakeSecureChannelDisconnector); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_secure_context.h b/chromeos/services/secure_channel/fake_secure_context.h index d1c0f2500aa960..4d22e72862cb68 100644 --- a/chromeos/services/secure_channel/fake_secure_context.h +++ b/chromeos/services/secure_channel/fake_secure_context.h @@ -20,6 +20,10 @@ namespace secure_channel { class FakeSecureContext : public SecureContext { public: FakeSecureContext(); + + FakeSecureContext(const FakeSecureContext&) = delete; + FakeSecureContext& operator=(const FakeSecureContext&) = delete; + ~FakeSecureContext() override; // SecureContext: @@ -40,8 +44,6 @@ class FakeSecureContext : public SecureContext { private: ProtocolVersion protocol_version_; absl::optional channel_binding_data_; - - DISALLOW_COPY_AND_ASSIGN(FakeSecureContext); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_single_client_message_proxy.h b/chromeos/services/secure_channel/fake_single_client_message_proxy.h index 63508ea4061da3..9dfd7e635453e2 100644 --- a/chromeos/services/secure_channel/fake_single_client_message_proxy.h +++ b/chromeos/services/secure_channel/fake_single_client_message_proxy.h @@ -25,6 +25,11 @@ class FakeSingleClientMessageProxy : public SingleClientMessageProxy { base::OnceCallback destructor_callback = base::OnceCallback()); + + FakeSingleClientMessageProxy(const FakeSingleClientMessageProxy&) = delete; + FakeSingleClientMessageProxy& operator=(const FakeSingleClientMessageProxy&) = + delete; + ~FakeSingleClientMessageProxy() override; bool was_remote_device_disconnection_handled() { @@ -54,8 +59,6 @@ class FakeSingleClientMessageProxy : public SingleClientMessageProxy { std::vector> processed_messages_; bool was_remote_device_disconnection_handled_ = false; - - DISALLOW_COPY_AND_ASSIGN(FakeSingleClientMessageProxy); }; // Test SingleClientMessageProxy::Delegate implementation. @@ -63,6 +66,12 @@ class FakeSingleClientMessageProxyDelegate : public SingleClientMessageProxy::Delegate { public: FakeSingleClientMessageProxyDelegate(); + + FakeSingleClientMessageProxyDelegate( + const FakeSingleClientMessageProxyDelegate&) = delete; + FakeSingleClientMessageProxyDelegate& operator=( + const FakeSingleClientMessageProxyDelegate&) = delete; + ~FakeSingleClientMessageProxyDelegate() override; std::vector>& @@ -99,8 +108,6 @@ class FakeSingleClientMessageProxyDelegate mojom::ConnectionMetadataPtr connection_metadata_for_next_call_; base::OnceClosure on_client_disconnected_closure_; base::UnguessableToken disconnected_proxy_id_; - - DISALLOW_COPY_AND_ASSIGN(FakeSingleClientMessageProxyDelegate); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/fake_timer_factory.h b/chromeos/services/secure_channel/fake_timer_factory.h index d6d47ae941c7e0..d6259416452659 100644 --- a/chromeos/services/secure_channel/fake_timer_factory.h +++ b/chromeos/services/secure_channel/fake_timer_factory.h @@ -23,6 +23,10 @@ class FakeOneShotTimer; class FakeTimerFactory : public TimerFactory { public: FakeTimerFactory(); + + FakeTimerFactory(const FakeTimerFactory&) = delete; + FakeTimerFactory& operator=(const FakeTimerFactory&) = delete; + ~FakeTimerFactory() override; const base::UnguessableToken& id_for_last_created_one_shot_timer() { @@ -48,8 +52,6 @@ class FakeTimerFactory : public TimerFactory { size_t num_instances_created_ = 0u; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FakeTimerFactory); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/foreground_eid_generator.h b/chromeos/services/secure_channel/foreground_eid_generator.h index 2bbf73a9324764..ec407296224669 100644 --- a/chromeos/services/secure_channel/foreground_eid_generator.h +++ b/chromeos/services/secure_channel/foreground_eid_generator.h @@ -70,6 +70,10 @@ class ForegroundEidGenerator { static const int8_t kBluetooth4Flag; ForegroundEidGenerator(); + + ForegroundEidGenerator(const ForegroundEidGenerator&) = delete; + ForegroundEidGenerator& operator=(const ForegroundEidGenerator&) = delete; + virtual ~ForegroundEidGenerator(); // Generates EID data for the given EID seeds to be used as a background scan @@ -163,8 +167,6 @@ class ForegroundEidGenerator { std::unique_ptr raw_eid_generator_; - DISALLOW_COPY_AND_ASSIGN(ForegroundEidGenerator); - friend class SecureChannelForegroundEidGeneratorTest; FRIEND_TEST_ALL_PREFIXES(SecureChannelForegroundEidGeneratorTest, GenerateBackgroundScanFilter_UsingRealEids); diff --git a/chromeos/services/secure_channel/multiplexed_channel.h b/chromeos/services/secure_channel/multiplexed_channel.h index 25825512e68e6a..68fd7110a12805 100644 --- a/chromeos/services/secure_channel/multiplexed_channel.h +++ b/chromeos/services/secure_channel/multiplexed_channel.h @@ -29,6 +29,9 @@ class MultiplexedChannel { const ConnectionDetails& connection_details) = 0; }; + MultiplexedChannel(const MultiplexedChannel&) = delete; + MultiplexedChannel& operator=(const MultiplexedChannel&) = delete; + virtual ~MultiplexedChannel(); virtual bool IsDisconnecting() const = 0; @@ -54,8 +57,6 @@ class MultiplexedChannel { private: Delegate* delegate_; const ConnectionDetails connection_details_; - - DISALLOW_COPY_AND_ASSIGN(MultiplexedChannel); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/multiplexed_channel_impl_unittest.cc b/chromeos/services/secure_channel/multiplexed_channel_impl_unittest.cc index 2080387969185e..f724bb72a917f3 100644 --- a/chromeos/services/secure_channel/multiplexed_channel_impl_unittest.cc +++ b/chromeos/services/secure_channel/multiplexed_channel_impl_unittest.cc @@ -36,6 +36,12 @@ class FakeSingleClientMessageProxyImplFactory : public SingleClientMessageProxyImpl::Factory { public: FakeSingleClientMessageProxyImplFactory() = default; + + FakeSingleClientMessageProxyImplFactory( + const FakeSingleClientMessageProxyImplFactory&) = delete; + FakeSingleClientMessageProxyImplFactory& operator=( + const FakeSingleClientMessageProxyImplFactory&) = delete; + ~FakeSingleClientMessageProxyImplFactory() override = default; const SingleClientMessageProxy::Delegate* expected_delegate() { @@ -88,8 +94,6 @@ class FakeSingleClientMessageProxyImplFactory FakeSingleClientMessageProxy*, base::UnguessableTokenHash> id_to_active_proxy_map_; - - DISALLOW_COPY_AND_ASSIGN(FakeSingleClientMessageProxyImplFactory); }; } // namespace diff --git a/chromeos/services/secure_channel/pending_ble_connection_request_base.h b/chromeos/services/secure_channel/pending_ble_connection_request_base.h index 10ebbb3697d829..4bb1fed3ed1ad4 100644 --- a/chromeos/services/secure_channel/pending_ble_connection_request_base.h +++ b/chromeos/services/secure_channel/pending_ble_connection_request_base.h @@ -22,6 +22,11 @@ class PendingBleConnectionRequestBase : public PendingConnectionRequestBase, public device::BluetoothAdapter::Observer { public: + PendingBleConnectionRequestBase(const PendingBleConnectionRequestBase&) = + delete; + PendingBleConnectionRequestBase& operator=( + const PendingBleConnectionRequestBase&) = delete; + ~PendingBleConnectionRequestBase() override { bluetooth_adapter_->RemoveObserver(this); } @@ -67,8 +72,6 @@ class PendingBleConnectionRequestBase } scoped_refptr bluetooth_adapter_; - - DISALLOW_COPY_AND_ASSIGN(PendingBleConnectionRequestBase); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/pending_connection_manager.h b/chromeos/services/secure_channel/pending_connection_manager.h index 4aca1fb5dbaa9d..1493e0194fad31 100644 --- a/chromeos/services/secure_channel/pending_connection_manager.h +++ b/chromeos/services/secure_channel/pending_connection_manager.h @@ -37,6 +37,9 @@ class PendingConnectionManager { const ConnectionDetails& connection_details) = 0; }; + PendingConnectionManager(const PendingConnectionManager&) = delete; + PendingConnectionManager& operator=(const PendingConnectionManager&) = delete; + virtual ~PendingConnectionManager(); // Attempts a connection according to the provided parameters. If other @@ -58,8 +61,6 @@ class PendingConnectionManager { private: Delegate* delegate_; - - DISALLOW_COPY_AND_ASSIGN(PendingConnectionManager); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/pending_connection_manager_impl_unittest.cc b/chromeos/services/secure_channel/pending_connection_manager_impl_unittest.cc index 4942b1b3fbf74b..028808d7f6d223 100644 --- a/chromeos/services/secure_channel/pending_connection_manager_impl_unittest.cc +++ b/chromeos/services/secure_channel/pending_connection_manager_impl_unittest.cc @@ -44,6 +44,11 @@ class FakeBleInitiatorConnectionAttemptFactory FakeBleConnectionManager* expected_ble_connection_manager) : expected_ble_connection_manager_(expected_ble_connection_manager) {} + FakeBleInitiatorConnectionAttemptFactory( + const FakeBleInitiatorConnectionAttemptFactory&) = delete; + FakeBleInitiatorConnectionAttemptFactory& operator=( + const FakeBleInitiatorConnectionAttemptFactory&) = delete; + ~FakeBleInitiatorConnectionAttemptFactory() override = default; void set_expected_connection_attempt_details( @@ -110,8 +115,6 @@ class FakeBleInitiatorConnectionAttemptFactory size_t num_instances_deleted_ = 0u; FakeConnectionAttempt* last_created_instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeBleInitiatorConnectionAttemptFactory); }; class FakeBleListenerConnectionAttemptFactory @@ -121,6 +124,11 @@ class FakeBleListenerConnectionAttemptFactory FakeBleConnectionManager* expected_ble_connection_manager) : expected_ble_connection_manager_(expected_ble_connection_manager) {} + FakeBleListenerConnectionAttemptFactory( + const FakeBleListenerConnectionAttemptFactory&) = delete; + FakeBleListenerConnectionAttemptFactory& operator=( + const FakeBleListenerConnectionAttemptFactory&) = delete; + ~FakeBleListenerConnectionAttemptFactory() override = default; void set_expected_connection_attempt_details( @@ -187,8 +195,6 @@ class FakeBleListenerConnectionAttemptFactory size_t num_instances_deleted_ = 0u; FakeConnectionAttempt* last_created_instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeBleListenerConnectionAttemptFactory); }; class FakeNearbyInitiatorConnectionAttemptFactory @@ -199,6 +205,11 @@ class FakeNearbyInitiatorConnectionAttemptFactory : expected_nearby_connection_manager_( expected_nearby_connection_manager) {} + FakeNearbyInitiatorConnectionAttemptFactory( + const FakeNearbyInitiatorConnectionAttemptFactory&) = delete; + FakeNearbyInitiatorConnectionAttemptFactory& operator=( + const FakeNearbyInitiatorConnectionAttemptFactory&) = delete; + ~FakeNearbyInitiatorConnectionAttemptFactory() override = default; void set_expected_connection_attempt_details( @@ -265,14 +276,18 @@ class FakeNearbyInitiatorConnectionAttemptFactory size_t num_instances_deleted_ = 0u; FakeConnectionAttempt* last_created_instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeNearbyInitiatorConnectionAttemptFactory); }; class FakePendingBleInitiatorConnectionRequestFactory : public PendingBleInitiatorConnectionRequest::Factory { public: FakePendingBleInitiatorConnectionRequestFactory() = default; + + FakePendingBleInitiatorConnectionRequestFactory( + const FakePendingBleInitiatorConnectionRequestFactory&) = delete; + FakePendingBleInitiatorConnectionRequestFactory& operator=( + const FakePendingBleInitiatorConnectionRequestFactory&) = delete; + ~FakePendingBleInitiatorConnectionRequestFactory() override = default; void SetExpectationsForNextCall( @@ -312,14 +327,18 @@ class FakePendingBleInitiatorConnectionRequestFactory FakePendingConnectionRequest* last_created_instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakePendingBleInitiatorConnectionRequestFactory); }; class FakePendingBleListenerConnectionRequestFactory : public PendingBleListenerConnectionRequest::Factory { public: FakePendingBleListenerConnectionRequestFactory() = default; + + FakePendingBleListenerConnectionRequestFactory( + const FakePendingBleListenerConnectionRequestFactory&) = delete; + FakePendingBleListenerConnectionRequestFactory& operator=( + const FakePendingBleListenerConnectionRequestFactory&) = delete; + ~FakePendingBleListenerConnectionRequestFactory() override = default; void SetExpectationsForNextCall( @@ -359,14 +378,18 @@ class FakePendingBleListenerConnectionRequestFactory FakePendingConnectionRequest* last_created_instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakePendingBleListenerConnectionRequestFactory); }; class FakePendingNearbyInitiatorConnectionRequestFactory : public PendingNearbyInitiatorConnectionRequest::Factory { public: FakePendingNearbyInitiatorConnectionRequestFactory() = default; + + FakePendingNearbyInitiatorConnectionRequestFactory( + const FakePendingNearbyInitiatorConnectionRequestFactory&) = delete; + FakePendingNearbyInitiatorConnectionRequestFactory& operator=( + const FakePendingNearbyInitiatorConnectionRequestFactory&) = delete; + ~FakePendingNearbyInitiatorConnectionRequestFactory() override = default; void SetExpectationsForNextCall( @@ -406,8 +429,6 @@ class FakePendingNearbyInitiatorConnectionRequestFactory FakePendingConnectionRequest* last_created_instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakePendingNearbyInitiatorConnectionRequestFactory); }; std::vector> diff --git a/chromeos/services/secure_channel/pending_connection_request.h b/chromeos/services/secure_channel/pending_connection_request.h index 674b2509102746..cb8bb3286ef979 100644 --- a/chromeos/services/secure_channel/pending_connection_request.h +++ b/chromeos/services/secure_channel/pending_connection_request.h @@ -35,6 +35,9 @@ class PendingConnectionRequest { return request->ExtractClientConnectionParameters(); } + PendingConnectionRequest(const PendingConnectionRequest&) = delete; + PendingConnectionRequest& operator=(const PendingConnectionRequest&) = delete; + virtual ~PendingConnectionRequest() = default; ConnectionPriority connection_priority() const { @@ -66,8 +69,6 @@ class PendingConnectionRequest { private: PendingConnectionRequestDelegate* delegate_; ConnectionPriority connection_priority_; - - DISALLOW_COPY_AND_ASSIGN(PendingConnectionRequest); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/pending_connection_request_base.h b/chromeos/services/secure_channel/pending_connection_request_base.h index 4bc36ec02e936d..290b20dddbf523 100644 --- a/chromeos/services/secure_channel/pending_connection_request_base.h +++ b/chromeos/services/secure_channel/pending_connection_request_base.h @@ -35,6 +35,10 @@ class PendingConnectionRequestBase : public PendingConnectionRequest, public ClientConnectionParameters::Observer { public: + PendingConnectionRequestBase(const PendingConnectionRequestBase&) = delete; + PendingConnectionRequestBase& operator=(const PendingConnectionRequestBase&) = + delete; + ~PendingConnectionRequestBase() override { if (client_connection_parameters_) client_connection_parameters_->RemoveObserver(this); @@ -114,8 +118,6 @@ class PendingConnectionRequestBase bool has_finished_without_connection_ = false; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(PendingConnectionRequestBase); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/pending_connection_request_delegate.h b/chromeos/services/secure_channel/pending_connection_request_delegate.h index e69a7acbc2a98c..74c19dc6272223 100644 --- a/chromeos/services/secure_channel/pending_connection_request_delegate.h +++ b/chromeos/services/secure_channel/pending_connection_request_delegate.h @@ -27,6 +27,12 @@ class PendingConnectionRequestDelegate { }; PendingConnectionRequestDelegate(); + + PendingConnectionRequestDelegate(const PendingConnectionRequestDelegate&) = + delete; + PendingConnectionRequestDelegate& operator=( + const PendingConnectionRequestDelegate&) = delete; + virtual ~PendingConnectionRequestDelegate(); // Invoked when a PendingConnectionRequest fails to establish a connection. @@ -35,9 +41,6 @@ class PendingConnectionRequestDelegate { virtual void OnRequestFinishedWithoutConnection( const base::UnguessableToken& request_id, FailedConnectionReason reason) = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(PendingConnectionRequestDelegate); }; std::ostream& operator<<( diff --git a/chromeos/services/secure_channel/public/cpp/client/client_channel.h b/chromeos/services/secure_channel/public/cpp/client/client_channel.h index fe8d4d7d856eb8..a38caaddeff738 100644 --- a/chromeos/services/secure_channel/public/cpp/client/client_channel.h +++ b/chromeos/services/secure_channel/public/cpp/client/client_channel.h @@ -31,6 +31,9 @@ class ClientChannel { virtual void OnMessageReceived(const std::string& payload) = 0; }; + ClientChannel(const ClientChannel&) = delete; + ClientChannel& operator=(const ClientChannel&) = delete; + virtual ~ClientChannel(); bool GetConnectionMetadata( @@ -66,8 +69,6 @@ class ClientChannel { private: base::ObserverList::Unchecked observer_list_; bool is_disconnected_ = false; - - DISALLOW_COPY_AND_ASSIGN(ClientChannel); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/public/cpp/client/connection_attempt.h b/chromeos/services/secure_channel/public/cpp/client/connection_attempt.h index 27fdfba6f515a1..103ac39f582bff 100644 --- a/chromeos/services/secure_channel/public/cpp/client/connection_attempt.h +++ b/chromeos/services/secure_channel/public/cpp/client/connection_attempt.h @@ -33,6 +33,10 @@ class ConnectionAttempt { }; ConnectionAttempt(); + + ConnectionAttempt(const ConnectionAttempt&) = delete; + ConnectionAttempt& operator=(const ConnectionAttempt&) = delete; + virtual ~ConnectionAttempt(); void SetDelegate(Delegate* delegate); @@ -44,8 +48,6 @@ class ConnectionAttempt { private: Delegate* delegate_; - - DISALLOW_COPY_AND_ASSIGN(ConnectionAttempt); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/public/cpp/client/fake_client_channel.h b/chromeos/services/secure_channel/public/cpp/client/fake_client_channel.h index 5abf4d0c29c250..b03480be93c588 100644 --- a/chromeos/services/secure_channel/public/cpp/client/fake_client_channel.h +++ b/chromeos/services/secure_channel/public/cpp/client/fake_client_channel.h @@ -20,6 +20,10 @@ namespace secure_channel { class FakeClientChannel : public ClientChannel { public: FakeClientChannel(); + + FakeClientChannel(const FakeClientChannel&) = delete; + FakeClientChannel& operator=(const FakeClientChannel&) = delete; + ~FakeClientChannel() override; using ClientChannel::NotifyDisconnected; @@ -51,8 +55,6 @@ class FakeClientChannel : public ClientChannel { get_connection_metadata_callback_queue_; std::vector> sent_messages_; base::OnceClosure destructor_callback_; - - DISALLOW_COPY_AND_ASSIGN(FakeClientChannel); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/public/cpp/client/fake_client_channel_observer.h b/chromeos/services/secure_channel/public/cpp/client/fake_client_channel_observer.h index fe3c690c4f8af2..8ddbd5ec328af9 100644 --- a/chromeos/services/secure_channel/public/cpp/client/fake_client_channel_observer.h +++ b/chromeos/services/secure_channel/public/cpp/client/fake_client_channel_observer.h @@ -16,6 +16,11 @@ namespace secure_channel { class FakeClientChannelObserver : public ClientChannel::Observer { public: FakeClientChannelObserver(); + + FakeClientChannelObserver(const FakeClientChannelObserver&) = delete; + FakeClientChannelObserver& operator=(const FakeClientChannelObserver&) = + delete; + ~FakeClientChannelObserver() override; // ClientChannel::Observer: @@ -32,8 +37,6 @@ class FakeClientChannelObserver : public ClientChannel::Observer { private: bool is_disconnected_ = false; std::vector received_messages_; - - DISALLOW_COPY_AND_ASSIGN(FakeClientChannelObserver); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/public/cpp/client/fake_connection_attempt.h b/chromeos/services/secure_channel/public/cpp/client/fake_connection_attempt.h index 0423cbab839eb3..f2a837439a5be9 100644 --- a/chromeos/services/secure_channel/public/cpp/client/fake_connection_attempt.h +++ b/chromeos/services/secure_channel/public/cpp/client/fake_connection_attempt.h @@ -19,6 +19,10 @@ namespace secure_channel { class FakeConnectionAttempt : public ConnectionAttemptImpl { public: FakeConnectionAttempt(); + + FakeConnectionAttempt(const FakeConnectionAttempt&) = delete; + FakeConnectionAttempt& operator=(const FakeConnectionAttempt&) = delete; + ~FakeConnectionAttempt() override; using ConnectionAttempt::NotifyConnectionAttemptFailure; @@ -42,8 +46,6 @@ class FakeConnectionAttempt : public ConnectionAttemptImpl { private: base::OnceClosure on_connection_attempt_failure_callback_; base::OnceClosure on_connection_callback_; - - DISALLOW_COPY_AND_ASSIGN(FakeConnectionAttempt); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/public/cpp/client/fake_secure_channel_client.h b/chromeos/services/secure_channel/public/cpp/client/fake_secure_channel_client.h index 530fc25d8c4543..3b36693358597f 100644 --- a/chromeos/services/secure_channel/public/cpp/client/fake_secure_channel_client.h +++ b/chromeos/services/secure_channel/public/cpp/client/fake_secure_channel_client.h @@ -29,6 +29,11 @@ class FakeSecureChannelClient : public SecureChannelClient { const std::string& feature, ConnectionMedium connection_medium, ConnectionPriority connection_priority); + + ConnectionRequestArguments(const ConnectionRequestArguments&) = delete; + ConnectionRequestArguments& operator=(const ConnectionRequestArguments&) = + delete; + ~ConnectionRequestArguments(); multidevice::RemoteDeviceRef device_to_connect; @@ -36,12 +41,13 @@ class FakeSecureChannelClient : public SecureChannelClient { std::string feature; ConnectionMedium connection_medium; ConnectionPriority connection_priority; - - private: - DISALLOW_COPY_AND_ASSIGN(ConnectionRequestArguments); }; FakeSecureChannelClient(); + + FakeSecureChannelClient(const FakeSecureChannelClient&) = delete; + FakeSecureChannelClient& operator=(const FakeSecureChannelClient&) = delete; + ~FakeSecureChannelClient() override; void set_next_initiate_connection_attempt( @@ -149,8 +155,6 @@ class FakeSecureChannelClient : public SecureChannelClient { last_initiate_connection_request_arguments_list_; std::vector> last_listen_for_connection_request_arguments_list_; - - DISALLOW_COPY_AND_ASSIGN(FakeSecureChannelClient); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/public/cpp/client/secure_channel_client.h b/chromeos/services/secure_channel/public/cpp/client/secure_channel_client.h index 8d9da9072312cd..e92faf0ea27604 100644 --- a/chromeos/services/secure_channel/public/cpp/client/secure_channel_client.h +++ b/chromeos/services/secure_channel/public/cpp/client/secure_channel_client.h @@ -53,6 +53,9 @@ class NearbyConnector; // devices over BLE. In the future, more connection mediums will be offered. class SecureChannelClient { public: + SecureChannelClient(const SecureChannelClient&) = delete; + SecureChannelClient& operator=(const SecureChannelClient&) = delete; + virtual ~SecureChannelClient() = default; virtual std::unique_ptr InitiateConnectionToDevice( @@ -71,9 +74,6 @@ class SecureChannelClient { protected: SecureChannelClient() = default; - - private: - DISALLOW_COPY_AND_ASSIGN(SecureChannelClient); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/raw_eid_generator_impl.h b/chromeos/services/secure_channel/raw_eid_generator_impl.h index a6b06059013bf1..618a4caa8f8aa6 100644 --- a/chromeos/services/secure_channel/raw_eid_generator_impl.h +++ b/chromeos/services/secure_channel/raw_eid_generator_impl.h @@ -19,15 +19,16 @@ namespace secure_channel { class RawEidGeneratorImpl : public RawEidGenerator { public: RawEidGeneratorImpl(); + + RawEidGeneratorImpl(const RawEidGeneratorImpl&) = delete; + RawEidGeneratorImpl& operator=(const RawEidGeneratorImpl&) = delete; + ~RawEidGeneratorImpl() override; // RawEidGenerator: std::string GenerateEid(const std::string& eid_seed, int64_t start_of_period_timestamp_ms, std::string const* extra_entropy) override; - - private: - DISALLOW_COPY_AND_ASSIGN(RawEidGeneratorImpl); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/secure_channel_base.h b/chromeos/services/secure_channel/secure_channel_base.h index e9c7d365361fc9..dd92429b0605aa 100644 --- a/chromeos/services/secure_channel/secure_channel_base.h +++ b/chromeos/services/secure_channel/secure_channel_base.h @@ -17,6 +17,9 @@ namespace secure_channel { // Base SecureChannel implementation. class SecureChannelBase : public mojom::SecureChannel { public: + SecureChannelBase(const SecureChannelBase&) = delete; + SecureChannelBase& operator=(const SecureChannelBase&) = delete; + ~SecureChannelBase() override; // Binds a receiver to this implementation. Should be called each time that @@ -28,8 +31,6 @@ class SecureChannelBase : public mojom::SecureChannel { private: mojo::ReceiverSet receivers_; - - DISALLOW_COPY_AND_ASSIGN(SecureChannelBase); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/secure_channel_disconnector.h b/chromeos/services/secure_channel/secure_channel_disconnector.h index c188875b6fdbaf..86cc0d10991914 100644 --- a/chromeos/services/secure_channel/secure_channel_disconnector.h +++ b/chromeos/services/secure_channel/secure_channel_disconnector.h @@ -22,6 +22,10 @@ class SecureChannel; // https://crbug.com/763604. class SecureChannelDisconnector { public: + SecureChannelDisconnector(const SecureChannelDisconnector&) = delete; + SecureChannelDisconnector& operator=(const SecureChannelDisconnector&) = + delete; + virtual ~SecureChannelDisconnector() = default; virtual void DisconnectSecureChannel( @@ -29,9 +33,6 @@ class SecureChannelDisconnector { protected: SecureChannelDisconnector() = default; - - private: - DISALLOW_COPY_AND_ASSIGN(SecureChannelDisconnector); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/secure_channel_service_unittest.cc b/chromeos/services/secure_channel/secure_channel_service_unittest.cc index 7b818dafa4c9ad..74f1c5c4233316 100644 --- a/chromeos/services/secure_channel/secure_channel_service_unittest.cc +++ b/chromeos/services/secure_channel/secure_channel_service_unittest.cc @@ -58,6 +58,10 @@ const size_t kNumTestDevices = 6; class FakeTimerFactoryFactory : public TimerFactoryImpl::Factory { public: FakeTimerFactoryFactory() = default; + + FakeTimerFactoryFactory(const FakeTimerFactoryFactory&) = delete; + FakeTimerFactoryFactory& operator=(const FakeTimerFactoryFactory&) = delete; + ~FakeTimerFactoryFactory() override = default; FakeTimerFactory* instance() { return instance_; } @@ -72,14 +76,17 @@ class FakeTimerFactoryFactory : public TimerFactoryImpl::Factory { } FakeTimerFactory* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeTimerFactoryFactory); }; class TestRemoteDeviceCacheFactory : public multidevice::RemoteDeviceCache::Factory { public: TestRemoteDeviceCacheFactory() = default; + + TestRemoteDeviceCacheFactory(const TestRemoteDeviceCacheFactory&) = delete; + TestRemoteDeviceCacheFactory& operator=(const TestRemoteDeviceCacheFactory&) = + delete; + ~TestRemoteDeviceCacheFactory() override = default; multidevice::RemoteDeviceCache* instance() { return instance_; } @@ -98,8 +105,6 @@ class TestRemoteDeviceCacheFactory } multidevice::RemoteDeviceCache* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(TestRemoteDeviceCacheFactory); }; class FakeBluetoothHelperFactory : public BluetoothHelperImpl::Factory { @@ -108,6 +113,10 @@ class FakeBluetoothHelperFactory : public BluetoothHelperImpl::Factory { TestRemoteDeviceCacheFactory* test_remote_device_cache_factory) : test_remote_device_cache_factory_(test_remote_device_cache_factory) {} + FakeBluetoothHelperFactory(const FakeBluetoothHelperFactory&) = delete; + FakeBluetoothHelperFactory& operator=(const FakeBluetoothHelperFactory&) = + delete; + ~FakeBluetoothHelperFactory() override = default; FakeBluetoothHelper* instance() { return instance_; } @@ -128,13 +137,16 @@ class FakeBluetoothHelperFactory : public BluetoothHelperImpl::Factory { TestRemoteDeviceCacheFactory* test_remote_device_cache_factory_; FakeBluetoothHelper* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeBluetoothHelperFactory); }; class FakeBleSynchronizerFactory : public BleSynchronizer::Factory { public: FakeBleSynchronizerFactory() = default; + + FakeBleSynchronizerFactory(const FakeBleSynchronizerFactory&) = delete; + FakeBleSynchronizerFactory& operator=(const FakeBleSynchronizerFactory&) = + delete; + ~FakeBleSynchronizerFactory() override = default; FakeBleSynchronizer* instance() { return instance_; } @@ -151,8 +163,6 @@ class FakeBleSynchronizerFactory : public BleSynchronizer::Factory { } FakeBleSynchronizer* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeBleSynchronizerFactory); }; class FakeBleScannerFactory : public BleScannerImpl::Factory { @@ -163,6 +173,9 @@ class FakeBleScannerFactory : public BleScannerImpl::Factory { : fake_bluetooth_helper_factory_(fake_bluetooth_helper_factory), fake_ble_synchronizer_factory_(fake_ble_synchronizer_factory) {} + FakeBleScannerFactory(const FakeBleScannerFactory&) = delete; + FakeBleScannerFactory& operator=(const FakeBleScannerFactory&) = delete; + ~FakeBleScannerFactory() override = default; FakeBleScanner* instance() { return instance_; } @@ -187,14 +200,18 @@ class FakeBleScannerFactory : public BleScannerImpl::Factory { FakeBluetoothHelperFactory* fake_bluetooth_helper_factory_; FakeBleSynchronizerFactory* fake_ble_synchronizer_factory_; - - DISALLOW_COPY_AND_ASSIGN(FakeBleScannerFactory); }; class FakeSecureChannelDisconnectorFactory : public SecureChannelDisconnectorImpl::Factory { public: FakeSecureChannelDisconnectorFactory() = default; + + FakeSecureChannelDisconnectorFactory( + const FakeSecureChannelDisconnectorFactory&) = delete; + FakeSecureChannelDisconnectorFactory& operator=( + const FakeSecureChannelDisconnectorFactory&) = delete; + ~FakeSecureChannelDisconnectorFactory() override = default; FakeSecureChannelDisconnector* instance() { return instance_; } @@ -208,8 +225,6 @@ class FakeSecureChannelDisconnectorFactory } FakeSecureChannelDisconnector* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeSecureChannelDisconnectorFactory); }; class FakeBleConnectionManagerFactory @@ -231,6 +246,11 @@ class FakeBleConnectionManagerFactory fake_secure_channel_disconnector_factory), fake_timer_factory_factory_(fake_timer_factory_factory) {} + FakeBleConnectionManagerFactory(const FakeBleConnectionManagerFactory&) = + delete; + FakeBleConnectionManagerFactory& operator=( + const FakeBleConnectionManagerFactory&) = delete; + ~FakeBleConnectionManagerFactory() override = default; FakeBleConnectionManager* instance() { return instance_; } @@ -268,8 +288,6 @@ class FakeBleConnectionManagerFactory FakeTimerFactoryFactory* fake_timer_factory_factory_; FakeBleConnectionManager* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeBleConnectionManagerFactory); }; class FakeNearbyConnectionManagerFactory @@ -283,6 +301,11 @@ class FakeNearbyConnectionManagerFactory fake_secure_channel_disconnector_factory_( fake_secure_channel_disconnector_factory) {} + FakeNearbyConnectionManagerFactory( + const FakeNearbyConnectionManagerFactory&) = delete; + FakeNearbyConnectionManagerFactory& operator=( + const FakeNearbyConnectionManagerFactory&) = delete; + ~FakeNearbyConnectionManagerFactory() override = default; FakeNearbyConnectionManager* instance() { return instance_; } @@ -307,8 +330,6 @@ class FakeNearbyConnectionManagerFactory fake_secure_channel_disconnector_factory_; FakeNearbyConnectionManager* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeNearbyConnectionManagerFactory); }; class FakePendingConnectionManagerFactory @@ -323,6 +344,11 @@ class FakePendingConnectionManagerFactory fake_nearby_connection_manager_factory_( fake_nearby_connection_manager_factory) {} + FakePendingConnectionManagerFactory( + const FakePendingConnectionManagerFactory&) = delete; + FakePendingConnectionManagerFactory& operator=( + const FakePendingConnectionManagerFactory&) = delete; + ~FakePendingConnectionManagerFactory() override = default; FakePendingConnectionManager* instance() { return instance_; } @@ -349,14 +375,18 @@ class FakePendingConnectionManagerFactory FakeNearbyConnectionManagerFactory* fake_nearby_connection_manager_factory_; FakePendingConnectionManager* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakePendingConnectionManagerFactory); }; class FakeActiveConnectionManagerFactory : public ActiveConnectionManagerImpl::Factory { public: FakeActiveConnectionManagerFactory() = default; + + FakeActiveConnectionManagerFactory( + const FakeActiveConnectionManagerFactory&) = delete; + FakeActiveConnectionManagerFactory& operator=( + const FakeActiveConnectionManagerFactory&) = delete; + ~FakeActiveConnectionManagerFactory() override = default; FakeActiveConnectionManager* instance() { return instance_; } @@ -372,8 +402,6 @@ class FakeActiveConnectionManagerFactory } FakeActiveConnectionManager* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(FakeActiveConnectionManagerFactory); }; class TestSecureChannelInitializerFactory @@ -383,6 +411,11 @@ class TestSecureChannelInitializerFactory scoped_refptr test_task_runner) : test_task_runner_(test_task_runner) {} + TestSecureChannelInitializerFactory( + const TestSecureChannelInitializerFactory&) = delete; + TestSecureChannelInitializerFactory& operator=( + const TestSecureChannelInitializerFactory&) = delete; + ~TestSecureChannelInitializerFactory() override = default; private: @@ -403,14 +436,18 @@ class TestSecureChannelInitializerFactory scoped_refptr test_task_runner_; SecureChannelBase* instance_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(TestSecureChannelInitializerFactory); }; class FakeClientConnectionParametersFactory : public ClientConnectionParametersImpl::Factory { public: FakeClientConnectionParametersFactory() = default; + + FakeClientConnectionParametersFactory( + const FakeClientConnectionParametersFactory&) = delete; + FakeClientConnectionParametersFactory& operator=( + const FakeClientConnectionParametersFactory&) = delete; + ~FakeClientConnectionParametersFactory() override = default; const base::UnguessableToken& last_created_instance_id() { @@ -467,8 +504,6 @@ class FakeClientConnectionParametersFactory absl::optional, base::UnguessableTokenHash> id_to_failure_reason_when_deleted_map_; - - DISALLOW_COPY_AND_ASSIGN(FakeClientConnectionParametersFactory); }; } // namespace diff --git a/chromeos/services/secure_channel/shared_resource_scheduler.h b/chromeos/services/secure_channel/shared_resource_scheduler.h index b9bea84b6ee551..7b870913867723 100644 --- a/chromeos/services/secure_channel/shared_resource_scheduler.h +++ b/chromeos/services/secure_channel/shared_resource_scheduler.h @@ -27,6 +27,10 @@ namespace secure_channel { class SharedResourceScheduler { public: SharedResourceScheduler(); + + SharedResourceScheduler(const SharedResourceScheduler&) = delete; + SharedResourceScheduler& operator=(const SharedResourceScheduler&) = delete; + virtual ~SharedResourceScheduler(); // Schedules a request to use a shared resource. @@ -65,8 +69,6 @@ class SharedResourceScheduler { // Map from request to its priority. base::flat_map request_to_priority_map_; - - DISALLOW_COPY_AND_ASSIGN(SharedResourceScheduler); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/single_client_message_proxy.h b/chromeos/services/secure_channel/single_client_message_proxy.h index 92f37903b61f59..aba59c6c3e7f2f 100644 --- a/chromeos/services/secure_channel/single_client_message_proxy.h +++ b/chromeos/services/secure_channel/single_client_message_proxy.h @@ -33,6 +33,9 @@ class SingleClientMessageProxy { const base::UnguessableToken& proxy_id) = 0; }; + SingleClientMessageProxy(const SingleClientMessageProxy&) = delete; + SingleClientMessageProxy& operator=(const SingleClientMessageProxy&) = delete; + virtual ~SingleClientMessageProxy(); // Should be called when any message is received over the connection. @@ -58,8 +61,6 @@ class SingleClientMessageProxy { private: Delegate* delegate_; - - DISALLOW_COPY_AND_ASSIGN(SingleClientMessageProxy); }; } // namespace secure_channel diff --git a/chromeos/services/secure_channel/timer_factory.h b/chromeos/services/secure_channel/timer_factory.h index fc53a2348b3079..1142f5fa7c773f 100644 --- a/chromeos/services/secure_channel/timer_factory.h +++ b/chromeos/services/secure_channel/timer_factory.h @@ -21,13 +21,14 @@ namespace secure_channel { // for timers. class TimerFactory { public: + TimerFactory(const TimerFactory&) = delete; + TimerFactory& operator=(const TimerFactory&) = delete; + virtual ~TimerFactory() = default; virtual std::unique_ptr CreateOneShotTimer() = 0; protected: TimerFactory() = default; - - DISALLOW_COPY_AND_ASSIGN(TimerFactory); }; } // namespace secure_channel diff --git a/chromeos/settings/system_settings_provider.h b/chromeos/settings/system_settings_provider.h index 977f9d8051887d..d456f5c98cedfe 100644 --- a/chromeos/settings/system_settings_provider.h +++ b/chromeos/settings/system_settings_provider.h @@ -27,6 +27,10 @@ class COMPONENT_EXPORT(CHROMEOS_SETTINGS) SystemSettingsProvider public: SystemSettingsProvider(); explicit SystemSettingsProvider(const NotifyObserversCallback& notify_cb); + + SystemSettingsProvider(const SystemSettingsProvider&) = delete; + SystemSettingsProvider& operator=(const SystemSettingsProvider&) = delete; + ~SystemSettingsProvider() override; // CrosSettingsProvider implementation. @@ -44,8 +48,6 @@ class COMPONENT_EXPORT(CHROMEOS_SETTINGS) SystemSettingsProvider std::unique_ptr timezone_value_; std::unique_ptr per_user_timezone_enabled_value_; std::unique_ptr fine_grained_time_zone_enabled_value_; - - DISALLOW_COPY_AND_ASSIGN(SystemSettingsProvider); }; } // namespace chromeos diff --git a/chromeos/settings/timezone_settings.cc b/chromeos/settings/timezone_settings.cc index 5cba0631ce8653..f8fb4b8325a944 100644 --- a/chromeos/settings/timezone_settings.cc +++ b/chromeos/settings/timezone_settings.cc @@ -277,6 +277,9 @@ void SetTimezoneIDFromString(const std::string& id) { // Common code of the TimezoneSettings implementations. class TimezoneSettingsBaseImpl : public chromeos::system::TimezoneSettings { public: + TimezoneSettingsBaseImpl(const TimezoneSettingsBaseImpl&) = delete; + TimezoneSettingsBaseImpl& operator=(const TimezoneSettingsBaseImpl&) = delete; + ~TimezoneSettingsBaseImpl() override; // TimezoneSettings implementation: @@ -304,9 +307,6 @@ class TimezoneSettingsBaseImpl : public chromeos::system::TimezoneSettings { base::ObserverList::Unchecked observers_; std::vector> timezones_; std::unique_ptr timezone_; - - private: - DISALLOW_COPY_AND_ASSIGN(TimezoneSettingsBaseImpl); }; // The TimezoneSettings implementation used in production. diff --git a/chromeos/system/cpu_temperature_reader.h b/chromeos/system/cpu_temperature_reader.h index 9b06a798525b34..876637f3cc6a32 100644 --- a/chromeos/system/cpu_temperature_reader.h +++ b/chromeos/system/cpu_temperature_reader.h @@ -39,6 +39,10 @@ class COMPONENT_EXPORT(CHROMEOS_SYSTEM) CPUTemperatureReader { }; CPUTemperatureReader(); + + CPUTemperatureReader(const CPUTemperatureReader&) = delete; + CPUTemperatureReader& operator=(const CPUTemperatureReader&) = delete; + ~CPUTemperatureReader(); void set_hwmon_dir_for_test(const base::FilePath& dir) { hwmon_dir_ = dir; } @@ -51,8 +55,6 @@ class COMPONENT_EXPORT(CHROMEOS_SYSTEM) CPUTemperatureReader { private: // Sysfs hwmon directory path. base::FilePath hwmon_dir_; - - DISALLOW_COPY_AND_ASSIGN(CPUTemperatureReader); }; } // namespace system diff --git a/chromeos/system/fake_statistics_provider.h b/chromeos/system/fake_statistics_provider.h index 9df4881a16c0a9..99703a4e5545c5 100644 --- a/chromeos/system/fake_statistics_provider.h +++ b/chromeos/system/fake_statistics_provider.h @@ -21,6 +21,10 @@ class COMPONENT_EXPORT(CHROMEOS_SYSTEM) FakeStatisticsProvider : public StatisticsProvider { public: FakeStatisticsProvider(); + + FakeStatisticsProvider(const FakeStatisticsProvider&) = delete; + FakeStatisticsProvider& operator=(const FakeStatisticsProvider&) = delete; + ~FakeStatisticsProvider() override; // StatisticsProvider implementation: @@ -40,8 +44,6 @@ class COMPONENT_EXPORT(CHROMEOS_SYSTEM) FakeStatisticsProvider private: std::map machine_statistics_; std::map machine_flags_; - - DISALLOW_COPY_AND_ASSIGN(FakeStatisticsProvider); }; // A convenience subclass that automatically registers itself as the test @@ -50,10 +52,12 @@ class COMPONENT_EXPORT(CHROMEOS_SYSTEM) ScopedFakeStatisticsProvider : public FakeStatisticsProvider { public: ScopedFakeStatisticsProvider(); - ~ScopedFakeStatisticsProvider() override; - private: - DISALLOW_COPY_AND_ASSIGN(ScopedFakeStatisticsProvider); + ScopedFakeStatisticsProvider(const ScopedFakeStatisticsProvider&) = delete; + ScopedFakeStatisticsProvider& operator=(const ScopedFakeStatisticsProvider&) = + delete; + + ~ScopedFakeStatisticsProvider() override; }; } // namespace system diff --git a/chromeos/system/scheduler_configuration_manager_base.h b/chromeos/system/scheduler_configuration_manager_base.h index b89c499b32ea1c..c4b64d32a32ab6 100644 --- a/chromeos/system/scheduler_configuration_manager_base.h +++ b/chromeos/system/scheduler_configuration_manager_base.h @@ -27,6 +27,12 @@ class COMPONENT_EXPORT(CHROMEOS_SYSTEM) SchedulerConfigurationManagerBase { }; SchedulerConfigurationManagerBase(); + + SchedulerConfigurationManagerBase(const SchedulerConfigurationManagerBase&) = + delete; + SchedulerConfigurationManagerBase& operator=( + const SchedulerConfigurationManagerBase&) = delete; + virtual ~SchedulerConfigurationManagerBase(); // Gets the most recent reply from debugd for SetSchedulerConfiguration D-Bus @@ -39,9 +45,6 @@ class COMPONENT_EXPORT(CHROMEOS_SYSTEM) SchedulerConfigurationManagerBase { protected: base::ObserverList observer_list_; - - private: - DISALLOW_COPY_AND_ASSIGN(SchedulerConfigurationManagerBase); }; } // namespace chromeos diff --git a/chromeos/timezone/timezone_provider.h b/chromeos/timezone/timezone_provider.h index edc559e1441551..657ecb2f64e1f6 100644 --- a/chromeos/timezone/timezone_provider.h +++ b/chromeos/timezone/timezone_provider.h @@ -33,6 +33,10 @@ class COMPONENT_EXPORT(CHROMEOS_TIMEZONE) TimeZoneProvider { public: TimeZoneProvider(scoped_refptr factory, const GURL& url); + + TimeZoneProvider(const TimeZoneProvider&) = delete; + TimeZoneProvider& operator=(const TimeZoneProvider&) = delete; + virtual ~TimeZoneProvider(); // Initiates new request (See TimeZoneRequest for parameters description.) @@ -58,8 +62,6 @@ class COMPONENT_EXPORT(CHROMEOS_TIMEZONE) TimeZoneProvider { // Creation and destruction should happen on the same thread. base::ThreadChecker thread_checker_; - - DISALLOW_COPY_AND_ASSIGN(TimeZoneProvider); }; } // namespace chromeos diff --git a/chromeos/timezone/timezone_request.h b/chromeos/timezone/timezone_request.h index 7972f178924ba1..8ea77b23b37c02 100644 --- a/chromeos/timezone/timezone_request.h +++ b/chromeos/timezone/timezone_request.h @@ -75,6 +75,9 @@ class COMPONENT_EXPORT(CHROMEOS_TIMEZONE) TimeZoneRequest { const Geoposition& geoposition, base::TimeDelta retry_timeout); + TimeZoneRequest(const TimeZoneRequest&) = delete; + TimeZoneRequest& operator=(const TimeZoneRequest&) = delete; + ~TimeZoneRequest(); // Initiates request. @@ -128,8 +131,6 @@ class COMPONENT_EXPORT(CHROMEOS_TIMEZONE) TimeZoneRequest { // Creation and destruction should happen on the same thread. base::ThreadChecker thread_checker_; - - DISALLOW_COPY_AND_ASSIGN(TimeZoneRequest); }; } // namespace chromeos diff --git a/chromeos/timezone/timezone_resolver.cc b/chromeos/timezone/timezone_resolver.cc index 3ce3ddf8d4f3bf..5cf0a07682c3c3 100644 --- a/chromeos/timezone/timezone_resolver.cc +++ b/chromeos/timezone/timezone_resolver.cc @@ -88,6 +88,9 @@ class TimeZoneResolver::TimeZoneResolverImpl public: explicit TimeZoneResolverImpl(const TimeZoneResolver* resolver); + TimeZoneResolverImpl(const TimeZoneResolverImpl&) = delete; + TimeZoneResolverImpl& operator=(const TimeZoneResolverImpl&) = delete; + ~TimeZoneResolverImpl() override; // This is called once after the object is created. @@ -147,8 +150,6 @@ class TimeZoneResolver::TimeZoneResolverImpl base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(TimeZoneResolverImpl); }; namespace { @@ -159,6 +160,9 @@ class TZRequest { explicit TZRequest(TimeZoneResolver::TimeZoneResolverImpl* resolver) : resolver_(resolver) {} + TZRequest(const TZRequest&) = delete; + TZRequest& operator=(const TZRequest&) = delete; + ~TZRequest(); // Starts request after specified delay. @@ -182,8 +186,6 @@ class TZRequest { TimeZoneResolver::TimeZoneResolverImpl* const resolver_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(TZRequest); }; TZRequest::~TZRequest() = default; diff --git a/chromeos/timezone/timezone_resolver.h b/chromeos/timezone/timezone_resolver.h index abf4fc09cc159d..fae7693fe2db42 100644 --- a/chromeos/timezone/timezone_resolver.h +++ b/chromeos/timezone/timezone_resolver.h @@ -41,6 +41,10 @@ class COMPONENT_EXPORT(CHROMEOS_TIMEZONE) TimeZoneResolver { class Delegate { public: Delegate(); + + Delegate(const Delegate&) = delete; + Delegate& operator=(const Delegate&) = delete; + virtual ~Delegate(); // Returns true if TimeZoneResolver should include WiFi data in request. @@ -48,9 +52,6 @@ class COMPONENT_EXPORT(CHROMEOS_TIMEZONE) TimeZoneResolver { // Returns true if TimeZoneResolver should include Cellular data in request. virtual bool ShouldSendCellularGeolocationData() = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(Delegate); }; // This is a LocalState preference to store base::Time value of the last @@ -63,6 +64,10 @@ class COMPONENT_EXPORT(CHROMEOS_TIMEZONE) TimeZoneResolver { const ApplyTimeZoneCallback& apply_timezone, const DelayNetworkCallClosure& delay_network_call, PrefService* local_state); + + TimeZoneResolver(const TimeZoneResolver&) = delete; + TimeZoneResolver& operator=(const TimeZoneResolver&) = delete; + ~TimeZoneResolver(); // Starts periodic timezone refresh. @@ -109,8 +114,6 @@ class COMPONENT_EXPORT(CHROMEOS_TIMEZONE) TimeZoneResolver { std::unique_ptr implementation_; base::ThreadChecker thread_checker_; - - DISALLOW_COPY_AND_ASSIGN(TimeZoneResolver); }; } // namespace chromeos diff --git a/chromeos/tpm/install_attributes.h b/chromeos/tpm/install_attributes.h index 3c710b59dd2c41..559030b0d0d1d8 100644 --- a/chromeos/tpm/install_attributes.h +++ b/chromeos/tpm/install_attributes.h @@ -61,6 +61,10 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) InstallAttributes { explicit InstallAttributes( InstallAttributesClient* install_attributes_client); + + InstallAttributes(const InstallAttributes&) = delete; + InstallAttributes& operator=(const InstallAttributes&) = delete; + ~InstallAttributes(); // Tries to read install attributes from |cache_file| to work around slow @@ -231,8 +235,6 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) InstallAttributes { InstallAttributesClient* install_attributes_client_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(InstallAttributes); }; } // namespace chromeos diff --git a/chromeos/tpm/stub_install_attributes.h b/chromeos/tpm/stub_install_attributes.h index f3047a9d8b1791..c49dfe444f6e35 100644 --- a/chromeos/tpm/stub_install_attributes.h +++ b/chromeos/tpm/stub_install_attributes.h @@ -67,6 +67,10 @@ class ScopedStubInstallAttributes { explicit ScopedStubInstallAttributes( std::unique_ptr install_attributes); + ScopedStubInstallAttributes(const ScopedStubInstallAttributes&) = delete; + ScopedStubInstallAttributes& operator=(const ScopedStubInstallAttributes&) = + delete; + ~ScopedStubInstallAttributes(); // Get the StubInstallAttributes that have been installed for modification. @@ -76,8 +80,6 @@ class ScopedStubInstallAttributes { // The InstallAttributes that are currently installed and that this // ScopedStubInstallAttributes is responsible for shutting down. std::unique_ptr install_attributes_; - - DISALLOW_COPY_AND_ASSIGN(ScopedStubInstallAttributes); }; } // namespace chromeos diff --git a/chromeos/tpm/tpm_token_info_getter.h b/chromeos/tpm/tpm_token_info_getter.h index 8a8b3e98f3025a..34502f6b8fbddd 100644 --- a/chromeos/tpm/tpm_token_info_getter.h +++ b/chromeos/tpm/tpm_token_info_getter.h @@ -44,6 +44,9 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) TPMTokenInfoGetter { CryptohomePkcs11Client* cryptohome_pkcs11_client, const scoped_refptr& delayed_task_runner); + TPMTokenInfoGetter(const TPMTokenInfoGetter&) = delete; + TPMTokenInfoGetter& operator=(const TPMTokenInfoGetter&) = delete; + ~TPMTokenInfoGetter(); // Starts getting TPM token info. Should be called at most once. @@ -117,8 +120,6 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) TPMTokenInfoGetter { CryptohomePkcs11Client* cryptohome_pkcs11_client_; base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(TPMTokenInfoGetter); }; } // namespace chromeos diff --git a/chromeos/tpm/tpm_token_info_getter_unittest.cc b/chromeos/tpm/tpm_token_info_getter_unittest.cc index 305399a385fdcb..77def6f263d1ae 100644 --- a/chromeos/tpm/tpm_token_info_getter_unittest.cc +++ b/chromeos/tpm/tpm_token_info_getter_unittest.cc @@ -83,6 +83,10 @@ class TestCryptohomePkcs11Client : public chromeos::FakeCryptohomePkcs11Client { get_tpm_token_info_not_set_count_(0), get_tpm_token_info_succeeded_(false) {} + TestCryptohomePkcs11Client(const TestCryptohomePkcs11Client&) = delete; + TestCryptohomePkcs11Client& operator=(const TestCryptohomePkcs11Client&) = + delete; + ~TestCryptohomePkcs11Client() override = default; void set_get_tpm_token_info_failure_count(int value) { @@ -170,8 +174,6 @@ class TestCryptohomePkcs11Client : public chromeos::FakeCryptohomePkcs11Client { chromeos::DBusMethodCallback<::user_data_auth::Pkcs11GetTpmTokenInfoReply> pending_get_tpm_token_info_callback_; absl::optional tpm_token_info_; - - DISALLOW_COPY_AND_ASSIGN(TestCryptohomePkcs11Client); }; class SystemTPMTokenInfoGetterTest : public testing::Test { @@ -179,6 +181,11 @@ class SystemTPMTokenInfoGetterTest : public testing::Test { SystemTPMTokenInfoGetterTest() { chromeos::TpmManagerClient::Get()->InitializeFake(); } + + SystemTPMTokenInfoGetterTest(const SystemTPMTokenInfoGetterTest&) = delete; + SystemTPMTokenInfoGetterTest& operator=(const SystemTPMTokenInfoGetterTest&) = + delete; + ~SystemTPMTokenInfoGetterTest() override { chromeos::TpmManagerClient::Get()->Shutdown(); } @@ -199,8 +206,6 @@ class SystemTPMTokenInfoGetterTest : public testing::Test { private: base::test::SingleThreadTaskEnvironment task_environment_; - - DISALLOW_COPY_AND_ASSIGN(SystemTPMTokenInfoGetterTest); }; class UserTPMTokenInfoGetterTest : public testing::Test { @@ -209,6 +214,11 @@ class UserTPMTokenInfoGetterTest : public testing::Test { : account_id_(AccountId::FromUserEmail("user@gmail.com")) { chromeos::TpmManagerClient::Get()->InitializeFake(); } + + UserTPMTokenInfoGetterTest(const UserTPMTokenInfoGetterTest&) = delete; + UserTPMTokenInfoGetterTest& operator=(const UserTPMTokenInfoGetterTest&) = + delete; + ~UserTPMTokenInfoGetterTest() override { chromeos::TpmManagerClient::Get()->Shutdown(); } @@ -230,8 +240,6 @@ class UserTPMTokenInfoGetterTest : public testing::Test { private: base::test::SingleThreadTaskEnvironment task_environment_; - - DISALLOW_COPY_AND_ASSIGN(UserTPMTokenInfoGetterTest); }; TEST_F(SystemTPMTokenInfoGetterTest, BasicFlow) { diff --git a/chromeos/ui/frame/caption_buttons/frame_back_button.h b/chromeos/ui/frame/caption_buttons/frame_back_button.h index 97c279f7f6a632..8758fb511f83cf 100644 --- a/chromeos/ui/frame/caption_buttons/frame_back_button.h +++ b/chromeos/ui/frame/caption_buttons/frame_back_button.h @@ -16,12 +16,14 @@ class COMPONENT_EXPORT(CHROMEOS_UI_FRAME) FrameBackButton : public views::FrameCaptionButton { public: FrameBackButton(); + + FrameBackButton(const FrameBackButton&) = delete; + FrameBackButton& operator=(const FrameBackButton&) = delete; + ~FrameBackButton() override; private: void ButtonPressed(); - - DISALLOW_COPY_AND_ASSIGN(FrameBackButton); }; } // namespace chromeos diff --git a/chromeos/ui/frame/caption_buttons/frame_size_button.cc b/chromeos/ui/frame/caption_buttons/frame_size_button.cc index d6406866b7bb69..c14b2dc2901826 100644 --- a/chromeos/ui/frame/caption_buttons/frame_size_button.cc +++ b/chromeos/ui/frame/caption_buttons/frame_size_button.cc @@ -78,6 +78,10 @@ class FrameSizeButton::SnappingWindowObserver : public aura::WindowObserver { : window_(window), size_button_(size_button) { window_->AddObserver(this); } + + SnappingWindowObserver(const SnappingWindowObserver&) = delete; + SnappingWindowObserver& operator=(const SnappingWindowObserver&) = delete; + ~SnappingWindowObserver() override { if (window_) { window_->RemoveObserver(this); @@ -109,8 +113,6 @@ class FrameSizeButton::SnappingWindowObserver : public aura::WindowObserver { private: aura::Window* window_; FrameSizeButton* size_button_; - - DISALLOW_COPY_AND_ASSIGN(SnappingWindowObserver); }; FrameSizeButton::FrameSizeButton(PressedCallback callback, diff --git a/chromeos/ui/frame/caption_buttons/frame_size_button.h b/chromeos/ui/frame/caption_buttons/frame_size_button.h index 6b76277298b8ba..d0b9803297cb61 100644 --- a/chromeos/ui/frame/caption_buttons/frame_size_button.h +++ b/chromeos/ui/frame/caption_buttons/frame_size_button.h @@ -29,6 +29,9 @@ class COMPONENT_EXPORT(CHROMEOS_UI_FRAME) FrameSizeButton public: FrameSizeButton(PressedCallback callback, FrameSizeButtonDelegate* delegate); + FrameSizeButton(const FrameSizeButton&) = delete; + FrameSizeButton& operator=(const FrameSizeButton&) = delete; + ~FrameSizeButton() override; // views::Button overrides: @@ -99,8 +102,6 @@ class COMPONENT_EXPORT(CHROMEOS_UI_FRAME) FrameSizeButton // Whether the buttons adjacent to the size button snap the window left and // right. bool in_snap_mode_; - - DISALLOW_COPY_AND_ASSIGN(FrameSizeButton); }; } // namespace chromeos diff --git a/chromeos/ui/frame/default_frame_header.h b/chromeos/ui/frame/default_frame_header.h index 5dddff55b55acb..e9f2479e7d827a 100644 --- a/chromeos/ui/frame/default_frame_header.h +++ b/chromeos/ui/frame/default_frame_header.h @@ -28,6 +28,10 @@ class COMPONENT_EXPORT(CHROMEOS_UI_FRAME) DefaultFrameHeader views::Widget* target_widget, views::View* header_view, chromeos::FrameCaptionButtonContainerView* caption_button_container); + + DefaultFrameHeader(const DefaultFrameHeader&) = delete; + DefaultFrameHeader& operator=(const DefaultFrameHeader&) = delete; + ~DefaultFrameHeader() override; SkColor active_frame_color_for_testing() { return active_frame_color_; } @@ -57,8 +61,6 @@ class COMPONENT_EXPORT(CHROMEOS_UI_FRAME) DefaultFrameHeader SkColor inactive_frame_color_ = chromeos::kDefaultFrameColor; int width_in_pixels_ = -1; - - DISALLOW_COPY_AND_ASSIGN(DefaultFrameHeader); }; } // namespace chromeos diff --git a/chromeos/ui/frame/immersive/immersive_focus_watcher.cc b/chromeos/ui/frame/immersive/immersive_focus_watcher.cc index 21a74946ebf08d..a3bf3841f37677 100644 --- a/chromeos/ui/frame/immersive/immersive_focus_watcher.cc +++ b/chromeos/ui/frame/immersive/immersive_focus_watcher.cc @@ -67,6 +67,10 @@ bool IsWindowTransientChildOf(aura::Window* maybe_transient, class ImmersiveFocusWatcher::BubbleObserver : public aura::WindowObserver { public: explicit BubbleObserver(ImmersiveFullscreenController* controller); + + BubbleObserver(const BubbleObserver&) = delete; + BubbleObserver& operator=(const BubbleObserver&) = delete; + ~BubbleObserver() override; // Start / stop observing changes to |bubble|'s visibility. @@ -88,8 +92,6 @@ class ImmersiveFocusWatcher::BubbleObserver : public aura::WindowObserver { // Lock which keeps the top-of-window views revealed based on whether any of // |bubbles_| is visible. std::unique_ptr revealed_lock_; - - DISALLOW_COPY_AND_ASSIGN(BubbleObserver); }; ImmersiveFocusWatcher::BubbleObserver::BubbleObserver( diff --git a/chromeos/ui/frame/immersive/immersive_focus_watcher.h b/chromeos/ui/frame/immersive/immersive_focus_watcher.h index c4b0f11da7fb17..9330b94d397469 100644 --- a/chromeos/ui/frame/immersive/immersive_focus_watcher.h +++ b/chromeos/ui/frame/immersive/immersive_focus_watcher.h @@ -24,6 +24,10 @@ class ImmersiveFocusWatcher public ::wm::ActivationChangeObserver { public: explicit ImmersiveFocusWatcher(ImmersiveFullscreenController* controller); + + ImmersiveFocusWatcher(const ImmersiveFocusWatcher&) = delete; + ImmersiveFocusWatcher& operator=(const ImmersiveFocusWatcher&) = delete; + ~ImmersiveFocusWatcher() override; // Forces updating the status of the lock. That is, this determines whether @@ -72,8 +76,6 @@ class ImmersiveFocusWatcher // Manages bubbles which are anchored to a child of // |ImmersiveFullscreenController::top_container_|. std::unique_ptr bubble_observer_; - - DISALLOW_COPY_AND_ASSIGN(ImmersiveFocusWatcher); }; } // namespace chromeos diff --git a/chromeos/ui/frame/immersive/immersive_fullscreen_controller.cc b/chromeos/ui/frame/immersive/immersive_fullscreen_controller.cc index f99732cb99077f..8bbcc2d6207a99 100644 --- a/chromeos/ui/frame/immersive/immersive_fullscreen_controller.cc +++ b/chromeos/ui/frame/immersive/immersive_fullscreen_controller.cc @@ -45,14 +45,15 @@ namespace { class ImmersiveWindowTargeter : public aura::WindowTargeter { public: ImmersiveWindowTargeter() = default; + + ImmersiveWindowTargeter(const ImmersiveWindowTargeter&) = delete; + ImmersiveWindowTargeter& operator=(const ImmersiveWindowTargeter&) = delete; + ~ImmersiveWindowTargeter() override = default; bool ShouldUseExtendedBounds(const aura::Window* target) const override { return target->parent() == window(); } - - private: - DISALLOW_COPY_AND_ASSIGN(ImmersiveWindowTargeter); }; // The delay in milliseconds between the mouse stopping at the top edge of the diff --git a/chromeos/ui/frame/immersive/immersive_fullscreen_controller.h b/chromeos/ui/frame/immersive/immersive_fullscreen_controller.h index 10ff1726fc9213..671d9c39eab3c4 100644 --- a/chromeos/ui/frame/immersive/immersive_fullscreen_controller.h +++ b/chromeos/ui/frame/immersive/immersive_fullscreen_controller.h @@ -72,6 +72,11 @@ class COMPONENT_EXPORT(CHROMEOS_UI_FRAME) ImmersiveFullscreenController static const int kMouseRevealBoundsHeight; ImmersiveFullscreenController(); + + ImmersiveFullscreenController(const ImmersiveFullscreenController&) = delete; + ImmersiveFullscreenController& operator=( + const ImmersiveFullscreenController&) = delete; + ~ImmersiveFullscreenController() override; // Initializes the controller. Must be called prior to enabling immersive @@ -301,8 +306,6 @@ class COMPONENT_EXPORT(CHROMEOS_UI_FRAME) ImmersiveFullscreenController static bool value_for_animations_disabled_for_test_; base::WeakPtrFactory weak_ptr_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ImmersiveFullscreenController); }; } // namespace chromeos diff --git a/chromeos/ui/frame/immersive/immersive_fullscreen_controller_test_api.h b/chromeos/ui/frame/immersive/immersive_fullscreen_controller_test_api.h index 18fa4ba2ad3a8c..3735628d8f257f 100644 --- a/chromeos/ui/frame/immersive/immersive_fullscreen_controller_test_api.h +++ b/chromeos/ui/frame/immersive/immersive_fullscreen_controller_test_api.h @@ -17,6 +17,12 @@ class COMPONENT_EXPORT(CHROMEOS_UI_FRAME) ImmersiveFullscreenControllerTestApi { public: explicit ImmersiveFullscreenControllerTestApi( ImmersiveFullscreenController* controller); + + ImmersiveFullscreenControllerTestApi( + const ImmersiveFullscreenControllerTestApi&) = delete; + ImmersiveFullscreenControllerTestApi& operator=( + const ImmersiveFullscreenControllerTestApi&) = delete; + ~ImmersiveFullscreenControllerTestApi(); // Disables animations for any ImmersiveFullscreenControllers created while @@ -24,10 +30,11 @@ class COMPONENT_EXPORT(CHROMEOS_UI_FRAME) ImmersiveFullscreenControllerTestApi { class COMPONENT_EXPORT(CHROMEOS_UI_FRAME) GlobalAnimationDisabler { public: GlobalAnimationDisabler(); - ~GlobalAnimationDisabler(); - private: - DISALLOW_COPY_AND_ASSIGN(GlobalAnimationDisabler); + GlobalAnimationDisabler(const GlobalAnimationDisabler&) = delete; + GlobalAnimationDisabler& operator=(const GlobalAnimationDisabler&) = delete; + + ~GlobalAnimationDisabler(); }; // Disables animations and moves the mouse so that it is not over the @@ -38,8 +45,6 @@ class COMPONENT_EXPORT(CHROMEOS_UI_FRAME) ImmersiveFullscreenControllerTestApi { private: ImmersiveFullscreenController* immersive_fullscreen_controller_; - - DISALLOW_COPY_AND_ASSIGN(ImmersiveFullscreenControllerTestApi); }; } // namespace chromeos