| 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 "net/url_request/url_request_context_getter.h" |
| 11 #include "remoting/base/auto_thread.h" |
| 12 |
| 13 namespace base { |
| 14 class MessageLoopForUI; |
| 15 } // namespace base |
| 16 |
| 17 // Houses the global resources on which the Chromoting components run |
| 18 // (e.g. message loops and task runners). |
| 19 namespace remoting { |
| 20 |
| 21 class ChromotingClientRuntime { |
| 22 public: |
| 23 static scoped_ptr<ChromotingClientRuntime> Create( |
| 24 base::MessageLoopForUI *ui_loop); |
| 25 |
| 26 ~ChromotingClientRuntime(); |
| 27 |
| 28 scoped_refptr<AutoThreadTaskRunner> network_task_runner() { |
| 29 return network_task_runner_; |
| 30 } |
| 31 |
| 32 scoped_refptr<AutoThreadTaskRunner> ui_task_runner() { |
| 33 return ui_task_runner_; |
| 34 } |
| 35 |
| 36 scoped_refptr<AutoThreadTaskRunner> display_task_runner() { |
| 37 return display_task_runner_; |
| 38 } |
| 39 |
| 40 scoped_refptr<AutoThreadTaskRunner> file_task_runner() { |
| 41 return file_task_runner_; |
| 42 } |
| 43 |
| 44 scoped_refptr<net::URLRequestContextGetter> url_requester() { |
| 45 return url_requester_; |
| 46 } |
| 47 |
| 48 private: |
| 49 ChromotingClientRuntime(); |
| 50 ChromotingClientRuntime( |
| 51 scoped_refptr<AutoThreadTaskRunner> display_task_runner, |
| 52 scoped_refptr<AutoThreadTaskRunner> network_task_runner, |
| 53 scoped_refptr<AutoThreadTaskRunner> file_task_runner, |
| 54 scoped_refptr<net::URLRequestContextGetter> url_requester); |
| 55 |
| 56 // References to native threads. |
| 57 scoped_refptr<AutoThreadTaskRunner> ui_task_runner_; |
| 58 |
| 59 scoped_refptr<AutoThreadTaskRunner> display_task_runner_; |
| 60 scoped_refptr<AutoThreadTaskRunner> network_task_runner_; |
| 61 scoped_refptr<AutoThreadTaskRunner> file_task_runner_; |
| 62 |
| 63 scoped_refptr<net::URLRequestContextGetter> url_requester_; |
| 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(ChromotingClientRuntime); |
| 66 }; |
| 67 |
| 68 } // namespace remoting |
| 69 |
| 70 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_RUNTIME_H_ |
| OLD | NEW |