Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef REMOTING_CLIENT_CHROMOTING_CLIENT_RUNTIME_H_ | |
| 6 #define REMOTING_CLIENT_CHROMOTING_CLIENT_RUNTIME_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/message_loop/message_loop.h" | |
|
Sergey Ulanov
2016/03/11 01:22:34
Don't need to include this here. Just forward-decl
nicholss
2016/03/11 21:23:02
Done.
| |
| 11 #include "net/url_request/url_request_context_getter.h" | |
| 12 #include "remoting/base/auto_thread.h" | |
|
Sergey Ulanov
2016/03/11 01:22:34
forward-declare AutoThreadTaskRunner
| |
| 13 #include "remoting/client/chromoting_client_runtime.h" | |
| 14 | |
| 15 // Houses the global resources on which the Chromoting components run | |
| 16 // (e.g. message loops and task runners). | |
| 17 namespace remoting { | |
| 18 | |
| 19 class ChromotingClientRuntime { | |
| 20 public: | |
| 21 | |
| 22 static scoped_ptr<ChromotingClientRuntime> Create(); | |
| 23 | |
| 24 ~ChromotingClientRuntime(); | |
| 25 | |
| 26 scoped_refptr<AutoThreadTaskRunner> network_task_runner() { | |
| 27 return network_task_runner_; | |
| 28 } | |
| 29 | |
| 30 scoped_refptr<AutoThreadTaskRunner> ui_task_runner() { | |
| 31 return ui_task_runner_; | |
| 32 } | |
| 33 | |
| 34 scoped_refptr<AutoThreadTaskRunner> display_task_runner() { | |
| 35 return display_task_runner_; | |
| 36 } | |
| 37 | |
| 38 scoped_refptr<AutoThreadTaskRunner> file_task_runner() { | |
| 39 return file_task_runner_; | |
| 40 } | |
| 41 | |
| 42 scoped_refptr<net::URLRequestContextGetter> url_requester() { | |
| 43 return url_requester_; | |
| 44 } | |
| 45 | |
| 46 private: | |
| 47 ChromotingClientRuntime(); | |
| 48 | |
| 49 // Chromium code's connection to the app message loop. Once created the | |
| 50 // MessageLoop will live for the life of the program. | |
| 51 scoped_ptr<base::MessageLoopForUI> ui_loop_; | |
| 52 | |
| 53 // References to native threads. | |
| 54 scoped_refptr<AutoThreadTaskRunner> ui_task_runner_; | |
| 55 | |
| 56 scoped_refptr<AutoThreadTaskRunner> display_task_runner_; | |
| 57 scoped_refptr<AutoThreadTaskRunner> network_task_runner_; | |
| 58 scoped_refptr<AutoThreadTaskRunner> file_task_runner_; | |
| 59 | |
| 60 scoped_refptr<net::URLRequestContextGetter> url_requester_; | |
| 61 | |
| 62 DISALLOW_COPY_AND_ASSIGN(ChromotingClientRuntime); | |
| 63 }; | |
| 64 | |
| 65 } // namespace remoting | |
| 66 | |
| 67 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_RUNTIME_H_ | |
| OLD | NEW |