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_CHROMOTING_JNI_INSTANCE_H_ | 5 #ifndef REMOTING_CLIENT_CHROMOTING_JNI_INSTANCE_H_ |
6 #define REMOTING_CLIENT_CHROMOTING_JNI_INSTANCE_H_ | 6 #define REMOTING_CLIENT_CHROMOTING_JNI_INSTANCE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 namespace remoting { | 24 namespace remoting { |
25 | 25 |
26 namespace protocol { | 26 namespace protocol { |
27 class ClipboardEvent; | 27 class ClipboardEvent; |
28 class CursorShapeInfo; | 28 class CursorShapeInfo; |
29 class PerformanceTracker; | 29 class PerformanceTracker; |
30 class VideoRenderer; | 30 class VideoRenderer; |
31 } // namespace protocol | 31 } // namespace protocol |
32 | 32 |
33 class ChromotingJniRuntime; | 33 class ChromotingJniRuntime; |
| 34 class JniClient; |
34 class JniFrameConsumer; | 35 class JniFrameConsumer; |
35 | 36 |
36 // ClientUserInterface that indirectly makes and receives JNI calls. | 37 // ClientUserInterface that indirectly makes and receives JNI calls. |
37 class ChromotingJniInstance | 38 class ChromotingJniInstance |
38 : public ClientUserInterface, | 39 : public ClientUserInterface, |
39 public protocol::ClipboardStub, | 40 public protocol::ClipboardStub, |
40 public protocol::CursorShapeStub, | 41 public protocol::CursorShapeStub, |
41 public base::RefCountedThreadSafe<ChromotingJniInstance> { | 42 public base::RefCountedThreadSafe<ChromotingJniInstance> { |
42 public: | 43 public: |
43 // Initiates a connection with the specified host. Call from the UI thread. | 44 // Initiates a connection with the specified host. Call from the UI thread. |
44 // The instance does not take ownership of |jni_runtime|. To connect with an | 45 // The instance does not take ownership of |jni_runtime|. To connect with an |
45 // unpaired host, pass in |pairing_id| and |pairing_secret| as empty strings. | 46 // unpaired host, pass in |pairing_id| and |pairing_secret| as empty strings. |
46 ChromotingJniInstance(ChromotingJniRuntime* jni_runtime, | 47 ChromotingJniInstance(ChromotingJniRuntime* jni_runtime, |
| 48 JniClient* jni_client, |
47 const std::string& username, | 49 const std::string& username, |
48 const std::string& auth_token, | 50 const std::string& auth_token, |
49 const std::string& host_jid, | 51 const std::string& host_jid, |
50 const std::string& host_id, | 52 const std::string& host_id, |
51 const std::string& host_pubkey, | 53 const std::string& host_pubkey, |
52 const std::string& pairing_id, | 54 const std::string& pairing_id, |
53 const std::string& pairing_secret, | 55 const std::string& pairing_secret, |
54 const std::string& capabilities, | 56 const std::string& capabilities, |
55 const std::string& flags); | 57 const std::string& flags); |
56 | 58 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 void EnableStatsLogging(bool enabled); | 146 void EnableStatsLogging(bool enabled); |
145 | 147 |
146 // If logging is enabled, logs the current connection statistics, and | 148 // If logging is enabled, logs the current connection statistics, and |
147 // triggers another call to this function after the logging time interval. | 149 // triggers another call to this function after the logging time interval. |
148 // Called on the network thread. | 150 // Called on the network thread. |
149 void LogPerfStats(); | 151 void LogPerfStats(); |
150 | 152 |
151 // Used to obtain task runner references and make calls to Java methods. | 153 // Used to obtain task runner references and make calls to Java methods. |
152 ChromotingJniRuntime* jni_runtime_; | 154 ChromotingJniRuntime* jni_runtime_; |
153 | 155 |
| 156 JniClient* jni_client_; |
| 157 |
154 // ID of the host we are connecting to. | 158 // ID of the host we are connecting to. |
155 std::string host_jid_; | 159 std::string host_jid_; |
156 | 160 |
157 protocol::ClientAuthenticationConfig client_auth_config_; | 161 protocol::ClientAuthenticationConfig client_auth_config_; |
158 | 162 |
159 std::string flags_; | 163 std::string flags_; |
160 | 164 |
161 // This group of variables is to be used on the network thread. | 165 // This group of variables is to be used on the network thread. |
162 std::unique_ptr<ClientContext> client_context_; | 166 std::unique_ptr<ClientContext> client_context_; |
163 std::unique_ptr<protocol::PerformanceTracker> perf_tracker_; | 167 std::unique_ptr<protocol::PerformanceTracker> perf_tracker_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 friend class base::RefCountedThreadSafe<ChromotingJniInstance>; | 202 friend class base::RefCountedThreadSafe<ChromotingJniInstance>; |
199 | 203 |
200 base::WeakPtrFactory<ChromotingJniInstance> weak_factory_; | 204 base::WeakPtrFactory<ChromotingJniInstance> weak_factory_; |
201 | 205 |
202 DISALLOW_COPY_AND_ASSIGN(ChromotingJniInstance); | 206 DISALLOW_COPY_AND_ASSIGN(ChromotingJniInstance); |
203 }; | 207 }; |
204 | 208 |
205 } // namespace remoting | 209 } // namespace remoting |
206 | 210 |
207 #endif | 211 #endif |
OLD | NEW |