| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/thread.h" | 11 #include "base/thread.h" |
| 12 #include "remoting/jingle_glue/jingle_thread.h" | 12 #include "remoting/jingle_glue/jingle_thread.h" |
| 13 | 13 |
| 14 namespace remoting { | 14 namespace remoting { |
| 15 | 15 |
| 16 // A class that manages threads and running context for the chromoting host | 16 // A class that manages threads and running context for the chromoting host |
| 17 // process. | 17 // process. |
| 18 class ChromotingHostContext { | 18 class ChromotingHostContext { |
| 19 public: | 19 public: |
| 20 ChromotingHostContext(); | 20 ChromotingHostContext(); |
| 21 virtual ~ChromotingHostContext(); | 21 virtual ~ChromotingHostContext(); |
| 22 | 22 |
| 23 // TODO(ajwong): Move the Start/Stop methods out of this class. Then |
| 24 // create a static factory for construction, and destruction. We |
| 25 // should be able to remove the need for virtual functions below with that |
| 26 // design, while preserving the relative simplicity of this API. |
| 23 virtual void Start(); | 27 virtual void Start(); |
| 24 virtual void Stop(); | 28 virtual void Stop(); |
| 25 | 29 |
| 26 virtual JingleThread* jingle_thread(); | 30 virtual JingleThread* jingle_thread(); |
| 27 virtual MessageLoop* main_message_loop(); | 31 virtual MessageLoop* main_message_loop(); |
| 28 virtual MessageLoop* capture_message_loop(); | 32 virtual MessageLoop* capture_message_loop(); |
| 29 virtual MessageLoop* encode_message_loop(); | 33 virtual MessageLoop* encode_message_loop(); |
| 30 | 34 |
| 31 private: | 35 private: |
| 32 FRIEND_TEST_ALL_PREFIXES(ChromotingHostContextTest, StartAndStop); | 36 FRIEND_TEST_ALL_PREFIXES(ChromotingHostContextTest, StartAndStop); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 44 base::Thread encode_thread_; | 48 base::Thread encode_thread_; |
| 45 | 49 |
| 46 DISALLOW_COPY_AND_ASSIGN(ChromotingHostContext); | 50 DISALLOW_COPY_AND_ASSIGN(ChromotingHostContext); |
| 47 }; | 51 }; |
| 48 | 52 |
| 49 } // namespace remoting | 53 } // namespace remoting |
| 50 | 54 |
| 51 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::ChromotingHostContext); | 55 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::ChromotingHostContext); |
| 52 | 56 |
| 53 #endif // REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_ | 57 #endif // REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_ |
| OLD | NEW |