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

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

Issue 1764503002: Adding container class for chromoting client runtimes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaning up the unit test. 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
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 "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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698