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 #include "remoting/host/chromoting_host_context.h" | 5 #include "remoting/host/chromoting_host_context.h" |
6 | 6 |
7 #include "content/public/browser/browser_thread.h" | 7 #include "content/public/browser/browser_thread.h" |
8 #include "remoting/base/auto_thread.h" | 8 #include "remoting/base/auto_thread.h" |
9 #include "remoting/base/url_request_context_getter.h" | 9 #include "remoting/base/url_request_context_getter.h" |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 } | 33 } |
34 | 34 |
35 scoped_ptr<ChromotingHostContext> ChromotingHostContext::Copy() { | 35 scoped_ptr<ChromotingHostContext> ChromotingHostContext::Copy() { |
36 return make_scoped_ptr(new ChromotingHostContext( | 36 return make_scoped_ptr(new ChromotingHostContext( |
37 ui_task_runner_, audio_task_runner_, file_task_runner_, | 37 ui_task_runner_, audio_task_runner_, file_task_runner_, |
38 input_task_runner_, network_task_runner_, video_capture_task_runner_, | 38 input_task_runner_, network_task_runner_, video_capture_task_runner_, |
39 video_encode_task_runner_, url_request_context_getter_)); | 39 video_encode_task_runner_, url_request_context_getter_)); |
40 } | 40 } |
41 | 41 |
42 scoped_refptr<AutoThreadTaskRunner> | 42 scoped_refptr<AutoThreadTaskRunner> |
43 ChromotingHostContext::audio_task_runner() { | 43 ChromotingHostContext::audio_task_runner() const { |
44 return audio_task_runner_; | 44 return audio_task_runner_; |
45 } | 45 } |
46 | 46 |
47 scoped_refptr<AutoThreadTaskRunner> | 47 scoped_refptr<AutoThreadTaskRunner> |
48 ChromotingHostContext::file_task_runner() { | 48 ChromotingHostContext::file_task_runner() const { |
49 return file_task_runner_; | 49 return file_task_runner_; |
50 } | 50 } |
51 | 51 |
52 scoped_refptr<AutoThreadTaskRunner> | 52 scoped_refptr<AutoThreadTaskRunner> |
53 ChromotingHostContext::input_task_runner() { | 53 ChromotingHostContext::input_task_runner() const { |
54 return input_task_runner_; | 54 return input_task_runner_; |
55 } | 55 } |
56 | 56 |
57 scoped_refptr<AutoThreadTaskRunner> | 57 scoped_refptr<AutoThreadTaskRunner> |
58 ChromotingHostContext::network_task_runner() { | 58 ChromotingHostContext::network_task_runner() const { |
59 return network_task_runner_; | 59 return network_task_runner_; |
60 } | 60 } |
61 | 61 |
62 scoped_refptr<AutoThreadTaskRunner> | 62 scoped_refptr<AutoThreadTaskRunner> |
63 ChromotingHostContext::ui_task_runner() { | 63 ChromotingHostContext::ui_task_runner() const { |
64 return ui_task_runner_; | 64 return ui_task_runner_; |
65 } | 65 } |
66 | 66 |
67 scoped_refptr<AutoThreadTaskRunner> | 67 scoped_refptr<AutoThreadTaskRunner> |
68 ChromotingHostContext::video_capture_task_runner() { | 68 ChromotingHostContext::video_capture_task_runner() const { |
69 return video_capture_task_runner_; | 69 return video_capture_task_runner_; |
70 } | 70 } |
71 | 71 |
72 scoped_refptr<AutoThreadTaskRunner> | 72 scoped_refptr<AutoThreadTaskRunner> |
73 ChromotingHostContext::video_encode_task_runner() { | 73 ChromotingHostContext::video_encode_task_runner() const { |
74 return video_encode_task_runner_; | 74 return video_encode_task_runner_; |
75 } | 75 } |
76 | 76 |
77 scoped_refptr<net::URLRequestContextGetter> | 77 scoped_refptr<net::URLRequestContextGetter> |
78 ChromotingHostContext::url_request_context_getter() { | 78 ChromotingHostContext::url_request_context_getter() const { |
79 return url_request_context_getter_; | 79 return url_request_context_getter_; |
80 } | 80 } |
81 | 81 |
82 scoped_ptr<ChromotingHostContext> ChromotingHostContext::Create( | 82 scoped_ptr<ChromotingHostContext> ChromotingHostContext::Create( |
83 scoped_refptr<AutoThreadTaskRunner> ui_task_runner) { | 83 scoped_refptr<AutoThreadTaskRunner> ui_task_runner) { |
84 #if defined(OS_WIN) | 84 #if defined(OS_WIN) |
85 // On Windows the AudioCapturer requires COM, so we run a single-threaded | 85 // On Windows the AudioCapturer requires COM, so we run a single-threaded |
86 // apartment, which requires a UI thread. | 86 // apartment, which requires a UI thread. |
87 scoped_refptr<AutoThreadTaskRunner> audio_task_runner = | 87 scoped_refptr<AutoThreadTaskRunner> audio_task_runner = |
88 AutoThread::CreateWithLoopAndComInitTypes( | 88 AutoThread::CreateWithLoopAndComInitTypes( |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 base::MessageLoop::TYPE_IO), | 156 base::MessageLoop::TYPE_IO), |
157 WrapBrowserThread(content::BrowserThread::IO), // network_task_runner | 157 WrapBrowserThread(content::BrowserThread::IO), // network_task_runner |
158 ui_task_runner, // video_capture_task_runner | 158 ui_task_runner, // video_capture_task_runner |
159 AutoThread::CreateWithType("ChromotingEncodeThread", file_task_runner, | 159 AutoThread::CreateWithType("ChromotingEncodeThread", file_task_runner, |
160 base::MessageLoop::TYPE_IO), | 160 base::MessageLoop::TYPE_IO), |
161 url_request_context_getter)); | 161 url_request_context_getter)); |
162 } | 162 } |
163 #endif // defined(OS_CHROMEOS) | 163 #endif // defined(OS_CHROMEOS) |
164 | 164 |
165 } // namespace remoting | 165 } // namespace remoting |
OLD | NEW |