Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: remoting/host/ipc_desktop_environment.h

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/host/ipc_audio_capturer.cc ('k') | remoting/host/ipc_desktop_environment.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_ 5 #ifndef REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_
6 #define REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_ 6 #define REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory>
9 #include <string> 10 #include <string>
10 11
11 #include "base/callback_forward.h" 12 #include "base/callback_forward.h"
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "remoting/host/desktop_environment.h" 16 #include "remoting/host/desktop_environment.h"
17 #include "remoting/host/desktop_session_connector.h" 17 #include "remoting/host/desktop_session_connector.h"
18 18
19 namespace base { 19 namespace base {
20 class SingleThreadTaskRunner; 20 class SingleThreadTaskRunner;
21 } // base 21 } // base
22 22
23 namespace IPC { 23 namespace IPC {
24 class Sender; 24 class Sender;
(...skipping 16 matching lines...) Expand all
41 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, 41 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner,
42 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, 42 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
43 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, 43 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
44 base::WeakPtr<ClientSessionControl> client_session_control, 44 base::WeakPtr<ClientSessionControl> client_session_control,
45 base::WeakPtr<DesktopSessionConnector> desktop_session_connector, 45 base::WeakPtr<DesktopSessionConnector> desktop_session_connector,
46 bool virtual_terminal, 46 bool virtual_terminal,
47 bool supports_touch_events); 47 bool supports_touch_events);
48 ~IpcDesktopEnvironment() override; 48 ~IpcDesktopEnvironment() override;
49 49
50 // DesktopEnvironment implementation. 50 // DesktopEnvironment implementation.
51 scoped_ptr<AudioCapturer> CreateAudioCapturer() override; 51 std::unique_ptr<AudioCapturer> CreateAudioCapturer() override;
52 scoped_ptr<InputInjector> CreateInputInjector() override; 52 std::unique_ptr<InputInjector> CreateInputInjector() override;
53 scoped_ptr<ScreenControls> CreateScreenControls() override; 53 std::unique_ptr<ScreenControls> CreateScreenControls() override;
54 scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer() override; 54 std::unique_ptr<webrtc::DesktopCapturer> CreateVideoCapturer() override;
55 scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor() override; 55 std::unique_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor()
56 override;
56 std::string GetCapabilities() const override; 57 std::string GetCapabilities() const override;
57 void SetCapabilities(const std::string& capabilities) override; 58 void SetCapabilities(const std::string& capabilities) override;
58 59
59 private: 60 private:
60 scoped_refptr<DesktopSessionProxy> desktop_session_proxy_; 61 scoped_refptr<DesktopSessionProxy> desktop_session_proxy_;
61 62
62 DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironment); 63 DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironment);
63 }; 64 };
64 65
65 // Used to create IpcDesktopEnvironment objects integrating with the desktop via 66 // Used to create IpcDesktopEnvironment objects integrating with the desktop via
66 // a helper process and talking to that process via IPC. 67 // a helper process and talking to that process via IPC.
67 class IpcDesktopEnvironmentFactory 68 class IpcDesktopEnvironmentFactory
68 : public DesktopEnvironmentFactory, 69 : public DesktopEnvironmentFactory,
69 public DesktopSessionConnector { 70 public DesktopSessionConnector {
70 public: 71 public:
71 // Passes a reference to the IPC channel connected to the daemon process and 72 // Passes a reference to the IPC channel connected to the daemon process and
72 // relevant task runners. |daemon_channel| must outlive this object. 73 // relevant task runners. |daemon_channel| must outlive this object.
73 IpcDesktopEnvironmentFactory( 74 IpcDesktopEnvironmentFactory(
74 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, 75 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner,
75 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, 76 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
76 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, 77 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
77 IPC::Sender* daemon_channel); 78 IPC::Sender* daemon_channel);
78 ~IpcDesktopEnvironmentFactory() override; 79 ~IpcDesktopEnvironmentFactory() override;
79 80
80 // DesktopEnvironmentFactory implementation. 81 // DesktopEnvironmentFactory implementation.
81 scoped_ptr<DesktopEnvironment> Create( 82 std::unique_ptr<DesktopEnvironment> Create(
82 base::WeakPtr<ClientSessionControl> client_session_control) override; 83 base::WeakPtr<ClientSessionControl> client_session_control) override;
83 void SetEnableCurtaining(bool enable) override; 84 void SetEnableCurtaining(bool enable) override;
84 bool SupportsAudioCapture() const override; 85 bool SupportsAudioCapture() const override;
85 86
86 // DesktopSessionConnector implementation. 87 // DesktopSessionConnector implementation.
87 void ConnectTerminal(DesktopSessionProxy* desktop_session_proxy, 88 void ConnectTerminal(DesktopSessionProxy* desktop_session_proxy,
88 const ScreenResolution& resolution, 89 const ScreenResolution& resolution,
89 bool virtual_terminal) override; 90 bool virtual_terminal) override;
90 void DisconnectTerminal(DesktopSessionProxy* desktop_session_proxy) override; 91 void DisconnectTerminal(DesktopSessionProxy* desktop_session_proxy) override;
91 void SetScreenResolution(DesktopSessionProxy* desktop_session_proxy, 92 void SetScreenResolution(DesktopSessionProxy* desktop_session_proxy,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 134
134 // Factory for weak pointers to DesktopSessionConnector interface. 135 // Factory for weak pointers to DesktopSessionConnector interface.
135 base::WeakPtrFactory<DesktopSessionConnector> connector_factory_; 136 base::WeakPtrFactory<DesktopSessionConnector> connector_factory_;
136 137
137 DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironmentFactory); 138 DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironmentFactory);
138 }; 139 };
139 140
140 } // namespace remoting 141 } // namespace remoting
141 142
142 #endif // REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_ 143 #endif // REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_H_
OLDNEW
« no previous file with comments | « remoting/host/ipc_audio_capturer.cc ('k') | remoting/host/ipc_desktop_environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698