OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_ | 5 #ifndef REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_ |
6 #define REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_ | 6 #define REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 // create a static factory for construction, and destruction. We | 37 // create a static factory for construction, and destruction. We |
38 // should be able to remove the need for virtual functions below with that | 38 // should be able to remove the need for virtual functions below with that |
39 // design, while preserving the relative simplicity of this API. | 39 // design, while preserving the relative simplicity of this API. |
40 virtual void Start(); | 40 virtual void Start(); |
41 virtual void Stop(); | 41 virtual void Stop(); |
42 | 42 |
43 virtual JingleThread* jingle_thread(); | 43 virtual JingleThread* jingle_thread(); |
44 | 44 |
45 virtual MessageLoop* main_message_loop(); | 45 virtual MessageLoop* main_message_loop(); |
46 virtual MessageLoop* encode_message_loop(); | 46 virtual MessageLoop* encode_message_loop(); |
47 virtual MessageLoop* network_message_loop(); | 47 virtual base::MessageLoopProxy* network_message_loop(); |
48 virtual MessageLoop* desktop_message_loop(); | 48 virtual MessageLoop* desktop_message_loop(); |
49 | 49 |
50 // Must be called from the main GUI thread. | 50 // Must be called from the main GUI thread. |
51 void SetUITaskPostFunction(const UIThreadPostTaskFunction& poster); | 51 void SetUITaskPostFunction(const UIThreadPostTaskFunction& poster); |
52 | 52 |
53 void PostTaskToUIThread(const tracked_objects::Location& from_here, | 53 void PostTaskToUIThread(const tracked_objects::Location& from_here, |
54 const base::Closure& task); | 54 const base::Closure& task); |
55 void PostDelayedTaskToUIThread(const tracked_objects::Location& from_here, | 55 void PostDelayedTaskToUIThread(const tracked_objects::Location& from_here, |
56 const base::Closure& task, | 56 const base::Closure& task, |
57 int delay_ms); | 57 int delay_ms); |
58 bool IsUIThread() const; | 58 bool IsUIThread() const; |
59 | 59 |
60 private: | 60 private: |
61 FRIEND_TEST_ALL_PREFIXES(ChromotingHostContextTest, StartAndStop); | 61 FRIEND_TEST_ALL_PREFIXES(ChromotingHostContextTest, StartAndStop); |
62 | 62 |
63 // A thread that hosts all network operations. | 63 // A thread that hosts all network operations. |
64 JingleThread jingle_thread_; | 64 JingleThread jingle_thread_; |
| 65 scoped_refptr<base::MessageLoopProxy> network_message_loop_; |
65 | 66 |
66 // A thread that hosts ChromotingHost and performs rate control. | 67 // A thread that hosts ChromotingHost and performs rate control. |
67 base::Thread main_thread_; | 68 base::Thread main_thread_; |
68 | 69 |
69 // A thread that hosts all encode operations. | 70 // A thread that hosts all encode operations. |
70 base::Thread encode_thread_; | 71 base::Thread encode_thread_; |
71 | 72 |
72 // A thread that hosts desktop integration (capture, input injection, etc) | 73 // A thread that hosts desktop integration (capture, input injection, etc) |
73 // This is NOT a Chrome-style UI thread. | 74 // This is NOT a Chrome-style UI thread. |
74 base::Thread desktop_thread_; | 75 base::Thread desktop_thread_; |
75 | 76 |
76 UIThreadPostTaskFunction ui_poster_; | 77 UIThreadPostTaskFunction ui_poster_; |
77 // This IS the main Chrome GUI thread that |ui_poster_| will post to. | 78 // This IS the main Chrome GUI thread that |ui_poster_| will post to. |
78 base::PlatformThreadId ui_main_thread_id_; | 79 base::PlatformThreadId ui_main_thread_id_; |
79 | 80 |
80 | 81 |
81 DISALLOW_COPY_AND_ASSIGN(ChromotingHostContext); | 82 DISALLOW_COPY_AND_ASSIGN(ChromotingHostContext); |
82 }; | 83 }; |
83 | 84 |
84 } // namespace remoting | 85 } // namespace remoting |
85 | 86 |
86 #endif // REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_ | 87 #endif // REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_ |
OLD | NEW |