Chromium Code Reviews| Index: remoting/host/desktop_session_agent.h |
| diff --git a/remoting/host/desktop_session_agent.h b/remoting/host/desktop_session_agent.h |
| index d7d5c9003afe5aa4b62c3abd6ce24308c7d4c4e9..9c53f576ba59f753eaec95d7ee0da3839027a5ad 100644 |
| --- a/remoting/host/desktop_session_agent.h |
| +++ b/remoting/host/desktop_session_agent.h |
| @@ -38,6 +38,18 @@ class DesktopSessionAgent |
| public SharedBufferFactory, |
| public VideoFrameCapturer::Delegate { |
| public: |
| + class Delegate { |
| + public: |
| + virtual ~Delegate(); |
| + |
| + // Notifies the delegate that the network-to-desktop channel has been |
| + // disconnected. |
| + virtual void OnNetworkProcessDisconnected() = 0; |
| + |
| + // Request the delegate to inject Secure Attention Sequence. |
| + virtual void InjectSas() = 0; |
| + }; |
| + |
| static scoped_refptr<DesktopSessionAgent> Create( |
| scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
| scoped_refptr<AutoThreadTaskRunner> input_task_runner, |
| @@ -65,12 +77,9 @@ class DesktopSessionAgent |
| // Creates desktop integration components and a connected IPC channel to be |
| // used to access them. The client end of the channel is returned in |
| - // the variable pointed by |desktop_pipe_out|. |
| - // |
| - // |disconnected_task| is invoked on |caller_task_runner_| to notify |
| - // the caller that the network-to-desktop channel has been disconnected. |
| - bool Start(const base::Closure& disconnected_task, |
| - IPC::PlatformFileForTransit* desktop_pipe_out); |
| + // the variable pointed by |desktop_pipe_out|. |delegate| must be valid until |
| + // Stop() is called. |
|
Jamie
2012/12/06 21:42:25
Would it be possible/sensible to use refcounting t
alexeypa (please no reviews)
2012/12/06 21:56:02
Using Start()/Stop() methods with a requirement to
|
| + bool Start(Delegate* delegate, IPC::PlatformFileForTransit* desktop_pipe_out); |
| // Stops the agent asynchronously. |
| void Stop(); |
| @@ -91,6 +100,9 @@ class DesktopSessionAgent |
| IPC::PlatformFileForTransit* client_out, |
| scoped_ptr<IPC::ChannelProxy>* server_out) = 0; |
| + // Creates an event executor specific to the platform. |
| + virtual scoped_ptr<EventExecutor> CreateEventExecutor() = 0; |
| + |
| // Handles CaptureFrame requests from the client. |
| void OnCaptureFrame(); |
| @@ -132,6 +144,10 @@ class DesktopSessionAgent |
| return video_capture_task_runner_; |
| } |
| + Delegate* delegate() const { |
| + return delegate_; |
| + } |
| + |
| private: |
| // Task runner on which public methods of this class should be called. |
| scoped_refptr<AutoThreadTaskRunner> caller_task_runner_; |
| @@ -145,9 +161,7 @@ class DesktopSessionAgent |
| // Task runner dedicated to running methods of |video_capturer_|. |
| scoped_refptr<AutoThreadTaskRunner> video_capture_task_runner_; |
| - // Runs on |caller_task_runner_| to notify the caller that the network-to- |
| - // desktop channel has been disconnected. |
| - base::Closure disconnected_task_; |
| + Delegate* delegate_; |
| // Executes keyboard, mouse and clipboard events. |
| scoped_ptr<EventExecutor> event_executor_; |