Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(601)

Side by Side Diff: remoting/client/chromoting_client_runtime.h

Issue 1821623003: Revert of Adding container class for chromoting client runtimes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/client/BUILD.gn ('k') | remoting/client/chromoting_client_runtime.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 // Caller to create is responsible for creating and attaching a new ui thread
24 // for use. Example:
25 //
26 // On Android, the UI thread is managed by Java, so we need to attach and
27 // start a special type of message loop to allow Chromium code to run tasks.
28 //
29 // base::MessageLoopForUI *ui_loop = new base::MessageLoopForUI();
30 // ui_loop_->Start();
31 // scoped_ptr<ChromotingClientRuntime> runtime =
32 // ChromotingClientRuntime::Create(ui_loop);
33 //
34 // On iOS we created a new message loop and now attach it.
35 //
36 // base::MessageLoopForUI *ui_loop = new base::MessageLoopForUI();
37 // ui_loop_->Attach();
38 // scoped_ptr<ChromotingClientRuntime> runtime =
39 // ChromotingClientRuntime::Create(ui_loop);
40 //
41 static scoped_ptr<ChromotingClientRuntime> Create(
42 base::MessageLoopForUI* ui_loop);
43
44 ~ChromotingClientRuntime();
45
46 scoped_refptr<AutoThreadTaskRunner> network_task_runner() {
47 return network_task_runner_;
48 }
49
50 scoped_refptr<AutoThreadTaskRunner> ui_task_runner() {
51 return ui_task_runner_;
52 }
53
54 scoped_refptr<AutoThreadTaskRunner> display_task_runner() {
55 return display_task_runner_;
56 }
57
58 scoped_refptr<AutoThreadTaskRunner> file_task_runner() {
59 return file_task_runner_;
60 }
61
62 scoped_refptr<net::URLRequestContextGetter> url_requester() {
63 return url_requester_;
64 }
65
66 private:
67 ChromotingClientRuntime();
68 ChromotingClientRuntime(
69 scoped_refptr<AutoThreadTaskRunner> display_task_runner,
70 scoped_refptr<AutoThreadTaskRunner> network_task_runner,
71 scoped_refptr<AutoThreadTaskRunner> file_task_runner,
72 scoped_refptr<net::URLRequestContextGetter> url_requester);
73
74 // References to native threads.
75 scoped_refptr<AutoThreadTaskRunner> ui_task_runner_;
76
77 scoped_refptr<AutoThreadTaskRunner> display_task_runner_;
78 scoped_refptr<AutoThreadTaskRunner> network_task_runner_;
79 scoped_refptr<AutoThreadTaskRunner> file_task_runner_;
80
81 scoped_refptr<net::URLRequestContextGetter> url_requester_;
82
83 DISALLOW_COPY_AND_ASSIGN(ChromotingClientRuntime);
84 };
85
86 } // namespace remoting
87
88 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_RUNTIME_H_
OLDNEW
« no previous file with comments | « remoting/client/BUILD.gn ('k') | remoting/client/chromoting_client_runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698