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

Side by Side Diff: remoting/host/chromoting_host_context.cc

Issue 9956148: Add file thread in MessageHostContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "remoting/jingle_glue/jingle_thread.h" 11 #include "remoting/jingle_glue/jingle_thread.h"
12 12
13 namespace remoting { 13 namespace remoting {
14 14
15 ChromotingHostContext::ChromotingHostContext( 15 ChromotingHostContext::ChromotingHostContext(
16 base::MessageLoopProxy* io_message_loop,
17 base::MessageLoopProxy* ui_message_loop) 16 base::MessageLoopProxy* ui_message_loop)
18 : main_thread_("ChromotingMainThread"), 17 : main_thread_("ChromotingMainThread"),
19 encode_thread_("ChromotingEncodeThread"), 18 encode_thread_("ChromotingEncodeThread"),
20 desktop_thread_("ChromotingDesktopThread"), 19 desktop_thread_("ChromotingDesktopThread"),
21 io_message_loop_(io_message_loop), 20 file_thread_("ChromotingFileIOThread"),
22 ui_message_loop_(ui_message_loop) { 21 ui_message_loop_(ui_message_loop) {
23 } 22 }
24 23
25 ChromotingHostContext::~ChromotingHostContext() { 24 ChromotingHostContext::~ChromotingHostContext() {
26 } 25 }
27 26
28 bool ChromotingHostContext::Start() { 27 bool ChromotingHostContext::Start() {
29 // Start all the threads. 28 // Start all the threads.
30 return main_thread_.Start() && encode_thread_.Start() && 29 return main_thread_.Start() && encode_thread_.Start() &&
31 jingle_thread_.Start() && desktop_thread_.Start(); 30 jingle_thread_.Start() && desktop_thread_.Start() &&
31 file_thread_.StartWithOptions(
32 base::Thread::Options(MessageLoop::TYPE_IO, 0));
32 } 33 }
33 34
34 JingleThread* ChromotingHostContext::jingle_thread() { 35 JingleThread* ChromotingHostContext::jingle_thread() {
35 return &jingle_thread_; 36 return &jingle_thread_;
36 } 37 }
37 38
38 base::MessageLoopProxy* ChromotingHostContext::io_message_loop() {
39 return io_message_loop_;
40 }
41
42 base::MessageLoopProxy* ChromotingHostContext::ui_message_loop() {
43 return ui_message_loop_;
44 }
45
46 MessageLoop* ChromotingHostContext::main_message_loop() { 39 MessageLoop* ChromotingHostContext::main_message_loop() {
47 return main_thread_.message_loop(); 40 return main_thread_.message_loop();
48 } 41 }
49 42
50 MessageLoop* ChromotingHostContext::encode_message_loop() { 43 MessageLoop* ChromotingHostContext::encode_message_loop() {
51 return encode_thread_.message_loop(); 44 return encode_thread_.message_loop();
52 } 45 }
53 46
54 base::MessageLoopProxy* ChromotingHostContext::network_message_loop() { 47 base::MessageLoopProxy* ChromotingHostContext::network_message_loop() {
55 return jingle_thread_.message_loop_proxy(); 48 return jingle_thread_.message_loop_proxy();
56 } 49 }
57 50
58 MessageLoop* ChromotingHostContext::desktop_message_loop() { 51 MessageLoop* ChromotingHostContext::desktop_message_loop() {
59 return desktop_thread_.message_loop(); 52 return desktop_thread_.message_loop();
60 } 53 }
61 54
55 base::MessageLoopProxy* ChromotingHostContext::ui_message_loop() {
56 return ui_message_loop_;
57 }
58
59 MessageLoop* ChromotingHostContext::file_message_loop() {
60 return file_thread_.message_loop();
61 }
62
62 } // namespace remoting 63 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698