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/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "base/threading/platform_thread.h" | 11 #include "base/threading/platform_thread.h" |
12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "remoting/jingle_glue/jingle_thread.h" | 13 #include "remoting/jingle_glue/jingle_thread.h" |
14 | 14 |
15 namespace remoting { | 15 namespace remoting { |
16 | 16 |
17 // A class that manages threads and running context for the chromoting host | 17 // A class that manages threads and running context for the chromoting host |
18 // process. This class is virtual only for testing purposes (see below). | 18 // process. This class is virtual only for testing purposes (see below). |
19 class ChromotingHostContext { | 19 class ChromotingHostContext { |
20 public: | 20 public: |
21 // Create a context. | 21 // Create a context. |
22 explicit ChromotingHostContext(base::MessageLoopProxy* ui_message_loop); | 22 explicit ChromotingHostContext(base::MessageLoopProxy* ui_message_loop); |
23 virtual ~ChromotingHostContext(); | 23 virtual ~ChromotingHostContext(); |
24 | 24 |
25 // TODO(ajwong): Move the Start/Stop methods out of this class. Then | 25 // TODO(ajwong): Move the Start/Stop methods out of this class. Then |
26 // create a static factory for construction, and destruction. We | 26 // create a static factory for construction, and destruction. We |
27 // should be able to remove the need for virtual functions below with that | 27 // should be able to remove the need for virtual functions below with that |
28 // design, while preserving the relative simplicity of this API. | 28 // design, while preserving the relative simplicity of this API. |
29 virtual void Start(); | 29 virtual bool Start(); |
30 virtual void Stop(); | 30 virtual void Stop(); |
Wez
2012/03/02 22:59:48
Do we still need Stop() now that we're Stop()ing v
Sergey Ulanov
2012/03/05 06:53:36
Done.
| |
31 | 31 |
32 virtual JingleThread* jingle_thread(); | 32 virtual JingleThread* jingle_thread(); |
33 | 33 |
34 virtual base::MessageLoopProxy* ui_message_loop(); | 34 virtual base::MessageLoopProxy* ui_message_loop(); |
35 virtual MessageLoop* main_message_loop(); | 35 virtual MessageLoop* main_message_loop(); |
36 virtual MessageLoop* encode_message_loop(); | 36 virtual MessageLoop* encode_message_loop(); |
37 virtual base::MessageLoopProxy* network_message_loop(); | 37 virtual base::MessageLoopProxy* network_message_loop(); |
38 virtual MessageLoop* desktop_message_loop(); | 38 virtual MessageLoop* desktop_message_loop(); |
39 | 39 |
40 private: | 40 private: |
(...skipping 13 matching lines...) Expand all Loading... | |
54 base::Thread desktop_thread_; | 54 base::Thread desktop_thread_; |
55 | 55 |
56 scoped_refptr<base::MessageLoopProxy> ui_message_loop_; | 56 scoped_refptr<base::MessageLoopProxy> ui_message_loop_; |
57 | 57 |
58 DISALLOW_COPY_AND_ASSIGN(ChromotingHostContext); | 58 DISALLOW_COPY_AND_ASSIGN(ChromotingHostContext); |
59 }; | 59 }; |
60 | 60 |
61 } // namespace remoting | 61 } // namespace remoting |
62 | 62 |
63 #endif // REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_ | 63 #endif // REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_ |
OLD | NEW |