| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/message_loop_proxy.h" | |
| 11 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| 12 | 11 |
| 12 namespace base { |
| 13 class SingleThreadTaskRunner; |
| 14 } // namespace base |
| 15 |
| 13 namespace remoting { | 16 namespace remoting { |
| 14 | 17 |
| 15 // A class that manages threads and running context for the chromoting client | 18 // A class that manages threads and running context for the chromoting client |
| 16 // process. | 19 // process. |
| 17 class ClientContext { | 20 class ClientContext { |
| 18 public: | 21 public: |
| 19 ClientContext(base::MessageLoopProxy* main_message_loop_proxy); | 22 ClientContext(base::SingleThreadTaskRunner* main_task_runner); |
| 20 virtual ~ClientContext(); | 23 virtual ~ClientContext(); |
| 21 | 24 |
| 22 void Start(); | 25 void Start(); |
| 23 void Stop(); | 26 void Stop(); |
| 24 | 27 |
| 25 base::MessageLoopProxy* main_message_loop(); | 28 base::SingleThreadTaskRunner* main_task_runner(); |
| 26 base::MessageLoopProxy* decode_message_loop(); | 29 base::SingleThreadTaskRunner* decode_task_runner(); |
| 27 base::MessageLoopProxy* network_message_loop(); | |
| 28 | 30 |
| 29 private: | 31 private: |
| 30 scoped_refptr<base::MessageLoopProxy> main_message_loop_proxy_; | 32 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| 31 | 33 |
| 32 // A thread that handles all decode operations. | 34 // A thread that handles all decode operations. |
| 33 base::Thread decode_thread_; | 35 base::Thread decode_thread_; |
| 34 | 36 |
| 35 DISALLOW_COPY_AND_ASSIGN(ClientContext); | 37 DISALLOW_COPY_AND_ASSIGN(ClientContext); |
| 36 }; | 38 }; |
| 37 | 39 |
| 38 } // namespace remoting | 40 } // namespace remoting |
| 39 | 41 |
| 40 #endif // REMOTING_CLIENT_CLIENT_CONTEXT_H_ | 42 #endif // REMOTING_CLIENT_CLIENT_CONTEXT_H_ |
| OLD | NEW |