| Index: remoting/host/chromoting_host_context.h
|
| diff --git a/remoting/host/chromoting_host_context.h b/remoting/host/chromoting_host_context.h
|
| index 351c1307922fb5f72742b729048ad435c36344dd..46f3d06cf7212c810bdc9b9f035e556fb8d5a2b1 100644
|
| --- a/remoting/host/chromoting_host_context.h
|
| +++ b/remoting/host/chromoting_host_context.h
|
| @@ -27,13 +27,18 @@ class AutoThreadTaskRunner;
|
| // process. This class is virtual only for testing purposes (see below).
|
| class ChromotingHostContext {
|
| public:
|
| - // Create threads and URLRequestContextGetter for use by a host.
|
| + // Creates threads and URLRequestContextGetter for use by a host.
|
| // During shutdown the caller should tear-down the ChromotingHostContext and
|
| // then continue to run until |ui_task_runner| is no longer referenced.
|
| // nullptr is returned if any threads fail to start.
|
| static std::unique_ptr<ChromotingHostContext> Create(
|
| scoped_refptr<AutoThreadTaskRunner> ui_task_runner);
|
|
|
| + // Creates a ChromotingHostContext instance, which uses the input task runner
|
| + // for all jobs. This is for tests only.
|
| + static std::unique_ptr<ChromotingHostContext> CreateForTest(
|
| + scoped_refptr<AutoThreadTaskRunner> task_runner);
|
| +
|
| #if defined(OS_CHROMEOS)
|
| // Attaches task runners to the relevant browser threads for the chromoting
|
| // host. Must be called on the UI thread of the browser process.
|
| @@ -53,7 +58,7 @@ class ChromotingHostContext {
|
|
|
| ~ChromotingHostContext();
|
|
|
| - std::unique_ptr<ChromotingHostContext> Copy();
|
| + std::unique_ptr<ChromotingHostContext> Copy() const;
|
|
|
| // Task runner for the thread that is used for the UI.
|
| scoped_refptr<AutoThreadTaskRunner> ui_task_runner() const;
|
| @@ -88,6 +93,17 @@ class ChromotingHostContext {
|
| const;
|
|
|
| private:
|
| + // Creates a ChromotingHostContext instance. Returns nullptr if any of the
|
| + // input task runner is nullptr.
|
| + static std::unique_ptr<ChromotingHostContext> Create(
|
| + scoped_refptr<AutoThreadTaskRunner> ui_task_runner,
|
| + scoped_refptr<AutoThreadTaskRunner> audio_task_runner,
|
| + scoped_refptr<AutoThreadTaskRunner> file_task_runner,
|
| + scoped_refptr<AutoThreadTaskRunner> input_task_runner,
|
| + scoped_refptr<AutoThreadTaskRunner> network_task_runner,
|
| + scoped_refptr<AutoThreadTaskRunner> video_capture_task_runner,
|
| + scoped_refptr<AutoThreadTaskRunner> video_encode_task_runner);
|
| +
|
| ChromotingHostContext(
|
| scoped_refptr<AutoThreadTaskRunner> ui_task_runner,
|
| scoped_refptr<AutoThreadTaskRunner> audio_task_runner,
|
|
|