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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 file_thread_("ChromotingFileIOThread"), | 22 file_thread_("ChromotingFileIOThread"), |
23 ui_message_loop_(ui_message_loop) { | 23 ui_message_loop_(ui_message_loop) { |
24 } | 24 } |
25 | 25 |
26 ChromotingHostContext::~ChromotingHostContext() { | 26 ChromotingHostContext::~ChromotingHostContext() { |
27 } | 27 } |
28 | 28 |
29 bool ChromotingHostContext::Start() { | 29 bool ChromotingHostContext::Start() { |
30 // Start all the threads. | 30 // Start all the threads. |
31 bool started = main_thread_.Start() && encode_thread_.Start() && | 31 bool started = main_thread_.Start() && encode_thread_.Start() && |
32 jingle_thread_.Start() && desktop_thread_.Start() && | 32 jingle_thread_.Start() && |
| 33 desktop_thread_.StartWithOptions( |
| 34 base::Thread::Options(MessageLoop::TYPE_UI, 0)) && |
33 io_thread_.StartWithOptions( | 35 io_thread_.StartWithOptions( |
34 base::Thread::Options(MessageLoop::TYPE_IO, 0)) && | 36 base::Thread::Options(MessageLoop::TYPE_IO, 0)) && |
35 file_thread_.StartWithOptions( | 37 file_thread_.StartWithOptions( |
36 base::Thread::Options(MessageLoop::TYPE_IO, 0)); | 38 base::Thread::Options(MessageLoop::TYPE_IO, 0)); |
37 if (!started) | 39 if (!started) |
38 return false; | 40 return false; |
39 | 41 |
40 url_request_context_getter_ = new URLRequestContextGetter( | 42 url_request_context_getter_ = new URLRequestContextGetter( |
41 ui_message_loop_, io_thread_.message_loop(), | 43 ui_message_loop_, io_thread_.message_loop(), |
42 static_cast<MessageLoopForIO*>(file_thread_.message_loop())); | 44 static_cast<MessageLoopForIO*>(file_thread_.message_loop())); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 return file_thread_.message_loop_proxy(); | 77 return file_thread_.message_loop_proxy(); |
76 } | 78 } |
77 | 79 |
78 const scoped_refptr<net::URLRequestContextGetter>& | 80 const scoped_refptr<net::URLRequestContextGetter>& |
79 ChromotingHostContext::url_request_context_getter() { | 81 ChromotingHostContext::url_request_context_getter() { |
80 DCHECK(url_request_context_getter_.get()); | 82 DCHECK(url_request_context_getter_.get()); |
81 return url_request_context_getter_; | 83 return url_request_context_getter_; |
82 } | 84 } |
83 | 85 |
84 } // namespace remoting | 86 } // namespace remoting |
OLD | NEW |