| 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" |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/threading/platform_thread.h" | 12 #include "base/threading/platform_thread.h" |
| 13 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
| 14 #include "remoting/jingle_glue/jingle_thread.h" | 14 #include "remoting/jingle_glue/jingle_thread.h" |
| 15 | 15 |
| 16 class Task; | |
| 17 | |
| 18 namespace tracked_objects { | |
| 19 class Location; | |
| 20 } | |
| 21 | |
| 22 namespace remoting { | 16 namespace remoting { |
| 23 | 17 |
| 24 // A class that manages threads and running context for the chromoting host | 18 // A class that manages threads and running context for the chromoting host |
| 25 // process. This class is virtual only for testing purposes (see below). | 19 // process. This class is virtual only for testing purposes (see below). |
| 26 class ChromotingHostContext { | 20 class ChromotingHostContext { |
| 27 public: | 21 public: |
| 28 // Create a context. | 22 // Create a context. |
| 29 ChromotingHostContext(base::MessageLoopProxy* ui_message_loop); | 23 explicit ChromotingHostContext(base::MessageLoopProxy* ui_message_loop); |
| 30 virtual ~ChromotingHostContext(); | 24 virtual ~ChromotingHostContext(); |
| 31 | 25 |
| 32 // TODO(ajwong): Move the Start/Stop methods out of this class. Then | 26 // TODO(ajwong): Move the Start/Stop methods out of this class. Then |
| 33 // create a static factory for construction, and destruction. We | 27 // create a static factory for construction, and destruction. We |
| 34 // should be able to remove the need for virtual functions below with that | 28 // should be able to remove the need for virtual functions below with that |
| 35 // design, while preserving the relative simplicity of this API. | 29 // design, while preserving the relative simplicity of this API. |
| 36 virtual void Start(); | 30 virtual void Start(); |
| 37 virtual void Stop(); | 31 virtual void Stop(); |
| 38 | 32 |
| 39 virtual JingleThread* jingle_thread(); | 33 virtual JingleThread* jingle_thread(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 61 base::Thread desktop_thread_; | 55 base::Thread desktop_thread_; |
| 62 | 56 |
| 63 scoped_refptr<base::MessageLoopProxy> ui_message_loop_; | 57 scoped_refptr<base::MessageLoopProxy> ui_message_loop_; |
| 64 | 58 |
| 65 DISALLOW_COPY_AND_ASSIGN(ChromotingHostContext); | 59 DISALLOW_COPY_AND_ASSIGN(ChromotingHostContext); |
| 66 }; | 60 }; |
| 67 | 61 |
| 68 } // namespace remoting | 62 } // namespace remoting |
| 69 | 63 |
| 70 #endif // REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_ | 64 #endif // REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_ |
| OLD | NEW |