Chromium Code Reviews| Index: remoting/host/chromoting_host_context.h |
| diff --git a/remoting/host/chromoting_host_context.h b/remoting/host/chromoting_host_context.h |
| index 7476986ad605ec9efba49d996a015103cf4e5086..7bd765d58c1284ee6d58691c9d57c4ea70a461d7 100644 |
| --- a/remoting/host/chromoting_host_context.h |
| +++ b/remoting/host/chromoting_host_context.h |
| @@ -8,10 +8,15 @@ |
| #include <string> |
| #include "base/gtest_prod_util.h" |
| +#include "base/memory/ref_counted.h" |
| #include "base/threading/platform_thread.h" |
| #include "base/threading/thread.h" |
| #include "remoting/jingle_glue/jingle_thread.h" |
| +namespace base { |
| +class SingleThreadTaskRunner; |
| +} // namespace base |
| + |
| namespace net { |
| class URLRequestContextGetter; |
| } // namespace net |
| @@ -23,7 +28,8 @@ namespace remoting { |
| class ChromotingHostContext { |
| public: |
| // Create a context. |
| - ChromotingHostContext(base::MessageLoopProxy* ui_message_loop); |
| + ChromotingHostContext( |
| + scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
| virtual ~ChromotingHostContext(); |
| // TODO(ajwong): Move the Start method out of this class. Then |
| @@ -35,13 +41,42 @@ class ChromotingHostContext { |
| virtual JingleThread* jingle_thread(); |
| - virtual MessageLoop* main_message_loop(); |
| - virtual MessageLoop* encode_message_loop(); |
| - virtual base::MessageLoopProxy* network_message_loop(); |
| - virtual MessageLoop* desktop_message_loop(); |
| - virtual base::MessageLoopProxy* ui_message_loop(); |
| - virtual base::MessageLoopProxy* io_message_loop(); |
| - virtual base::MessageLoopProxy* file_message_loop(); |
| + // Task runned for the thread that is used for UI. In the NPAPI |
|
Wez
2012/06/19 18:30:21
typo: runned -> runner
typo: UI -> the UI
Sergey Ulanov
2012/06/19 19:01:41
Done.
|
| + // plugin this corresponds to the main plugin thread. |
| + virtual base::SingleThreadTaskRunner* ui_task_runner(); |
| + |
| + // Task runner for the thread used by the ScreenRecorder to capture |
| + // the screen. |
| + virtual base::SingleThreadTaskRunner* capture_task_runner(); |
| + |
| + // Task runner for the thread used to encode video streams. |
| + virtual base::SingleThreadTaskRunner* encode_task_runner(); |
| + |
| + // Network thread is the thread use for most networking IO. It runs |
| + // libjingle's message loop, so libjingle code should be used only |
| + // on this thread. |
|
Wez
2012/06/19 18:30:21
nit: Reword this to the same style as the others e
Sergey Ulanov
2012/06/19 19:01:41
Done.
|
| + virtual base::SingleThreadTaskRunner* network_task_runner(); |
| + |
| + // Task runner for the thread that is used by the EventExecutor. |
| + // |
| + // TODO(sergeyu): Do we need a separate thread for EventExecutor? |
| + // Can we use some other thread instead? |
| + virtual base::SingleThreadTaskRunner* desktop_task_runner(); |
| + |
| + // Task runner for the thread that is used for network IO. Note that |
| + // most of network IO for remoting happens on a different thread, |
| + // the one that corresponds to network_task_runner(). This is |
| + // because libjingle code needs to work on a thread that runs |
| + // libjingle's message loop. |
|
Wez
2012/06/19 18:30:21
This is confusing; what networking do we run on io
Sergey Ulanov
2012/06/19 19:01:41
All HTTP requests, specifically for oauth and rela
|
| + // |
| + // TODO(sergeyu): Implement socket server for libjingle that works |
| + // on a regular chromium thread and use it for network_task_runner() |
| + // to avoid the need for io_task_runner(). |
| + virtual base::SingleThreadTaskRunner* io_task_runner(); |
| + |
| + // Task runner for the thread that is used for file IO. |
|
Wez
2012/06/19 18:30:21
nit: Why do we keep this separate from the IO thre
Sergey Ulanov
2012/06/19 19:01:41
changed "file IO" to "blocking file IO".
|
| + virtual base::SingleThreadTaskRunner* file_task_runner(); |
| + |
| const scoped_refptr<net::URLRequestContextGetter>& |
| url_request_context_getter(); |
| @@ -51,15 +86,13 @@ class ChromotingHostContext { |
| // A thread that hosts all network operations. |
| JingleThread jingle_thread_; |
| - // TODO(sergeyu): The "main" thread is used just by the |
| - // capturer. Consider renaming it. |
| - base::Thread main_thread_; |
| + // A thread that hosts screen capture. |
| + base::Thread capture_thread_; |
| // A thread that hosts all encode operations. |
| base::Thread encode_thread_; |
| - // A thread that hosts desktop integration (capture, input injection, etc) |
| - // This is NOT a Chrome-style UI thread. |
| + // A thread that hosts input injection. |
| base::Thread desktop_thread_; |
| // Thread for non-blocking IO operations. |
| @@ -68,7 +101,7 @@ class ChromotingHostContext { |
| // Thread for blocking IO operations. |
| base::Thread file_thread_; |
| - scoped_refptr<base::MessageLoopProxy> ui_message_loop_; |
| + scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
| scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; |