Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Unified Diff: remoting/host/chromoting_host_context_impl.cc

Issue 639233002: Remote assistance on Chrome OS Part IV - It2MeHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/host/chromoting_host_context_impl.cc
diff --git a/remoting/host/chromoting_host_context_impl.cc b/remoting/host/chromoting_host_context_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..71cbd74aac16102c627335473fa071e63195deba
--- /dev/null
+++ b/remoting/host/chromoting_host_context_impl.cc
@@ -0,0 +1,53 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "remoting/host/chromoting_host_context_impl.h"
+
+#include "remoting/base/auto_thread.h"
+#include "remoting/base/url_request_context_getter.h"
+
+namespace remoting {
+
+ChromotingHostContextImpl::ChromotingHostContextImpl(
+ AutoThreadTaskRunner* ui_task_runner)
+ : ChromotingHostContext(ui_task_runner) {
+#if defined(OS_WIN)
+ // On Windows the AudioCapturer requires COM, so we run a single-threaded
+ // apartment, which requires a UI thread.
+ audio_task_runner_ =
+ AutoThread::CreateWithLoopAndComInitTypes("ChromotingAudioThread",
+ ui_task_runner_,
+ base::MessageLoop::TYPE_UI,
+ AutoThread::COM_INIT_STA);
+#else // !defined(OS_WIN)
+ audio_task_runner_ = AutoThread::CreateWithType(
+ "ChromotingAudioThread", ui_task_runner_, base::MessageLoop::TYPE_IO);
+#endif // !defined(OS_WIN)
+
+ file_task_runner_ = AutoThread::CreateWithType(
+ "ChromotingFileThread", ui_task_runner_, base::MessageLoop::TYPE_IO);
+ input_task_runner_ = AutoThread::CreateWithType(
+ "ChromotingInputThread", ui_task_runner_, base::MessageLoop::TYPE_IO);
+ network_task_runner_ = AutoThread::CreateWithType(
+ "ChromotingNetworkThread", ui_task_runner_, base::MessageLoop::TYPE_IO);
+ video_capture_task_runner_ =
+ AutoThread::Create("ChromotingCaptureThread", ui_task_runner_);
+ video_encode_task_runner_ = AutoThread::Create(
+ "ChromotingEncodeThread", ui_task_runner_);
+ url_request_context_getter_ = new URLRequestContextGetter(
+ network_task_runner_, file_task_runner_);
+}
+
+ChromotingHostContextImpl::~ChromotingHostContextImpl() {
+}
+
+#if !defined(OS_CHROMEOS)
+// static
+scoped_refptr<ChromotingHostContext> ChromotingHostContext::Create(
+ scoped_refptr<AutoThreadTaskRunner> ui_task_runner) {
+ return new ChromotingHostContextImpl(ui_task_runner.get());
+}
+#endif // !defined(OS_CHROMEOS)
+
+} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698