| 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..34e28e2061970fac5247ad47c57cabc88ea40f65
|
| --- /dev/null
|
| +++ b/remoting/client/chromoting_client_runtime.h
|
| @@ -0,0 +1,67 @@
|
| +// 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 "base/message_loop/message_loop.h"
|
| +#include "net/url_request/url_request_context_getter.h"
|
| +#include "remoting/base/auto_thread.h"
|
| +#include "remoting/client/chromoting_client_runtime.h"
|
| +
|
| +// 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();
|
| +
|
| + ~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();
|
| +
|
| + // Chromium code's connection to the app message loop. Once created the
|
| + // MessageLoop will live for the life of the program.
|
| + scoped_ptr<base::MessageLoopForUI> ui_loop_;
|
| +
|
| + // 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_
|
|
|