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

Unified 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: Following chromium guidlines for pointers. 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 side-by-side diff with in-line comments
Download patch
Index: remoting/client/chromoting_client_runtime.h
diff --git a/remoting/client/chromoting_client_runtime.h b/remoting/client/chromoting_client_runtime.h
new file mode 100644
index 0000000000000000000000000000000000000000..87252788a0a64662a75a223fe9dfb61fd6b86052
--- /dev/null
+++ b/remoting/client/chromoting_client_runtime.h
@@ -0,0 +1,70 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_CLIENT_CHROMOTING_CLIENT_RUNTIME_H_
+#define REMOTING_CLIENT_CHROMOTING_CLIENT_RUNTIME_H_
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "net/url_request/url_request_context_getter.h"
+#include "remoting/base/auto_thread.h"
+
+namespace base {
+class MessageLoopForUI;
+} // namespace base
+
+// Houses the global resources on which the Chromoting components run
+// (e.g. message loops and task runners).
+namespace remoting {
+
+class ChromotingClientRuntime {
+ public:
+ static scoped_ptr<ChromotingClientRuntime> Create(
+ base::MessageLoopForUI *ui_loop);
+
+ ~ChromotingClientRuntime();
+
+ scoped_refptr<AutoThreadTaskRunner> network_task_runner() {
+ return network_task_runner_;
+ }
+
+ scoped_refptr<AutoThreadTaskRunner> ui_task_runner() {
+ return ui_task_runner_;
+ }
+
+ scoped_refptr<AutoThreadTaskRunner> display_task_runner() {
+ return display_task_runner_;
+ }
+
+ scoped_refptr<AutoThreadTaskRunner> file_task_runner() {
+ return file_task_runner_;
+ }
+
+ scoped_refptr<net::URLRequestContextGetter> url_requester() {
+ return url_requester_;
+ }
+
+ private:
+ ChromotingClientRuntime();
+ ChromotingClientRuntime(
+ scoped_refptr<AutoThreadTaskRunner> display_task_runner,
+ scoped_refptr<AutoThreadTaskRunner> network_task_runner,
+ scoped_refptr<AutoThreadTaskRunner> file_task_runner,
+ scoped_refptr<net::URLRequestContextGetter> url_requester);
+
+ // References to native threads.
+ scoped_refptr<AutoThreadTaskRunner> ui_task_runner_;
+
+ scoped_refptr<AutoThreadTaskRunner> display_task_runner_;
+ scoped_refptr<AutoThreadTaskRunner> network_task_runner_;
+ scoped_refptr<AutoThreadTaskRunner> file_task_runner_;
+
+ scoped_refptr<net::URLRequestContextGetter> url_requester_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromotingClientRuntime);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_CLIENT_CHROMOTING_CLIENT_RUNTIME_H_

Powered by Google App Engine
This is Rietveld 408576698