Chromium Code Reviews| 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_CLIENT_CLIENT_CONTEXT_H_ | 5 #ifndef REMOTING_CLIENT_CLIENT_CONTEXT_H_ |
| 6 #define REMOTING_CLIENT_CLIENT_CONTEXT_H_ | 6 #define REMOTING_CLIENT_CLIENT_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 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 // A class that manages threads and running context for the chromoting client | 15 // A class that manages threads and running context for the chromoting client |
| 16 // process. | 16 // process. This class is not designed to be subclassed. |
| 17 class ClientContext { | 17 class ClientContext { |
| 18 public: | 18 public: |
| 19 ClientContext(); | 19 ClientContext(); |
| 20 virtual ~ClientContext(); | 20 ~ClientContext(); |
| 21 | 21 |
| 22 void Start(); | 22 void Start(); |
|
awong
2011/08/03 22:14:23
Add comment hat Start and Stop must be called from
| |
| 23 void Stop(); | 23 void Stop(); |
| 24 | 24 |
| 25 JingleThread* jingle_thread(); | 25 JingleThread* jingle_thread(); |
| 26 | 26 |
| 27 MessageLoop* main_message_loop(); | 27 MessageLoop* main_message_loop(); |
| 28 MessageLoop* decode_message_loop(); | 28 MessageLoop* decode_message_loop(); |
| 29 MessageLoop* network_message_loop(); | 29 MessageLoop* network_message_loop(); |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 // A thread that handles Jingle network operations (used in | 32 // A thread that handles Jingle network operations (used in |
| 33 // JingleHostConnection). | 33 // JingleHostConnection). |
| 34 JingleThread jingle_thread_; | 34 JingleThread jingle_thread_; |
| 35 | 35 |
| 36 // A thread that handles capture rate control and sending data to the | 36 // A thread that handles capture rate control and sending data to the |
| 37 // HostConnection. | 37 // HostConnection. |
| 38 base::Thread main_thread_; | 38 base::Thread main_thread_; |
| 39 | 39 |
| 40 // A thread that handles all decode operations. | 40 // A thread that handles all decode operations. |
| 41 base::Thread decode_thread_; | 41 base::Thread decode_thread_; |
| 42 | 42 |
| 43 // True if Start() was called on the context. | |
| 44 bool started_; | |
| 45 | |
| 43 DISALLOW_COPY_AND_ASSIGN(ClientContext); | 46 DISALLOW_COPY_AND_ASSIGN(ClientContext); |
| 44 }; | 47 }; |
| 45 | 48 |
| 46 } // namespace remoting | 49 } // namespace remoting |
| 47 | 50 |
| 48 #endif // REMOTING_CLIENT_CLIENT_CONTEXT_H_ | 51 #endif // REMOTING_CLIENT_CLIENT_CONTEXT_H_ |
| OLD | NEW |