| OLD | NEW |
| 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_EVENT_EXECUTOR_H_ | 5 #ifndef REMOTING_HOST_EVENT_EXECUTOR_H_ |
| 6 #define REMOTING_HOST_EVENT_EXECUTOR_H_ | 6 #define REMOTING_HOST_EVENT_EXECUTOR_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "remoting/protocol/clipboard_stub.h" | 10 #include "remoting/protocol/clipboard_stub.h" |
| 11 #include "remoting/protocol/host_event_stub.h" | 11 #include "remoting/protocol/host_event_stub.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class SingleThreadTaskRunner; | 14 class SingleThreadTaskRunner; |
| 15 } // namespace base | 15 } // namespace base |
| 16 | 16 |
| 17 namespace remoting { | 17 namespace remoting { |
| 18 | 18 |
| 19 class Capturer; | 19 class VideoFrameCapturer; |
| 20 | 20 |
| 21 class EventExecutor : public protocol::HostEventStub { | 21 class EventExecutor : public protocol::HostEventStub { |
| 22 public: | 22 public: |
| 23 // Creates a default event executor for the current platform. This | 23 // Creates a default event executor for the current platform. This |
| 24 // object should do as much work as possible on |main_task_runner|, | 24 // object should do as much work as possible on |main_task_runner|, |
| 25 // using |ui_task_runner| only for tasks actually requiring a UI | 25 // using |ui_task_runner| only for tasks actually requiring a UI |
| 26 // thread. | 26 // thread. |
| 27 static scoped_ptr<EventExecutor> Create( | 27 static scoped_ptr<EventExecutor> Create( |
| 28 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 28 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 29 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 29 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| 30 Capturer* capturer); | 30 VideoFrameCapturer* capturer); |
| 31 | 31 |
| 32 // Initialises any objects needed to execute events. | 32 // Initialises any objects needed to execute events. |
| 33 virtual void OnSessionStarted( | 33 virtual void OnSessionStarted( |
| 34 scoped_ptr<protocol::ClipboardStub> client_clipboard) = 0; | 34 scoped_ptr<protocol::ClipboardStub> client_clipboard) = 0; |
| 35 | 35 |
| 36 // Destroys any objects constructed by Start(). | 36 // Destroys any objects constructed by Start(). |
| 37 virtual void OnSessionFinished() = 0; | 37 virtual void OnSessionFinished() = 0; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 } // namespace remoting | 40 } // namespace remoting |
| 41 | 41 |
| 42 #endif // REMOTING_HOST_EVENT_EXECUTOR_H_ | 42 #endif // REMOTING_HOST_EVENT_EXECUTOR_H_ |
| OLD | NEW |