OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_CLIENT_JNI_CHROMOTING_JNI_RUNTIME_H_ | 5 #ifndef REMOTING_CLIENT_JNI_CHROMOTING_JNI_RUNTIME_H_ |
6 #define REMOTING_CLIENT_JNI_CHROMOTING_JNI_RUNTIME_H_ | 6 #define REMOTING_CLIENT_JNI_CHROMOTING_JNI_RUNTIME_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
12 #include "net/url_request/url_request_context_getter.h" | 12 #include "net/url_request/url_request_context_getter.h" |
13 #include "remoting/base/auto_thread.h" | 13 #include "remoting/base/auto_thread.h" |
14 #include "remoting/client/jni/chromoting_jni_instance.h" | 14 #include "remoting/client/jni/chromoting_jni_instance.h" |
15 #include "remoting/protocol/connection_to_host.h" | 15 #include "remoting/protocol/connection_to_host.h" |
16 | 16 |
| 17 namespace base { |
17 template<typename T> struct DefaultSingletonTraits; | 18 template<typename T> struct DefaultSingletonTraits; |
| 19 } |
18 | 20 |
19 namespace remoting { | 21 namespace remoting { |
20 | 22 |
21 bool RegisterChromotingJniRuntime(JNIEnv* env); | 23 bool RegisterChromotingJniRuntime(JNIEnv* env); |
22 | 24 |
23 // Houses the global resources on which the Chromoting components run | 25 // Houses the global resources on which the Chromoting components run |
24 // (e.g. message loops and task runners). Proxies outgoing JNI calls from its | 26 // (e.g. message loops and task runners). Proxies outgoing JNI calls from its |
25 // ChromotingJniInstance member to Java. All its methods should be invoked | 27 // ChromotingJniInstance member to Java. All its methods should be invoked |
26 // exclusively from the UI thread unless otherwise noted. | 28 // exclusively from the UI thread unless otherwise noted. |
27 class ChromotingJniRuntime { | 29 class ChromotingJniRuntime { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // References to native threads. | 130 // References to native threads. |
129 scoped_refptr<AutoThreadTaskRunner> ui_task_runner_; | 131 scoped_refptr<AutoThreadTaskRunner> ui_task_runner_; |
130 scoped_refptr<AutoThreadTaskRunner> network_task_runner_; | 132 scoped_refptr<AutoThreadTaskRunner> network_task_runner_; |
131 scoped_refptr<AutoThreadTaskRunner> display_task_runner_; | 133 scoped_refptr<AutoThreadTaskRunner> display_task_runner_; |
132 | 134 |
133 scoped_refptr<net::URLRequestContextGetter> url_requester_; | 135 scoped_refptr<net::URLRequestContextGetter> url_requester_; |
134 | 136 |
135 // Contains all connection-specific state. | 137 // Contains all connection-specific state. |
136 scoped_refptr<ChromotingJniInstance> session_; | 138 scoped_refptr<ChromotingJniInstance> session_; |
137 | 139 |
138 friend struct DefaultSingletonTraits<ChromotingJniRuntime>; | 140 friend struct base::DefaultSingletonTraits<ChromotingJniRuntime>; |
139 | 141 |
140 DISALLOW_COPY_AND_ASSIGN(ChromotingJniRuntime); | 142 DISALLOW_COPY_AND_ASSIGN(ChromotingJniRuntime); |
141 }; | 143 }; |
142 | 144 |
143 } // namespace remoting | 145 } // namespace remoting |
144 | 146 |
145 #endif | 147 #endif |
OLD | NEW |