From 7c0127bf12446719c321bb5035d4b656db9ce4ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Bostr=C3=B6m?= Date: Tue, 5 Oct 2021 18:39:56 +0000 Subject: [PATCH] Remove DISALLOW_* macros from remoting/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This inlines all remaining DISALLOW_* macros in remoting/. This is done manually (vim regex + manually finding insertion position). IWYU cleanup is left as a separate pass that is easier when these macros go away. Bug: 1010217 Change-Id: I8d7970f7775beb02c28876002a06a7f0d35d7f5a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3205668 Commit-Queue: Peter Boström Commit-Queue: Lei Zhang Auto-Submit: Peter Boström Reviewed-by: Joe Downing Reviewed-by: Lei Zhang Cr-Commit-Position: refs/heads/main@{#928261} --- remoting/base/auto_thread_task_runner.h | 5 +++-- remoting/base/rsa_key_pair.h | 5 +++-- remoting/base/scoped_sc_handle_win.h | 7 ++++--- remoting/base/service_urls.h | 5 +++-- remoting/base/url_request_context_getter.h | 5 +++-- remoting/client/chromoting_client_runtime.h | 5 +++-- .../client/display/gl_cursor_feedback_texture.h | 5 +++-- remoting/client/display/gl_renderer_unittest.cc | 10 ++++++---- remoting/client/in_memory_log_handler.h | 7 ++++--- .../client/input/touch_input_scaler_unittest.cc | 6 ++++-- remoting/client/jni/jni_runtime_delegate.h | 5 +++-- remoting/codec/codec_test.cc | 5 +++-- remoting/codec/video_encoder_helper.h | 5 +++-- remoting/host/chromeos/clipboard_aura_unittest.cc | 7 ++++--- remoting/host/chromeos/mouse_cursor_monitor_aura.h | 5 +++-- remoting/host/client_session.h | 6 ++++-- remoting/host/config_file_watcher.cc | 4 ++-- remoting/host/curtain_mode_linux.cc | 5 +++-- remoting/host/curtain_mode_mac.cc | 5 +++-- remoting/host/curtain_mode_win.cc | 6 +++--- remoting/host/desktop_session_agent.cc | 5 +++-- remoting/host/desktop_session_agent.h | 5 +++-- remoting/host/desktop_session_proxy.cc | 10 ++++++---- remoting/host/desktop_session_proxy.h | 5 +++-- remoting/host/desktop_session_win.h | 5 +++-- remoting/host/heartbeat_sender.h | 6 ++++-- remoting/host/host_config_unittest.cc | 7 ++++--- remoting/host/host_window_proxy.cc | 5 +++-- remoting/host/input_injector_mac.cc | 5 +++-- remoting/host/input_injector_win.cc | 5 +++-- remoting/host/input_injector_x11.cc | 5 +++-- .../input_monitor/local_hotkey_input_monitor_mac.mm | 5 +++-- .../input_monitor/local_hotkey_input_monitor_x11.cc | 5 +++-- .../host/input_monitor/local_input_monitor_win.cc | 5 +++-- .../input_monitor/local_mouse_input_monitor_mac.mm | 5 +++-- .../input_monitor/local_mouse_input_monitor_x11.cc | 5 +++-- remoting/host/it2me/it2me_host.h | 5 +++-- .../it2me/it2me_native_messaging_host_unittest.cc | 5 +++-- remoting/host/linux/audio_pipe_reader.h | 5 +++-- remoting/host/linux/audio_pipe_reader_unittest.cc | 5 +++-- remoting/host/policy_watcher_unittest.cc | 6 +++--- remoting/host/remoting_me2me_host.cc | 5 +++-- .../security_key_auth_handler_posix_unittest.cc | 8 +++++--- remoting/host/setup/daemon_controller.h | 5 +++-- remoting/host/setup/service_client.h | 5 ++++- remoting/host/shutdown_watchdog.h | 5 +++-- remoting/host/token_validator_factory_impl.cc | 5 +++-- remoting/host/token_validator_factory_impl.h | 6 ++++-- remoting/host/win/host_service.h | 5 +++-- remoting/host/win/rdp_client.cc | 5 +++-- remoting/host/win/rdp_client_window.cc | 5 +++-- remoting/host/win/session_input_injector.cc | 5 +++-- remoting/host/win/wts_session_process_delegate.cc | 5 +++-- remoting/ios/app/notification_presenter.h | 5 +++-- remoting/protocol/audio_pump_unittest.cc | 6 +++--- remoting/protocol/connection_unittest.cc | 6 +++--- remoting/protocol/datagram_channel_factory.h | 6 +++--- remoting/protocol/fake_desktop_capturer.cc | 5 +++-- remoting/protocol/host_stub.h | 6 +++--- remoting/protocol/pairing_registry.h | 5 +++-- remoting/protocol/pseudotcp_adapter.cc | 5 +++-- remoting/protocol/stream_channel_factory.h | 6 +++--- remoting/protocol/transport_context.h | 5 +++-- remoting/protocol/video_feedback_stub.h | 6 +++--- remoting/protocol/video_stats_stub.h | 6 +++--- remoting/protocol/video_stub.h | 6 +++--- remoting/protocol/webrtc_transport.cc | 13 +++++++++---- remoting/test/cyclic_frame_generator.h | 5 +++-- remoting/test/fake_connection_event_logger.cc | 7 ++++--- remoting/test/fake_network_dispatcher.h | 5 +++-- remoting/test/scroll_frame_generator.h | 5 +++-- 71 files changed, 236 insertions(+), 163 deletions(-) diff --git a/remoting/base/auto_thread_task_runner.h b/remoting/base/auto_thread_task_runner.h index e9e992520be5aa..9bf313caebe606 100644 --- a/remoting/base/auto_thread_task_runner.h +++ b/remoting/base/auto_thread_task_runner.h @@ -22,6 +22,9 @@ class AutoThreadTaskRunner : public base::SingleThreadTaskRunner { AutoThreadTaskRunner(scoped_refptr task_runner, base::OnceClosure stop_task); + AutoThreadTaskRunner(const AutoThreadTaskRunner&) = delete; + AutoThreadTaskRunner& operator=(const AutoThreadTaskRunner&) = delete; + // SingleThreadTaskRunner implementation bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, @@ -43,8 +46,6 @@ class AutoThreadTaskRunner : public base::SingleThreadTaskRunner { // The wrapped task runner. scoped_refptr task_runner_; - - DISALLOW_COPY_AND_ASSIGN(AutoThreadTaskRunner); }; } // namespace remoting diff --git a/remoting/base/rsa_key_pair.h b/remoting/base/rsa_key_pair.h index a4190b35647f95..960414702920c3 100644 --- a/remoting/base/rsa_key_pair.h +++ b/remoting/base/rsa_key_pair.h @@ -25,6 +25,9 @@ class RsaKeyPair : public base::RefCountedThreadSafe { // Loads a private key from a base64-encoded string. Returns true on success. static scoped_refptr FromString(const std::string& key_base64); + RsaKeyPair(const RsaKeyPair&) = delete; + RsaKeyPair& operator=(const RsaKeyPair&) = delete; + // Returns a base64 encoded string representing the private key. std::string ToString() const; @@ -47,8 +50,6 @@ class RsaKeyPair : public base::RefCountedThreadSafe { virtual ~RsaKeyPair(); std::unique_ptr key_; - - DISALLOW_COPY_AND_ASSIGN(RsaKeyPair); }; } // namespace remoting diff --git a/remoting/base/scoped_sc_handle_win.h b/remoting/base/scoped_sc_handle_win.h index c15d4772563862..007637a66147cc 100644 --- a/remoting/base/scoped_sc_handle_win.h +++ b/remoting/base/scoped_sc_handle_win.h @@ -16,6 +16,10 @@ class ScHandleTraits { public: typedef SC_HANDLE Handle; + ScHandleTraits() = delete; + ScHandleTraits(const ScHandleTraits&) = delete; + ScHandleTraits& operator=(const ScHandleTraits&) = delete; + // Closes the handle. static bool CloseHandle(SC_HANDLE handle) { return ::CloseServiceHandle(handle) != FALSE; @@ -30,9 +34,6 @@ class ScHandleTraits { static SC_HANDLE NullHandle() { return NULL; } - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(ScHandleTraits); }; typedef base::win::GenericScopedHandle< diff --git a/remoting/base/service_urls.h b/remoting/base/service_urls.h index 3914bad2ee57f9..8380ea0b9eff5c 100644 --- a/remoting/base/service_urls.h +++ b/remoting/base/service_urls.h @@ -20,6 +20,9 @@ class ServiceUrls { public: static ServiceUrls* GetInstance(); + ServiceUrls(const ServiceUrls&) = delete; + ServiceUrls& operator=(const ServiceUrls&) = delete; + const std::string& ftl_server_endpoint() const { return ftl_server_endpoint_; } @@ -39,8 +42,6 @@ class ServiceUrls { std::string ice_config_url_; std::string ftl_server_endpoint_; std::string remoting_server_endpoint_; - - DISALLOW_COPY_AND_ASSIGN(ServiceUrls); }; } // namespace remoting diff --git a/remoting/base/url_request_context_getter.h b/remoting/base/url_request_context_getter.h index c72dadf3158be7..2677c18d48449e 100644 --- a/remoting/base/url_request_context_getter.h +++ b/remoting/base/url_request_context_getter.h @@ -26,6 +26,9 @@ class URLRequestContextGetter : public net::URLRequestContextGetter { explicit URLRequestContextGetter( scoped_refptr network_task_runner); + URLRequestContextGetter(const URLRequestContextGetter&) = delete; + URLRequestContextGetter& operator=(const URLRequestContextGetter&) = delete; + // Overridden from net::URLRequestContextGetter: net::URLRequestContext* GetURLRequestContext() override; scoped_refptr GetNetworkTaskRunner() @@ -39,8 +42,6 @@ class URLRequestContextGetter : public net::URLRequestContextGetter { std::unique_ptr proxy_config_service_; std::unique_ptr url_request_context_; scoped_refptr cert_net_fetcher_; - - DISALLOW_COPY_AND_ASSIGN(URLRequestContextGetter); }; } // namespace remoting diff --git a/remoting/client/chromoting_client_runtime.h b/remoting/client/chromoting_client_runtime.h index d3e5c21b695a1a..8aefcf290633ac 100644 --- a/remoting/client/chromoting_client_runtime.h +++ b/remoting/client/chromoting_client_runtime.h @@ -55,6 +55,9 @@ class ChromotingClientRuntime { static ChromotingClientRuntime* GetInstance(); + ChromotingClientRuntime(const ChromotingClientRuntime&) = delete; + ChromotingClientRuntime& operator=(const ChromotingClientRuntime&) = delete; + // Must be called before calling any other methods on this object. void Init(ChromotingClientRuntime::Delegate* delegate); @@ -122,8 +125,6 @@ class ChromotingClientRuntime { ChromotingClientRuntime::Delegate* delegate_ = nullptr; friend struct base::DefaultSingletonTraits; - - DISALLOW_COPY_AND_ASSIGN(ChromotingClientRuntime); }; } // namespace remoting diff --git a/remoting/client/display/gl_cursor_feedback_texture.h b/remoting/client/display/gl_cursor_feedback_texture.h index c73dc035552f13..da7580d51d4bfb 100644 --- a/remoting/client/display/gl_cursor_feedback_texture.h +++ b/remoting/client/display/gl_cursor_feedback_texture.h @@ -20,6 +20,9 @@ class GlCursorFeedbackTexture { static GlCursorFeedbackTexture* GetInstance(); + GlCursorFeedbackTexture(const GlCursorFeedbackTexture&) = delete; + GlCursorFeedbackTexture& operator=(const GlCursorFeedbackTexture&) = delete; + const std::vector& GetTexture() const; private: @@ -29,8 +32,6 @@ class GlCursorFeedbackTexture { friend struct base::DefaultSingletonTraits; std::vector texture_; - - DISALLOW_COPY_AND_ASSIGN(GlCursorFeedbackTexture); }; } // namespace remoting diff --git a/remoting/client/display/gl_renderer_unittest.cc b/remoting/client/display/gl_renderer_unittest.cc index 85d41aeb624517..9a4543e1a21f0e 100644 --- a/remoting/client/display/gl_renderer_unittest.cc +++ b/remoting/client/display/gl_renderer_unittest.cc @@ -22,6 +22,9 @@ class FakeGlRendererDelegate : public GlRendererDelegate { public: FakeGlRendererDelegate() {} + FakeGlRendererDelegate(const FakeGlRendererDelegate&) = delete; + FakeGlRendererDelegate& operator=(const FakeGlRendererDelegate&) = delete; + bool CanRenderFrame() override { can_render_frame_call_count_++; return can_render_frame_; @@ -70,14 +73,15 @@ class FakeGlRendererDelegate : public GlRendererDelegate { base::RepeatingClosure on_frame_rendered_callback_; base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FakeGlRendererDelegate); }; class FakeDrawable : public Drawable { public: FakeDrawable() {} + FakeDrawable(const FakeDrawable&) = delete; + FakeDrawable& operator=(const FakeDrawable&) = delete; + void SetId(int id) { id_ = id; } int GetId() { return id_; } @@ -104,8 +108,6 @@ class FakeDrawable : public Drawable { int z_index_ = -1; base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(FakeDrawable); }; class GlRendererTest : public testing::Test { diff --git a/remoting/client/in_memory_log_handler.h b/remoting/client/in_memory_log_handler.h index 3567027f74811d..0375a6cc2521e3 100644 --- a/remoting/client/in_memory_log_handler.h +++ b/remoting/client/in_memory_log_handler.h @@ -14,6 +14,10 @@ namespace remoting { // Class for capturing logs in memory before printing out. class InMemoryLogHandler { public: + InMemoryLogHandler() = delete; + InMemoryLogHandler(const InMemoryLogHandler&) = delete; + InMemoryLogHandler& operator=(const InMemoryLogHandler&) = delete; + // Registers the log handler. This is not thread safe and should be called // exactly once in the main function. static void Register(); @@ -21,9 +25,6 @@ class InMemoryLogHandler { // Returns most recently captured logs (#lines <= kMaxNumberOfLogs) since the // app is launched. This must be called after Register() is called. static std::string GetInMemoryLogs(); - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(InMemoryLogHandler); }; } // namespace remoting diff --git a/remoting/client/input/touch_input_scaler_unittest.cc b/remoting/client/input/touch_input_scaler_unittest.cc index c3116c405d676a..87a210a6e5a580 100644 --- a/remoting/client/input/touch_input_scaler_unittest.cc +++ b/remoting/client/input/touch_input_scaler_unittest.cc @@ -50,6 +50,10 @@ const PointInfo kDefaultPointInfo = {kDefaultXCoord, kDefaultYCoord, } // namespace class TouchInputScalerTest : public ::testing::Test { + public: + TouchInputScalerTest(const TouchInputScalerTest&) = delete; + TouchInputScalerTest& operator=(const TouchInputScalerTest&) = delete; + protected: TouchInputScalerTest() : touch_input_scaler_(&mock_stub_) {} @@ -89,8 +93,6 @@ class TouchInputScalerTest : public ::testing::Test { private: std::vector point_infos_; - - DISALLOW_COPY_AND_ASSIGN(TouchInputScalerTest); }; // TouchInputFilter require both input and output dimensions. diff --git a/remoting/client/jni/jni_runtime_delegate.h b/remoting/client/jni/jni_runtime_delegate.h index 0516dd437b3633..ba9fc0d0e6273f 100644 --- a/remoting/client/jni/jni_runtime_delegate.h +++ b/remoting/client/jni/jni_runtime_delegate.h @@ -38,6 +38,9 @@ class JniRuntimeDelegate : public ChromotingClientRuntime::Delegate { // we close. Its components are reused across |JniRuntimeDelegate|s. static JniRuntimeDelegate* GetInstance(); + JniRuntimeDelegate(const JniRuntimeDelegate&) = delete; + JniRuntimeDelegate& operator=(const JniRuntimeDelegate&) = delete; + // remoting::ChromotingClientRuntime::Delegate overrides. void RuntimeWillShutdown() override; void RuntimeDidShutdown() override; @@ -60,8 +63,6 @@ class JniRuntimeDelegate : public ChromotingClientRuntime::Delegate { std::unique_ptr token_getter_; friend struct base::DefaultSingletonTraits; - - DISALLOW_COPY_AND_ASSIGN(JniRuntimeDelegate); }; } // namespace remoting diff --git a/remoting/codec/codec_test.cc b/remoting/codec/codec_test.cc index 00d6a3201c330d..d60ba82956de72 100644 --- a/remoting/codec/codec_test.cc +++ b/remoting/codec/codec_test.cc @@ -65,6 +65,9 @@ class VideoDecoderTester { frame_(new BasicDesktopFrame(screen_size)), expected_frame_(nullptr) {} + VideoDecoderTester(const VideoDecoderTester&) = delete; + VideoDecoderTester& operator=(const VideoDecoderTester&) = delete; + void Reset() { frame_ = std::make_unique(frame_->size()); expected_region_.Clear(); @@ -167,8 +170,6 @@ class VideoDecoderTester { VideoDecoder* decoder_; std::unique_ptr frame_; DesktopFrame* expected_frame_; - - DISALLOW_COPY_AND_ASSIGN(VideoDecoderTester); }; // The VideoEncoderTester provides a hook for retrieving the data, and passing diff --git a/remoting/codec/video_encoder_helper.h b/remoting/codec/video_encoder_helper.h index 5e7f50402eaf87..f991336f52ba52 100644 --- a/remoting/codec/video_encoder_helper.h +++ b/remoting/codec/video_encoder_helper.h @@ -23,6 +23,9 @@ class VideoEncoderHelper { public: VideoEncoderHelper(); + VideoEncoderHelper(const VideoEncoderHelper&) = delete; + VideoEncoderHelper& operator=(const VideoEncoderHelper&) = delete; + // Returns a new VideoPacket with common fields (e.g. capture_time_ms, rects // list, frame shape if any) initialized based on the supplied |frame|. // Screen width and height will be set iff |frame|'s size differs from that @@ -41,8 +44,6 @@ class VideoEncoderHelper { private: // The most recent screen size. Used to detect screen size changes. webrtc::DesktopSize screen_size_; - - DISALLOW_COPY_AND_ASSIGN(VideoEncoderHelper); }; } // namespace remoting diff --git a/remoting/host/chromeos/clipboard_aura_unittest.cc b/remoting/host/chromeos/clipboard_aura_unittest.cc index 55f68e9752abcd..4fb9d966652ac1 100644 --- a/remoting/host/chromeos/clipboard_aura_unittest.cc +++ b/remoting/host/chromeos/clipboard_aura_unittest.cc @@ -37,11 +37,12 @@ const base::TimeDelta kTestOverridePollingInterval = base::Milliseconds(1); class ClientClipboard : public protocol::ClipboardStub { public: ClientClipboard(); + + ClientClipboard(const ClientClipboard&) = delete; + ClientClipboard& operator=(const ClientClipboard&) = delete; + MOCK_METHOD1(InjectClipboardEvent, void(const protocol::ClipboardEvent& event)); - - private: - DISALLOW_COPY_AND_ASSIGN(ClientClipboard); }; ClientClipboard::ClientClipboard() = default; diff --git a/remoting/host/chromeos/mouse_cursor_monitor_aura.h b/remoting/host/chromeos/mouse_cursor_monitor_aura.h index 32466ffda13e95..56515a5532a134 100644 --- a/remoting/host/chromeos/mouse_cursor_monitor_aura.h +++ b/remoting/host/chromeos/mouse_cursor_monitor_aura.h @@ -18,6 +18,9 @@ class MouseCursorMonitorAura : public webrtc::MouseCursorMonitor { public: MouseCursorMonitorAura(); + MouseCursorMonitorAura(const MouseCursorMonitorAura&) = delete; + MouseCursorMonitorAura& operator=(const MouseCursorMonitorAura&) = delete; + // webrtc::MouseCursorMonitor implementation. void Init(Callback* callback, Mode mode) override; void Capture() override; @@ -29,8 +32,6 @@ class MouseCursorMonitorAura : public webrtc::MouseCursorMonitor { Mode mode_; ui::Cursor last_cursor_; gfx::Point last_mouse_location_; - - DISALLOW_COPY_AND_ASSIGN(MouseCursorMonitorAura); }; } // namespace remoting diff --git a/remoting/host/client_session.h b/remoting/host/client_session.h index d3a5c999c20c83..d8b9f6ac4f4eba 100644 --- a/remoting/host/client_session.h +++ b/remoting/host/client_session.h @@ -110,6 +110,10 @@ class ClientSession : public protocol::HostStub, const base::TimeDelta& max_duration, scoped_refptr pairing_registry, const std::vector& extensions); + + ClientSession(const ClientSession&) = delete; + ClientSession& operator=(const ClientSession&) = delete; + ~ClientSession() override; // Returns the set of capabilities negotiated between client and host. @@ -361,8 +365,6 @@ class ClientSession : public protocol::HostStub, // Used to disable callbacks to |this| once DisconnectSession() has been // called. base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ClientSession); }; } // namespace remoting diff --git a/remoting/host/config_file_watcher.cc b/remoting/host/config_file_watcher.cc index 517aacfe1695ff..438db72ffb2244 100644 --- a/remoting/host/config_file_watcher.cc +++ b/remoting/host/config_file_watcher.cc @@ -43,6 +43,8 @@ class ConfigFileWatcherImpl scoped_refptr io_task_runner, const base::FilePath& config_path); + ConfigFileWatcherImpl(const ConfigFileWatcherImpl&) = delete; + ConfigFileWatcherImpl& operator=(const ConfigFileWatcherImpl&) = delete; // Notify |delegate| of config changes. void Watch(ConfigWatcher::Delegate* delegate); @@ -85,8 +87,6 @@ class ConfigFileWatcherImpl scoped_refptr io_task_runner_; base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(ConfigFileWatcherImpl); }; ConfigFileWatcher::ConfigFileWatcher( diff --git a/remoting/host/curtain_mode_linux.cc b/remoting/host/curtain_mode_linux.cc index cf815a51683712..12d14f3890b231 100644 --- a/remoting/host/curtain_mode_linux.cc +++ b/remoting/host/curtain_mode_linux.cc @@ -21,14 +21,15 @@ class CurtainModeLinux : public CurtainMode { public: CurtainModeLinux(); + CurtainModeLinux(const CurtainModeLinux&) = delete; + CurtainModeLinux& operator=(const CurtainModeLinux&) = delete; + // Overriden from CurtainMode. bool Activate() override; private: // Returns true if the host is running under a virtual session. bool IsVirtualSession(); - - DISALLOW_COPY_AND_ASSIGN(CurtainModeLinux); }; CurtainModeLinux::CurtainModeLinux() = default; diff --git a/remoting/host/curtain_mode_mac.cc b/remoting/host/curtain_mode_mac.cc index aec946175567dc..0400ab28df5e21 100644 --- a/remoting/host/curtain_mode_mac.cc +++ b/remoting/host/curtain_mode_mac.cc @@ -80,6 +80,9 @@ class SessionWatcher : public base::RefCountedThreadSafe { scoped_refptr ui_task_runner, base::WeakPtr client_session_control); + SessionWatcher(const SessionWatcher&) = delete; + SessionWatcher& operator=(const SessionWatcher&) = delete; + void Start(); void Stop(); @@ -115,8 +118,6 @@ class SessionWatcher : public base::RefCountedThreadSafe { base::WeakPtr client_session_control_; EventHandlerRef event_handler_; - - DISALLOW_COPY_AND_ASSIGN(SessionWatcher); }; SessionWatcher::SessionWatcher( diff --git a/remoting/host/curtain_mode_win.cc b/remoting/host/curtain_mode_win.cc index 564fb0c3aa4b74..bd42f9e8039315 100644 --- a/remoting/host/curtain_mode_win.cc +++ b/remoting/host/curtain_mode_win.cc @@ -18,11 +18,11 @@ class CurtainModeWin : public CurtainMode { public: CurtainModeWin(); + CurtainModeWin(const CurtainModeWin&) = delete; + CurtainModeWin& operator=(const CurtainModeWin&) = delete; + // Overriden from CurtainMode. bool Activate() override; - - private: - DISALLOW_COPY_AND_ASSIGN(CurtainModeWin); }; CurtainModeWin::CurtainModeWin() { diff --git a/remoting/host/desktop_session_agent.cc b/remoting/host/desktop_session_agent.cc index 8ce2bcb4ef2c14..8c2f4750af259d 100644 --- a/remoting/host/desktop_session_agent.cc +++ b/remoting/host/desktop_session_agent.cc @@ -184,6 +184,9 @@ class SharedMemoryFactoryImpl : public webrtc::SharedMemoryFactory { const SendMessageCallback& send_message_callback) : send_message_callback_(send_message_callback) {} + SharedMemoryFactoryImpl(const SharedMemoryFactoryImpl&) = delete; + SharedMemoryFactoryImpl& operator=(const SharedMemoryFactoryImpl&) = delete; + std::unique_ptr CreateSharedMemory( size_t size) override { base::OnceClosure release_buffer_callback = base::BindOnce( @@ -214,8 +217,6 @@ class SharedMemoryFactoryImpl : public webrtc::SharedMemoryFactory { private: int next_shared_buffer_id_ = 1; SendMessageCallback send_message_callback_; - - DISALLOW_COPY_AND_ASSIGN(SharedMemoryFactoryImpl); }; } // namespace diff --git a/remoting/host/desktop_session_agent.h b/remoting/host/desktop_session_agent.h index 6b93e4acadc814..ec9a1e61f570b3 100644 --- a/remoting/host/desktop_session_agent.h +++ b/remoting/host/desktop_session_agent.h @@ -104,6 +104,9 @@ class DesktopSessionAgent scoped_refptr input_task_runner, scoped_refptr io_task_runner); + DesktopSessionAgent(const DesktopSessionAgent&) = delete; + DesktopSessionAgent& operator=(const DesktopSessionAgent&) = delete; + // IPC::Listener implementation. bool OnMessageReceived(const IPC::Message& message) override; void OnChannelConnected(int32_t peer_pid) override; @@ -286,8 +289,6 @@ class DesktopSessionAgent // Used to disable callbacks to |this|. base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(DesktopSessionAgent); }; } // namespace remoting diff --git a/remoting/host/desktop_session_proxy.cc b/remoting/host/desktop_session_proxy.cc index d303e7d5fdf528..7580bf96bda8e7 100644 --- a/remoting/host/desktop_session_proxy.cc +++ b/remoting/host/desktop_session_proxy.cc @@ -66,6 +66,9 @@ class DesktopSessionProxy::IpcSharedBufferCore // After being mapped, |region| is no longer needed and can be discarded. } + IpcSharedBufferCore(const IpcSharedBufferCore&) = delete; + IpcSharedBufferCore& operator=(const IpcSharedBufferCore&) = delete; + int id() const { return id_; } size_t size() const { return mapping_.size(); } const void* memory() const { return mapping_.memory(); } @@ -76,8 +79,6 @@ class DesktopSessionProxy::IpcSharedBufferCore int id_; base::ReadOnlySharedMemoryMapping mapping_; - - DISALLOW_COPY_AND_ASSIGN(IpcSharedBufferCore); }; class DesktopSessionProxy::IpcSharedBuffer : public webrtc::SharedMemory { @@ -91,10 +92,11 @@ class DesktopSessionProxy::IpcSharedBuffer : public webrtc::SharedMemory { core->id()), core_(core) {} + IpcSharedBuffer(const IpcSharedBuffer&) = delete; + IpcSharedBuffer& operator=(const IpcSharedBuffer&) = delete; + private: scoped_refptr core_; - - DISALLOW_COPY_AND_ASSIGN(IpcSharedBuffer); }; DesktopSessionProxy::DesktopSessionProxy( diff --git a/remoting/host/desktop_session_proxy.h b/remoting/host/desktop_session_proxy.h index 849bc6b506f799..7e9bff4b9a3887 100644 --- a/remoting/host/desktop_session_proxy.h +++ b/remoting/host/desktop_session_proxy.h @@ -93,6 +93,9 @@ class DesktopSessionProxy base::WeakPtr desktop_session_connector, const DesktopEnvironmentOptions& options); + DesktopSessionProxy(const DesktopSessionProxy&) = delete; + DesktopSessionProxy& operator=(const DesktopSessionProxy&) = delete; + // Mirrors DesktopEnvironment. std::unique_ptr CreateActionExecutor(); std::unique_ptr CreateAudioCapturer(); @@ -304,8 +307,6 @@ class DesktopSessionProxy set_up_url_forwarder_callback_; mojom::UrlForwarderState current_url_forwarder_state_ = mojom::UrlForwarderState::kUnknown; - - DISALLOW_COPY_AND_ASSIGN(DesktopSessionProxy); }; // Destroys |DesktopSessionProxy| instances on the caller's thread. diff --git a/remoting/host/desktop_session_win.h b/remoting/host/desktop_session_win.h index bb667c57ffbc90..2f8834d76ec767 100644 --- a/remoting/host/desktop_session_win.h +++ b/remoting/host/desktop_session_win.h @@ -60,6 +60,9 @@ class DesktopSessionWin : public DesktopSession, int id, const ScreenResolution& resolution); + DesktopSessionWin(const DesktopSessionWin&) = delete; + DesktopSessionWin& operator=(const DesktopSessionWin&) = delete; + protected: // Passes the owning |daemon_process|, a unique identifier of the desktop // session |id| and the interface for monitoring session attach/detach events. @@ -146,8 +149,6 @@ class DesktopSessionWin : public DesktopSession, // The id of the current desktop session being remoted or UINT32_MAX if no // session exists. int session_id_ = UINT32_MAX; - - DISALLOW_COPY_AND_ASSIGN(DesktopSessionWin); }; } // namespace remoting diff --git a/remoting/host/heartbeat_sender.h b/remoting/host/heartbeat_sender.h index 15063144fedca1..246a1b7207e274 100644 --- a/remoting/host/heartbeat_sender.h +++ b/remoting/host/heartbeat_sender.h @@ -88,6 +88,10 @@ class HeartbeatSender final : public SignalStrategy::Listener { Observer* observer, scoped_refptr url_loader_factory, bool is_googler); + + HeartbeatSender(const HeartbeatSender&) = delete; + HeartbeatSender& operator=(const HeartbeatSender&) = delete; + ~HeartbeatSender() override; // Sets host offline reason for future heartbeat, and initiates sending a @@ -158,8 +162,6 @@ class HeartbeatSender final : public SignalStrategy::Listener { base::OneShotTimer host_offline_reason_timeout_timer_; SEQUENCE_CHECKER(sequence_checker_); - - DISALLOW_COPY_AND_ASSIGN(HeartbeatSender); }; } // namespace remoting diff --git a/remoting/host/host_config_unittest.cc b/remoting/host/host_config_unittest.cc index 3a8c741898f8ca..8bfa0f6ee8b0f0 100644 --- a/remoting/host/host_config_unittest.cc +++ b/remoting/host/host_config_unittest.cc @@ -27,6 +27,10 @@ const char* kTestConfig = } // namespace class HostConfigTest : public testing::Test { + public: + HostConfigTest(const HostConfigTest&) = delete; + HostConfigTest& operator=(const HostConfigTest&) = delete; + protected: HostConfigTest() = default; @@ -36,9 +40,6 @@ class HostConfigTest : public testing::Test { // The temporary directory used to contain the test operations. base::ScopedTempDir test_dir_; - - private: - DISALLOW_COPY_AND_ASSIGN(HostConfigTest); }; TEST_F(HostConfigTest, InvalidFile) { diff --git a/remoting/host/host_window_proxy.cc b/remoting/host/host_window_proxy.cc index 7d912ae1e35d57..4cfb49f9176d94 100644 --- a/remoting/host/host_window_proxy.cc +++ b/remoting/host/host_window_proxy.cc @@ -28,6 +28,9 @@ class HostWindowProxy::Core scoped_refptr ui_task_runner, std::unique_ptr host_window); + Core(const Core&) = delete; + Core& operator=(const Core&) = delete; + // Starts |host_window_| on the |ui_task_runner_| thread. void Start(const base::WeakPtr& client_session_control); @@ -70,8 +73,6 @@ class HostWindowProxy::Core // Used to create the control pointer passed to |host_window_|. base::WeakPtrFactory weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(Core); }; HostWindowProxy::HostWindowProxy( diff --git a/remoting/host/input_injector_mac.cc b/remoting/host/input_injector_mac.cc index d521e9b54c19e4..90da1bcbd30c03 100644 --- a/remoting/host/input_injector_mac.cc +++ b/remoting/host/input_injector_mac.cc @@ -139,6 +139,9 @@ class InputInjectorMac : public InputInjector { scoped_refptr input_thread_task_runner, scoped_refptr ui_thread_task_runner); + Core(const Core&) = delete; + Core& operator=(const Core&) = delete; + // Mirrors the ClipboardStub interface. void InjectClipboardEvent(const ClipboardEvent& event); @@ -166,8 +169,6 @@ class InputInjectorMac : public InputInjector { uint64_t left_modifiers_; uint64_t right_modifiers_; base::TimeTicks last_time_display_woken_; - - DISALLOW_COPY_AND_ASSIGN(Core); }; scoped_refptr core_; diff --git a/remoting/host/input_injector_win.cc b/remoting/host/input_injector_win.cc index f9044863db8286..a2bc4aae9f9db5 100644 --- a/remoting/host/input_injector_win.cc +++ b/remoting/host/input_injector_win.cc @@ -220,6 +220,9 @@ class InputInjectorWin : public InputInjector { Core(scoped_refptr main_task_runner, scoped_refptr ui_task_runner); + Core(const Core&) = delete; + Core& operator=(const Core&) = delete; + // Mirrors the ClipboardStub interface. void InjectClipboardEvent(const ClipboardEvent& event); @@ -247,8 +250,6 @@ class InputInjectorWin : public InputInjector { scoped_refptr ui_task_runner_; std::unique_ptr clipboard_; std::unique_ptr touch_injector_; - - DISALLOW_COPY_AND_ASSIGN(Core); }; scoped_refptr core_; diff --git a/remoting/host/input_injector_x11.cc b/remoting/host/input_injector_x11.cc index a60f5f12cc3f77..6f1c2b99460df8 100644 --- a/remoting/host/input_injector_x11.cc +++ b/remoting/host/input_injector_x11.cc @@ -113,6 +113,9 @@ class InputInjectorX11 : public InputInjector { public: explicit Core(scoped_refptr task_runner); + Core(const Core&) = delete; + Core& operator=(const Core&) = delete; + void Init(); // Mirrors the ClipboardStub interface. @@ -188,8 +191,6 @@ class InputInjectorX11 : public InputInjector { std::unique_ptr character_injector_; bool saved_auto_repeat_enabled_ = false; - - DISALLOW_COPY_AND_ASSIGN(Core); }; scoped_refptr core_; diff --git a/remoting/host/input_monitor/local_hotkey_input_monitor_mac.mm b/remoting/host/input_monitor/local_hotkey_input_monitor_mac.mm index c095ed6fc253df..f5df499092242e 100644 --- a/remoting/host/input_monitor/local_hotkey_input_monitor_mac.mm +++ b/remoting/host/input_monitor/local_hotkey_input_monitor_mac.mm @@ -131,6 +131,9 @@ - (void)invalidate { scoped_refptr ui_task_runner, base::OnceClosure disconnect_callback); + Core(const Core&) = delete; + Core& operator=(const Core&) = delete; + void Start(); void Stop(); @@ -155,8 +158,6 @@ - (void)invalidate { // Invoked in the |caller_task_runner_| thread to report session disconnect // requests. base::OnceClosure disconnect_callback_; - - DISALLOW_COPY_AND_ASSIGN(Core); }; LocalHotkeyInputMonitorMac::LocalHotkeyInputMonitorMac( diff --git a/remoting/host/input_monitor/local_hotkey_input_monitor_x11.cc b/remoting/host/input_monitor/local_hotkey_input_monitor_x11.cc index c41e11d8bd2355..fe39cb122dce63 100644 --- a/remoting/host/input_monitor/local_hotkey_input_monitor_x11.cc +++ b/remoting/host/input_monitor/local_hotkey_input_monitor_x11.cc @@ -50,6 +50,9 @@ class LocalHotkeyInputMonitorX11 : public LocalHotkeyInputMonitor { scoped_refptr input_task_runner, base::OnceClosure disconnect_callback); + Core(const Core&) = delete; + Core& operator=(const Core&) = delete; + void Start(); void Stop(); @@ -79,8 +82,6 @@ class LocalHotkeyInputMonitorX11 : public LocalHotkeyInputMonitor { bool ctrl_pressed_ = false; x11::Connection* connection_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(Core); }; scoped_refptr core_; diff --git a/remoting/host/input_monitor/local_input_monitor_win.cc b/remoting/host/input_monitor/local_input_monitor_win.cc index 719ac6dd4ac59b..fe1cf3768fe4bc 100644 --- a/remoting/host/input_monitor/local_input_monitor_win.cc +++ b/remoting/host/input_monitor/local_input_monitor_win.cc @@ -41,6 +41,9 @@ class LocalInputMonitorWinImpl : public LocalInputMonitorWin { scoped_refptr ui_task_runner, std::unique_ptr raw_input_handler); + Core(const Core&) = delete; + Core& operator=(const Core&) = delete; + void Start(); void Stop(); @@ -70,8 +73,6 @@ class LocalInputMonitorWinImpl : public LocalInputMonitorWin { std::unique_ptr window_; std::unique_ptr raw_input_handler_; - - DISALLOW_COPY_AND_ASSIGN(Core); }; scoped_refptr core_; diff --git a/remoting/host/input_monitor/local_mouse_input_monitor_mac.mm b/remoting/host/input_monitor/local_mouse_input_monitor_mac.mm index bf883228d6f006..f2f6101d1b0456 100644 --- a/remoting/host/input_monitor/local_mouse_input_monitor_mac.mm +++ b/remoting/host/input_monitor/local_mouse_input_monitor_mac.mm @@ -139,6 +139,9 @@ - (void)invalidate { scoped_refptr ui_task_runner, LocalInputMonitor::PointerMoveCallback on_mouse_move); + Core(const Core&) = delete; + Core& operator=(const Core&) = delete; + void Start(); void Stop(); @@ -164,8 +167,6 @@ - (void)invalidate { LocalInputMonitor::PointerMoveCallback on_mouse_move_; webrtc::DesktopVector mouse_position_; - - DISALLOW_COPY_AND_ASSIGN(Core); }; LocalMouseInputMonitorMac::LocalMouseInputMonitorMac( diff --git a/remoting/host/input_monitor/local_mouse_input_monitor_x11.cc b/remoting/host/input_monitor/local_mouse_input_monitor_x11.cc index 663b824ce6b325..2d489f51ad3d77 100644 --- a/remoting/host/input_monitor/local_mouse_input_monitor_x11.cc +++ b/remoting/host/input_monitor/local_mouse_input_monitor_x11.cc @@ -53,6 +53,9 @@ class LocalMouseInputMonitorX11 : public LocalPointerInputMonitor { scoped_refptr input_task_runner, LocalInputMonitor::PointerMoveCallback on_mouse_move); + Core(const Core&) = delete; + Core& operator=(const Core&) = delete; + void Start(); void Stop(); @@ -79,8 +82,6 @@ class LocalMouseInputMonitorX11 : public LocalPointerInputMonitor { LocalInputMonitor::PointerMoveCallback on_mouse_move_; x11::Connection* connection_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(Core); }; scoped_refptr core_; diff --git a/remoting/host/it2me/it2me_host.h b/remoting/host/it2me/it2me_host.h index 3c5067bcae1f1c..6a8b2c509f985d 100644 --- a/remoting/host/it2me/it2me_host.h +++ b/remoting/host/it2me/it2me_host.h @@ -83,6 +83,9 @@ class It2MeHost : public base::RefCountedThreadSafe, It2MeHost(); + It2MeHost(const It2MeHost&) = delete; + It2MeHost& operator=(const It2MeHost&) = delete; + // Enable, disable, or query whether or not the confirm, continue, and // disconnect dialogs are shown. void set_enable_dialogs(bool enable); @@ -220,8 +223,6 @@ class It2MeHost : public base::RefCountedThreadSafe, bool enable_dialogs_ = true; bool enable_notifications_ = true; bool terminate_upon_input_ = false; - - DISALLOW_COPY_AND_ASSIGN(It2MeHost); }; // Having a factory interface makes it possible for the test to provide a mock diff --git a/remoting/host/it2me/it2me_native_messaging_host_unittest.cc b/remoting/host/it2me/it2me_native_messaging_host_unittest.cc index d8b9c8ee1e0587..2d11d6a5528f76 100644 --- a/remoting/host/it2me/it2me_native_messaging_host_unittest.cc +++ b/remoting/host/it2me/it2me_native_messaging_host_unittest.cc @@ -115,6 +115,9 @@ class MockIt2MeHost : public It2MeHost { public: MockIt2MeHost() = default; + MockIt2MeHost(const MockIt2MeHost&) = delete; + MockIt2MeHost& operator=(const MockIt2MeHost&) = delete; + // It2MeHost overrides void Connect(std::unique_ptr context, std::unique_ptr policies, @@ -132,8 +135,6 @@ class MockIt2MeHost : public It2MeHost { CreateDeferredConnectContext create_connection_context); void RunSetState(It2MeHostState state); - - DISALLOW_COPY_AND_ASSIGN(MockIt2MeHost); }; void MockIt2MeHost::Connect( diff --git a/remoting/host/linux/audio_pipe_reader.h b/remoting/host/linux/audio_pipe_reader.h index 114e7f4364b695..af41d86ba52efb 100644 --- a/remoting/host/linux/audio_pipe_reader.h +++ b/remoting/host/linux/audio_pipe_reader.h @@ -51,6 +51,9 @@ class AudioPipeReader scoped_refptr task_runner, const base::FilePath& pipe_path); + AudioPipeReader(const AudioPipeReader&) = delete; + AudioPipeReader& operator=(const AudioPipeReader&) = delete; + // Register or unregister an observer. Each observer receives data on the // thread on which it was registered and guaranteed not to be called after // RemoveObserver(). @@ -103,8 +106,6 @@ class AudioPipeReader std::unique_ptr pipe_watch_controller_; - - DISALLOW_COPY_AND_ASSIGN(AudioPipeReader); }; // Destroys |audio_pipe_reader| on the audio thread. diff --git a/remoting/host/linux/audio_pipe_reader_unittest.cc b/remoting/host/linux/audio_pipe_reader_unittest.cc index f93bde22318991..9f282bf226de6e 100644 --- a/remoting/host/linux/audio_pipe_reader_unittest.cc +++ b/remoting/host/linux/audio_pipe_reader_unittest.cc @@ -29,6 +29,9 @@ class AudioPipeReaderTest : public testing::Test, : stop_at_position_(-1) { } + AudioPipeReaderTest(const AudioPipeReaderTest&) = delete; + AudioPipeReaderTest& operator=(const AudioPipeReaderTest&) = delete; + void SetUp() override { ASSERT_TRUE(test_dir_.CreateUniqueTempDir()); pipe_path_ = test_dir_.GetPath().AppendASCII("test_pipe"); @@ -86,8 +89,6 @@ class AudioPipeReaderTest : public testing::Test, std::string read_data_; int stop_at_position_; - - DISALLOW_COPY_AND_ASSIGN(AudioPipeReaderTest); }; // Verify that the reader can detect when the pipe is created and destroyed. diff --git a/remoting/host/policy_watcher_unittest.cc b/remoting/host/policy_watcher_unittest.cc index 659afaa1bb34f6..aca56a5ccc75b7 100644 --- a/remoting/host/policy_watcher_unittest.cc +++ b/remoting/host/policy_watcher_unittest.cc @@ -47,6 +47,9 @@ class MockPolicyCallback { public: MockPolicyCallback() = default; + MockPolicyCallback(const MockPolicyCallback&) = delete; + MockPolicyCallback& operator=(const MockPolicyCallback&) = delete; + // TODO(lukasza): gmock cannot mock a method taking std::unique_ptr... MOCK_METHOD1(OnPolicyUpdatePtr, void(const base::DictionaryValue* policies)); void OnPolicyUpdate(std::unique_ptr policies) { @@ -54,9 +57,6 @@ class MockPolicyCallback { } MOCK_METHOD0(OnPolicyError, void()); - - private: - DISALLOW_COPY_AND_ASSIGN(MockPolicyCallback); }; class PolicyWatcherTest : public testing::Test { diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc index c6e0f0cc6628ec..23ebaee0da65de 100644 --- a/remoting/host/remoting_me2me_host.cc +++ b/remoting/host/remoting_me2me_host.cc @@ -218,6 +218,9 @@ class HostProcess : public ConfigWatcher::Delegate, int* exit_code_out, ShutdownWatchdog* shutdown_watchdog); + HostProcess(const HostProcess&) = delete; + HostProcess& operator=(const HostProcess&) = delete; + // ConfigWatcher::Delegate interface. void OnConfigUpdated(const std::string& serialized_config) override; void OnConfigWatcherError() override; @@ -458,8 +461,6 @@ class HostProcess : public ConfigWatcher::Delegate, bool checking_permission_state_ = false; bool permission_granted_ = false; #endif // defined(OS_APPLE) - - DISALLOW_COPY_AND_ASSIGN(HostProcess); }; HostProcess::HostProcess(std::unique_ptr context, diff --git a/remoting/host/security_key/security_key_auth_handler_posix_unittest.cc b/remoting/host/security_key/security_key_auth_handler_posix_unittest.cc index 5cc18c213dab2d..a439221e540c88 100644 --- a/remoting/host/security_key/security_key_auth_handler_posix_unittest.cc +++ b/remoting/host/security_key/security_key_auth_handler_posix_unittest.cc @@ -87,6 +87,11 @@ class SecurityKeyAuthHandlerPosixTest : public testing::Test { EXPECT_NE(auth_handler_.get(), nullptr); } + SecurityKeyAuthHandlerPosixTest(const SecurityKeyAuthHandlerPosixTest&) = + delete; + SecurityKeyAuthHandlerPosixTest& operator=( + const SecurityKeyAuthHandlerPosixTest&) = delete; + void CreateSocketAndWait() { ASSERT_EQ(0u, auth_handler_->GetActiveConnectionCountForTest()); auth_handler_->CreateSecurityKeyConnection(); @@ -188,9 +193,6 @@ class SecurityKeyAuthHandlerPosixTest : public testing::Test { base::ScopedTempDir temp_dir_; base::FilePath socket_path_; - - private: - DISALLOW_COPY_AND_ASSIGN(SecurityKeyAuthHandlerPosixTest); }; TEST_F(SecurityKeyAuthHandlerPosixTest, HandleSingleRequest) { diff --git a/remoting/host/setup/daemon_controller.h b/remoting/host/setup/daemon_controller.h index d43085d3a0a303..a210c08178f613 100644 --- a/remoting/host/setup/daemon_controller.h +++ b/remoting/host/setup/daemon_controller.h @@ -147,6 +147,9 @@ class DaemonController : public base::RefCountedThreadSafe { explicit DaemonController(std::unique_ptr delegate); + DaemonController(const DaemonController&) = delete; + DaemonController& operator=(const DaemonController&) = delete; + // Return the "installed/running" state of the daemon process. // // TODO(sergeyu): This method is called synchronously from the @@ -240,8 +243,6 @@ class DaemonController : public base::RefCountedThreadSafe { bool servicing_request_ = false; base::queue pending_requests_; - - DISALLOW_COPY_AND_ASSIGN(DaemonController); }; } // namespace remoting diff --git a/remoting/host/setup/service_client.h b/remoting/host/setup/service_client.h index ade37e8c1b8a75..ee230b8098b874 100644 --- a/remoting/host/setup/service_client.h +++ b/remoting/host/setup/service_client.h @@ -38,6 +38,10 @@ class ServiceClient { explicit ServiceClient( scoped_refptr url_loader_factory); + + ServiceClient(const ServiceClient&) = delete; + ServiceClient& operator=(const ServiceClient&) = delete; + ~ServiceClient(); // Register a host. @@ -56,7 +60,6 @@ class ServiceClient { // The guts of the implementation live in this class. class Core; scoped_refptr core_; - DISALLOW_COPY_AND_ASSIGN(ServiceClient); }; } // namespace remoting diff --git a/remoting/host/shutdown_watchdog.h b/remoting/host/shutdown_watchdog.h index 7fc9c2b4e4b0af..aa67c75cbd4a95 100644 --- a/remoting/host/shutdown_watchdog.h +++ b/remoting/host/shutdown_watchdog.h @@ -23,6 +23,9 @@ class ShutdownWatchdog : public base::Watchdog { // armed) before shutting down the process. explicit ShutdownWatchdog(const base::TimeDelta& duration); + ShutdownWatchdog(const ShutdownWatchdog&) = delete; + ShutdownWatchdog& operator=(const ShutdownWatchdog&) = delete; + // This method should be called to set the process's exit-code before arming // the watchdog. Otherwise an exit-code of 0 is assumed. void SetExitCode(int exit_code); @@ -34,8 +37,6 @@ class ShutdownWatchdog : public base::Watchdog { // Protects |exit_code_|, since Alarm() gets called on a separate thread. base::Lock lock_; - - DISALLOW_COPY_AND_ASSIGN(ShutdownWatchdog); }; } // namespace remoting diff --git a/remoting/host/token_validator_factory_impl.cc b/remoting/host/token_validator_factory_impl.cc index d0c8685a572f0b..2cb46bd22b543e 100644 --- a/remoting/host/token_validator_factory_impl.cc +++ b/remoting/host/token_validator_factory_impl.cc @@ -51,6 +51,9 @@ class TokenValidatorImpl : public TokenValidatorBase { const std::string& remote_jid, scoped_refptr request_context_getter); + TokenValidatorImpl(const TokenValidatorImpl&) = delete; + TokenValidatorImpl& operator=(const TokenValidatorImpl&) = delete; + protected: void StartValidateRequest(const std::string& token) override; @@ -60,8 +63,6 @@ class TokenValidatorImpl : public TokenValidatorBase { std::string post_body_; scoped_refptr key_pair_; - - DISALLOW_COPY_AND_ASSIGN(TokenValidatorImpl); }; TokenValidatorImpl::TokenValidatorImpl( diff --git a/remoting/host/token_validator_factory_impl.h b/remoting/host/token_validator_factory_impl.h index f77187e09103a1..1acc3c0bf5199d 100644 --- a/remoting/host/token_validator_factory_impl.h +++ b/remoting/host/token_validator_factory_impl.h @@ -30,6 +30,10 @@ class TokenValidatorFactoryImpl : public protocol::TokenValidatorFactory { scoped_refptr key_pair, scoped_refptr request_context_getter); + TokenValidatorFactoryImpl(const TokenValidatorFactoryImpl&) = delete; + TokenValidatorFactoryImpl& operator=(const TokenValidatorFactoryImpl&) = + delete; + // TokenValidatorFactory interface. std::unique_ptr CreateTokenValidator( const std::string& local_jid, @@ -41,8 +45,6 @@ class TokenValidatorFactoryImpl : public protocol::TokenValidatorFactory { ThirdPartyAuthConfig third_party_auth_config_; scoped_refptr key_pair_; scoped_refptr request_context_getter_; - - DISALLOW_COPY_AND_ASSIGN(TokenValidatorFactoryImpl); }; } // namespace remoting diff --git a/remoting/host/win/host_service.h b/remoting/host/win/host_service.h index 9fe7eb56022283..f52098c912a7e1 100644 --- a/remoting/host/win/host_service.h +++ b/remoting/host/win/host_service.h @@ -33,6 +33,9 @@ class HostService : public WtsTerminalMonitor { public: static HostService* GetInstance(); + HostService(const HostService&) = delete; + HostService& operator=(const HostService&) = delete; + // This function parses the command line and selects the action routine. bool InitWithCommandLine(const base::CommandLine* command_line); @@ -126,8 +129,6 @@ class HostService : public WtsTerminalMonitor { // Singleton. friend struct base::DefaultSingletonTraits; - - DISALLOW_COPY_AND_ASSIGN(HostService); }; } // namespace remoting diff --git a/remoting/host/win/rdp_client.cc b/remoting/host/win/rdp_client.cc index 1ea7f7d4e01196..cbe8faa9aec097 100644 --- a/remoting/host/win/rdp_client.cc +++ b/remoting/host/win/rdp_client.cc @@ -44,6 +44,9 @@ class RdpClient::Core scoped_refptr ui_task_runner, RdpClient::EventHandler* event_handler); + Core(const Core&) = delete; + Core& operator=(const Core&) = delete; + // Initiates a loopback RDP connection. void Connect(const ScreenResolution& resolution, const std::string& terminal_id, @@ -86,8 +89,6 @@ class RdpClient::Core // A self-reference to keep the object alive during connection shutdown. scoped_refptr self_; - - DISALLOW_COPY_AND_ASSIGN(Core); }; RdpClient::RdpClient( diff --git a/remoting/host/win/rdp_client_window.cc b/remoting/host/win/rdp_client_window.cc index 73664478b0432c..22f67b127b21f9 100644 --- a/remoting/host/win/rdp_client_window.cc +++ b/remoting/host/win/rdp_client_window.cc @@ -103,6 +103,9 @@ class RdpClientWindow::WindowHook public: static scoped_refptr Create(); + WindowHook(const WindowHook&) = delete; + WindowHook& operator=(const WindowHook&) = delete; + private: friend class base::RefCounted; @@ -113,8 +116,6 @@ class RdpClientWindow::WindowHook int code, WPARAM wparam, LPARAM lparam); HHOOK hook_; - - DISALLOW_COPY_AND_ASSIGN(WindowHook); }; RdpClientWindow::RdpClientWindow(const net::IPEndPoint& server_endpoint, diff --git a/remoting/host/win/session_input_injector.cc b/remoting/host/win/session_input_injector.cc index 31f9d6e3ac5fe7..234e0f615ae30a 100644 --- a/remoting/host/win/session_input_injector.cc +++ b/remoting/host/win/session_input_injector.cc @@ -60,6 +60,9 @@ class SessionInputInjectorWin::Core const base::RepeatingClosure& inject_sas, const base::RepeatingClosure& lock_workstation); + Core(const Core&) = delete; + Core& operator=(const Core&) = delete; + // InputInjector implementation. void Start(std::unique_ptr client_clipboard) override; @@ -97,8 +100,6 @@ class SessionInputInjectorWin::Core // Keys currently pressed by the client, used to detect key sequences. std::set pressed_keys_; - - DISALLOW_COPY_AND_ASSIGN(Core); }; SessionInputInjectorWin::Core::Core( diff --git a/remoting/host/win/wts_session_process_delegate.cc b/remoting/host/win/wts_session_process_delegate.cc index 2dfac410b04499..b828747b7869b6 100644 --- a/remoting/host/win/wts_session_process_delegate.cc +++ b/remoting/host/win/wts_session_process_delegate.cc @@ -62,6 +62,9 @@ class WtsSessionProcessDelegate::Core bool launch_elevated, const std::string& channel_security); + Core(const Core&) = delete; + Core& operator=(const Core&) = delete; + // Initializes the object returning true on success. bool Initialize(uint32_t session_id); @@ -162,8 +165,6 @@ class WtsSessionProcessDelegate::Core // The pending process connection for the process being launched. mojo::OutgoingInvitation mojo_invitation_; - - DISALLOW_COPY_AND_ASSIGN(Core); }; WtsSessionProcessDelegate::Core::Core( diff --git a/remoting/ios/app/notification_presenter.h b/remoting/ios/app/notification_presenter.h index 94132778cddee1..082a8f4d55969b 100644 --- a/remoting/ios/app/notification_presenter.h +++ b/remoting/ios/app/notification_presenter.h @@ -25,6 +25,9 @@ class NotificationPresenter final { public: static NotificationPresenter* GetInstance(); + NotificationPresenter(const NotificationPresenter&) = delete; + NotificationPresenter& operator=(const NotificationPresenter&) = delete; + void Start(); private: @@ -52,8 +55,6 @@ class NotificationPresenter final { State state_ = State::NOT_FETCHED; SEQUENCE_CHECKER(sequence_checker_); - - DISALLOW_COPY_AND_ASSIGN(NotificationPresenter); }; } // namespace remoting diff --git a/remoting/protocol/audio_pump_unittest.cc b/remoting/protocol/audio_pump_unittest.cc index 0352b47e1ccf83..c4c1dc1b1b8a66 100644 --- a/remoting/protocol/audio_pump_unittest.cc +++ b/remoting/protocol/audio_pump_unittest.cc @@ -64,6 +64,9 @@ class AudioPumpTest : public testing::Test, public protocol::AudioStub { public: AudioPumpTest() = default; + AudioPumpTest(const AudioPumpTest&) = delete; + AudioPumpTest& operator=(const AudioPumpTest&) = delete; + void SetUp() override; void TearDown() override; @@ -82,9 +85,6 @@ class AudioPumpTest : public testing::Test, public protocol::AudioStub { std::vector> sent_packets_; std::vector done_closures_; - - private: - DISALLOW_COPY_AND_ASSIGN(AudioPumpTest); }; void AudioPumpTest::SetUp() { diff --git a/remoting/protocol/connection_unittest.cc b/remoting/protocol/connection_unittest.cc index ebae2cd0dd7e95..859189a6dfb2ad 100644 --- a/remoting/protocol/connection_unittest.cc +++ b/remoting/protocol/connection_unittest.cc @@ -272,6 +272,9 @@ class ConnectionTest : public testing::Test, audio_decode_thread_.Start(); } + ConnectionTest(const ConnectionTest&) = delete; + ConnectionTest& operator=(const ConnectionTest&) = delete; + void DestroyHost() { host_connection_.reset(); run_loop_->Quit(); @@ -462,9 +465,6 @@ class ConnectionTest : public testing::Test, base::Thread video_encode_thread_; base::Thread audio_encode_thread_; base::Thread audio_decode_thread_; - - private: - DISALLOW_COPY_AND_ASSIGN(ConnectionTest); }; INSTANTIATE_TEST_SUITE_P(Ice, ConnectionTest, ::testing::Values(false)); diff --git a/remoting/protocol/datagram_channel_factory.h b/remoting/protocol/datagram_channel_factory.h index daa9648542c7dd..bdf67d44140fad 100644 --- a/remoting/protocol/datagram_channel_factory.h +++ b/remoting/protocol/datagram_channel_factory.h @@ -23,6 +23,9 @@ class DatagramChannelFactory { DatagramChannelFactory() {} + DatagramChannelFactory(const DatagramChannelFactory&) = delete; + DatagramChannelFactory& operator=(const DatagramChannelFactory&) = delete; + // Creates new channels and calls the |callback| when then new channel is // created and connected. The |callback| is called with nullptr if channel // setup failed for any reason. Callback may be called synchronously, before @@ -39,9 +42,6 @@ class DatagramChannelFactory { protected: virtual ~DatagramChannelFactory() {} - - private: - DISALLOW_COPY_AND_ASSIGN(DatagramChannelFactory); }; } // namespace protocol diff --git a/remoting/protocol/fake_desktop_capturer.cc b/remoting/protocol/fake_desktop_capturer.cc index 5a29fb157b3a63..8c124c80ac1a0b 100644 --- a/remoting/protocol/fake_desktop_capturer.cc +++ b/remoting/protocol/fake_desktop_capturer.cc @@ -44,6 +44,9 @@ class DefaultFrameGenerator box_speed_y_(kSpeed), first_frame_(true) {} + DefaultFrameGenerator(const DefaultFrameGenerator&) = delete; + DefaultFrameGenerator& operator=(const DefaultFrameGenerator&) = delete; + std::unique_ptr GenerateFrame( webrtc::SharedMemoryFactory* shared_memory_factory); @@ -57,8 +60,6 @@ class DefaultFrameGenerator int box_speed_x_; int box_speed_y_; bool first_frame_; - - DISALLOW_COPY_AND_ASSIGN(DefaultFrameGenerator); }; std::unique_ptr DefaultFrameGenerator::GenerateFrame( diff --git a/remoting/protocol/host_stub.h b/remoting/protocol/host_stub.h index 41e0a4540ad841..50d501c30733f3 100644 --- a/remoting/protocol/host_stub.h +++ b/remoting/protocol/host_stub.h @@ -27,6 +27,9 @@ class HostStub { public: HostStub() {} + HostStub(const HostStub&) = delete; + HostStub& operator=(const HostStub&) = delete; + // Notification of the client dimensions and pixel density. // This may be used to resize the host display to match the client area. virtual void NotifyClientResolution(const ClientResolution& resolution) = 0; @@ -59,9 +62,6 @@ class HostStub { protected: virtual ~HostStub() {} - - private: - DISALLOW_COPY_AND_ASSIGN(HostStub); }; } // namespace protocol diff --git a/remoting/protocol/pairing_registry.h b/remoting/protocol/pairing_registry.h index 889d2a8a78bfe3..9c56746c6cbcea 100644 --- a/remoting/protocol/pairing_registry.h +++ b/remoting/protocol/pairing_registry.h @@ -107,6 +107,9 @@ class PairingRegistry : public base::RefCountedThreadSafe { scoped_refptr delegate_task_runner, std::unique_ptr delegate); + PairingRegistry(const PairingRegistry&) = delete; + PairingRegistry& operator=(const PairingRegistry&) = delete; + // Creates a pairing for a new client and saves it to disk. // // TODO(jamiewalch): Plumb the Save callback into the RequestPairing flow @@ -182,8 +185,6 @@ class PairingRegistry : public base::RefCountedThreadSafe { std::unique_ptr delegate_; base::queue pending_requests_; - - DISALLOW_COPY_AND_ASSIGN(PairingRegistry); }; } // namespace protocol diff --git a/remoting/protocol/pseudotcp_adapter.cc b/remoting/protocol/pseudotcp_adapter.cc index 5c434f5c3732cc..f40535fdc3f0c1 100644 --- a/remoting/protocol/pseudotcp_adapter.cc +++ b/remoting/protocol/pseudotcp_adapter.cc @@ -36,6 +36,9 @@ class PseudoTcpAdapter::Core : public cricket::IPseudoTcpNotify, public: explicit Core(std::unique_ptr socket); + Core(const Core&) = delete; + Core& operator=(const Core&) = delete; + // Functions used to implement net::StreamSocket. int Read(const scoped_refptr& buffer, int buffer_size, @@ -116,8 +119,6 @@ class PseudoTcpAdapter::Core : public cricket::IPseudoTcpNotify, scoped_refptr socket_read_buffer_; base::OneShotTimer timer_; - - DISALLOW_COPY_AND_ASSIGN(Core); }; PseudoTcpAdapter::Core::Core(std::unique_ptr socket) diff --git a/remoting/protocol/stream_channel_factory.h b/remoting/protocol/stream_channel_factory.h index 8014d5dcf253cd..bab16a883f9c1e 100644 --- a/remoting/protocol/stream_channel_factory.h +++ b/remoting/protocol/stream_channel_factory.h @@ -26,6 +26,9 @@ class StreamChannelFactory { StreamChannelFactory() {} + StreamChannelFactory(const StreamChannelFactory&) = delete; + StreamChannelFactory& operator=(const StreamChannelFactory&) = delete; + // Creates new channels and calls the |callback| when then new channel is // created and connected. The |callback| is called with nullptr if connection // failed for any reason. Callback may be called synchronously, before the @@ -43,9 +46,6 @@ class StreamChannelFactory { virtual ~StreamChannelFactory() {} SEQUENCE_CHECKER(sequence_checker_); - - private: - DISALLOW_COPY_AND_ASSIGN(StreamChannelFactory); }; } // namespace protocol diff --git a/remoting/protocol/transport_context.h b/remoting/protocol/transport_context.h index 27e73c3c9c7627..e2336bf7d3eb95 100644 --- a/remoting/protocol/transport_context.h +++ b/remoting/protocol/transport_context.h @@ -50,6 +50,9 @@ class TransportContext : public base::RefCountedThreadSafe { const NetworkSettings& network_settings, TransportRole role); + TransportContext(const TransportContext&) = delete; + TransportContext& operator=(const TransportContext&) = delete; + void set_turn_ice_config(const IceConfig& ice_config) { DCHECK(!ice_config.is_null()); // If an external entity provides a valid ICE Config, then disable the local @@ -112,8 +115,6 @@ class TransportContext : public base::RefCountedThreadSafe { // Called once |ice_config_request_| completes. std::list pending_ice_config_callbacks_; - - DISALLOW_COPY_AND_ASSIGN(TransportContext); }; } // namespace protocol diff --git a/remoting/protocol/video_feedback_stub.h b/remoting/protocol/video_feedback_stub.h index 08d542a3572fb6..1efba8bb853da7 100644 --- a/remoting/protocol/video_feedback_stub.h +++ b/remoting/protocol/video_feedback_stub.h @@ -17,14 +17,14 @@ namespace protocol { class VideoFeedbackStub { public: + VideoFeedbackStub(const VideoFeedbackStub&) = delete; + VideoFeedbackStub& operator=(const VideoFeedbackStub&) = delete; + virtual void ProcessVideoAck(std::unique_ptr video_ack) = 0; protected: VideoFeedbackStub() {} virtual ~VideoFeedbackStub() {} - - private: - DISALLOW_COPY_AND_ASSIGN(VideoFeedbackStub); }; } // namespace protocol diff --git a/remoting/protocol/video_stats_stub.h b/remoting/protocol/video_stats_stub.h index d14971594c7a1a..0f789613bc15e0 100644 --- a/remoting/protocol/video_stats_stub.h +++ b/remoting/protocol/video_stats_stub.h @@ -17,15 +17,15 @@ struct HostFrameStats; // Interface used to send video frame stats from host to client. class VideoStatsStub { public: + VideoStatsStub(const VideoStatsStub&) = delete; + VideoStatsStub& operator=(const VideoStatsStub&) = delete; + virtual void OnVideoFrameStats(uint32_t frame_id, const HostFrameStats& frame_stats) = 0; protected: VideoStatsStub() {} virtual ~VideoStatsStub() {} - - private: - DISALLOW_COPY_AND_ASSIGN(VideoStatsStub); }; } // namespace protocol diff --git a/remoting/protocol/video_stub.h b/remoting/protocol/video_stub.h index 712a716cf4eb9f..fec37ba31f6c99 100644 --- a/remoting/protocol/video_stub.h +++ b/remoting/protocol/video_stub.h @@ -18,15 +18,15 @@ namespace protocol { class VideoStub { public: + VideoStub(const VideoStub&) = delete; + VideoStub& operator=(const VideoStub&) = delete; + virtual void ProcessVideoPacket(std::unique_ptr video_packet, base::OnceClosure done) = 0; protected: VideoStub() {} virtual ~VideoStub() {} - - private: - DISALLOW_COPY_AND_ASSIGN(VideoStub); }; } // namespace protocol diff --git a/remoting/protocol/webrtc_transport.cc b/remoting/protocol/webrtc_transport.cc index 09e2c7e371c26e..5ae74a49a0f6e5 100644 --- a/remoting/protocol/webrtc_transport.cc +++ b/remoting/protocol/webrtc_transport.cc @@ -163,6 +163,11 @@ class CreateSessionDescriptionObserver std::move(result_callback)); } + CreateSessionDescriptionObserver(const CreateSessionDescriptionObserver&) = + delete; + CreateSessionDescriptionObserver& operator=( + const CreateSessionDescriptionObserver&) = delete; + void OnSuccess(webrtc::SessionDescriptionInterface* desc) override { std::move(result_callback_).Run(base::WrapUnique(desc), std::string()); } @@ -178,8 +183,6 @@ class CreateSessionDescriptionObserver private: ResultCallback result_callback_; - - DISALLOW_COPY_AND_ASSIGN(CreateSessionDescriptionObserver); }; // A webrtc::SetSessionDescriptionObserver implementation used to receive the @@ -195,6 +198,10 @@ class SetSessionDescriptionObserver std::move(result_callback)); } + SetSessionDescriptionObserver(const SetSessionDescriptionObserver&) = delete; + SetSessionDescriptionObserver& operator=( + const SetSessionDescriptionObserver&) = delete; + void OnSuccess() override { std::move(result_callback_).Run(true, std::string()); } @@ -210,8 +217,6 @@ class SetSessionDescriptionObserver private: ResultCallback result_callback_; - - DISALLOW_COPY_AND_ASSIGN(SetSessionDescriptionObserver); }; class RtcEventLogOutput : public webrtc::RtcEventLogOutput { diff --git a/remoting/test/cyclic_frame_generator.h b/remoting/test/cyclic_frame_generator.h index 842f97788a34d3..6f0ca16f9fd083 100644 --- a/remoting/test/cyclic_frame_generator.h +++ b/remoting/test/cyclic_frame_generator.h @@ -51,6 +51,9 @@ class CyclicFrameGenerator : public protocol::InputEventTimestampsSource { explicit CyclicFrameGenerator( std::vector> reference_frames); + CyclicFrameGenerator(const CyclicFrameGenerator&) = delete; + CyclicFrameGenerator& operator=(const CyclicFrameGenerator&) = delete; + void set_frame_cycle_period(base::TimeDelta frame_cycle_period) { frame_cycle_period_ = frame_cycle_period; } @@ -101,8 +104,6 @@ class CyclicFrameGenerator : public protocol::InputEventTimestampsSource { // frame_id of the frame passed to the last GetChangeList() call. int last_identifier_frame_ = -1; - - DISALLOW_COPY_AND_ASSIGN(CyclicFrameGenerator); }; } // namespace test diff --git a/remoting/test/fake_connection_event_logger.cc b/remoting/test/fake_connection_event_logger.cc index 965c28120297c9..564fe4068eec4a 100644 --- a/remoting/test/fake_connection_event_logger.cc +++ b/remoting/test/fake_connection_event_logger.cc @@ -123,6 +123,10 @@ class MessageCounter { MessageCounter(const char* name, const char* unit); explicit MessageCounter(const char* name); + // Copy or assign the start_time_ of a MessageCounter is senseless. + MessageCounter(const MessageCounter&) = delete; + MessageCounter& operator=(const MessageCounter&) = delete; + int message_count() const { return *count_; } int64_t message_size() const { return *size_; } int last_message_size() const { return last_size_; } @@ -141,9 +145,6 @@ class MessageCounter { NoBarrierAtomicInt64 size_; int last_size_ = 0; base::Time start_time_; - - // Copy or assign the start_time_ of a MessageCounter is senseless. - DISALLOW_COPY_AND_ASSIGN(MessageCounter); }; MessageCounter::MessageCounter(const char* name, const char* unit) diff --git a/remoting/test/fake_network_dispatcher.h b/remoting/test/fake_network_dispatcher.h index 3257f927ce9405..af4b444dfdaa9f 100644 --- a/remoting/test/fake_network_dispatcher.h +++ b/remoting/test/fake_network_dispatcher.h @@ -45,6 +45,9 @@ class FakeNetworkDispatcher FakeNetworkDispatcher(); + FakeNetworkDispatcher(const FakeNetworkDispatcher&) = delete; + FakeNetworkDispatcher& operator=(const FakeNetworkDispatcher&) = delete; + rtc::IPAddress AllocateAddress(); // Must be called on the thread that the |node| works on. @@ -67,8 +70,6 @@ class FakeNetworkDispatcher // A counter used to allocate unique addresses in AllocateAddress(). int allocated_address_; - - DISALLOW_COPY_AND_ASSIGN(FakeNetworkDispatcher); }; } // namespace remoting diff --git a/remoting/test/scroll_frame_generator.h b/remoting/test/scroll_frame_generator.h index e76059713c3b1a..48aa3a73552b46 100644 --- a/remoting/test/scroll_frame_generator.h +++ b/remoting/test/scroll_frame_generator.h @@ -20,6 +20,9 @@ class ScrollFrameGenerator : public protocol::InputEventTimestampsSource { public: ScrollFrameGenerator(); + ScrollFrameGenerator(const ScrollFrameGenerator&) = delete; + ScrollFrameGenerator& operator=(const ScrollFrameGenerator&) = delete; + std::unique_ptr GenerateFrame( webrtc::SharedMemoryFactory* shared_memory_factory); @@ -33,8 +36,6 @@ class ScrollFrameGenerator : public protocol::InputEventTimestampsSource { base::TimeTicks start_time_; std::unordered_map frame_timestamp_; - - DISALLOW_COPY_AND_ASSIGN(ScrollFrameGenerator); }; } // namespace test