| 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_CHROMOTING_HOST_CONTEXT_H_ | 5 #ifndef REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_ |
| 6 #define REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_ | 6 #define REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 ~ChromotingHostContext(); | 24 ~ChromotingHostContext(); |
| 25 | 25 |
| 26 // Create threads and URLRequestContextGetter for use by a host. | 26 // Create threads and URLRequestContextGetter for use by a host. |
| 27 // During shutdown the caller should tear-down the ChromotingHostContext and | 27 // During shutdown the caller should tear-down the ChromotingHostContext and |
| 28 // then continue to run until |ui_task_runner| is no longer referenced. | 28 // then continue to run until |ui_task_runner| is no longer referenced. |
| 29 // NULL is returned if any threads fail to start. | 29 // NULL is returned if any threads fail to start. |
| 30 static scoped_ptr<ChromotingHostContext> Create( | 30 static scoped_ptr<ChromotingHostContext> Create( |
| 31 scoped_refptr<AutoThreadTaskRunner> ui_task_runner); | 31 scoped_refptr<AutoThreadTaskRunner> ui_task_runner); |
| 32 | 32 |
| 33 // Task runner for the thread used for audio capture and encoding. | 33 // Task runner for the thread used for audio capture and encoding. |
| 34 scoped_refptr<AutoThreadTaskRunner> audio_task_runner(); | 34 scoped_refptr<AutoThreadTaskRunner> audio_task_runner() const; |
| 35 | 35 |
| 36 // Task runner for the thread that is used for blocking file | 36 // Task runner for the thread that is used for blocking file |
| 37 // IO. This thread is used by the URLRequestContext to read proxy | 37 // IO. This thread is used by the URLRequestContext to read proxy |
| 38 // configuration and by NatConfig to read policy configs. | 38 // configuration and by NatConfig to read policy configs. |
| 39 scoped_refptr<AutoThreadTaskRunner> file_task_runner(); | 39 scoped_refptr<AutoThreadTaskRunner> file_task_runner() const; |
| 40 | 40 |
| 41 // Task runner for the thread that is used by the InputInjector. | 41 // Task runner for the thread that is used by the InputInjector. |
| 42 // | 42 // |
| 43 // TODO(sergeyu): Do we need a separate thread for InputInjector? | 43 // TODO(sergeyu): Do we need a separate thread for InputInjector? |
| 44 // Can we use some other thread instead? | 44 // Can we use some other thread instead? |
| 45 scoped_refptr<AutoThreadTaskRunner> input_task_runner(); | 45 scoped_refptr<AutoThreadTaskRunner> input_task_runner() const; |
| 46 | 46 |
| 47 // Task runner for the thread used for network IO. This thread runs | 47 // Task runner for the thread used for network IO. This thread runs |
| 48 // a libjingle message loop, and is the only thread on which | 48 // a libjingle message loop, and is the only thread on which |
| 49 // libjingle code may be run. | 49 // libjingle code may be run. |
| 50 scoped_refptr<AutoThreadTaskRunner> network_task_runner(); | 50 scoped_refptr<AutoThreadTaskRunner> network_task_runner() const; |
| 51 | 51 |
| 52 // Task runner for the thread that is used for the UI. | 52 // Task runner for the thread that is used for the UI. |
| 53 scoped_refptr<AutoThreadTaskRunner> ui_task_runner(); | 53 scoped_refptr<AutoThreadTaskRunner> ui_task_runner() const; |
| 54 | 54 |
| 55 // Task runner for the thread used by the ScreenRecorder to capture | 55 // Task runner for the thread used by the ScreenRecorder to capture |
| 56 // the screen. | 56 // the screen. |
| 57 scoped_refptr<AutoThreadTaskRunner> video_capture_task_runner(); | 57 scoped_refptr<AutoThreadTaskRunner> video_capture_task_runner() const; |
| 58 | 58 |
| 59 // Task runner for the thread used to encode video streams. | 59 // Task runner for the thread used to encode video streams. |
| 60 scoped_refptr<AutoThreadTaskRunner> video_encode_task_runner(); | 60 scoped_refptr<AutoThreadTaskRunner> video_encode_task_runner() const; |
| 61 | 61 |
| 62 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter(); | 62 scoped_refptr<net::URLRequestContextGetter> |
| 63 url_request_context_getter() const; |
| 63 | 64 |
| 64 private: | 65 private: |
| 65 ChromotingHostContext(AutoThreadTaskRunner* ui_task_runner); | 66 ChromotingHostContext(AutoThreadTaskRunner* ui_task_runner); |
| 66 | 67 |
| 67 // Thread for audio capture and encoding. | 68 // Thread for audio capture and encoding. |
| 68 scoped_refptr<AutoThreadTaskRunner> audio_task_runner_; | 69 scoped_refptr<AutoThreadTaskRunner> audio_task_runner_; |
| 69 | 70 |
| 70 // Thread for I/O operations. | 71 // Thread for I/O operations. |
| 71 scoped_refptr<AutoThreadTaskRunner> file_task_runner_; | 72 scoped_refptr<AutoThreadTaskRunner> file_task_runner_; |
| 72 | 73 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 87 | 88 |
| 88 // Serves URLRequestContexts that use the network and UI task runners. | 89 // Serves URLRequestContexts that use the network and UI task runners. |
| 89 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; | 90 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; |
| 90 | 91 |
| 91 DISALLOW_COPY_AND_ASSIGN(ChromotingHostContext); | 92 DISALLOW_COPY_AND_ASSIGN(ChromotingHostContext); |
| 92 }; | 93 }; |
| 93 | 94 |
| 94 } // namespace remoting | 95 } // namespace remoting |
| 95 | 96 |
| 96 #endif // REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_ | 97 #endif // REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_ |
| OLD | NEW |