| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 void EnableStatsLogging(bool enabled); | 143 void EnableStatsLogging(bool enabled); |
| 142 | 144 |
| 143 // If logging is enabled, logs the current connection statistics, and | 145 // If logging is enabled, logs the current connection statistics, and |
| 144 // triggers another call to this function after the logging time interval. | 146 // triggers another call to this function after the logging time interval. |
| 145 // Called on the network thread. | 147 // Called on the network thread. |
| 146 void LogPerfStats(); | 148 void LogPerfStats(); |
| 147 | 149 |
| 148 // Used to obtain task runner references and make calls to Java methods. | 150 // Used to obtain task runner references and make calls to Java methods. |
| 149 ChromotingJniRuntime* jni_runtime_; | 151 ChromotingJniRuntime* jni_runtime_; |
| 150 | 152 |
| 153 JniClient* jni_client_; |
| 154 |
| 151 // ID of the host we are connecting to. | 155 // ID of the host we are connecting to. |
| 152 std::string host_jid_; | 156 std::string host_jid_; |
| 153 | 157 |
| 154 protocol::ClientAuthenticationConfig client_auth_config_; | 158 protocol::ClientAuthenticationConfig client_auth_config_; |
| 155 | 159 |
| 156 std::string flags_; | 160 std::string flags_; |
| 157 | 161 |
| 158 // This group of variables is to be used on the network thread. | 162 // This group of variables is to be used on the network thread. |
| 159 std::unique_ptr<ClientContext> client_context_; | 163 std::unique_ptr<ClientContext> client_context_; |
| 160 std::unique_ptr<protocol::PerformanceTracker> perf_tracker_; | 164 std::unique_ptr<protocol::PerformanceTracker> perf_tracker_; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 friend class base::RefCountedThreadSafe<ChromotingJniInstance>; | 199 friend class base::RefCountedThreadSafe<ChromotingJniInstance>; |
| 196 | 200 |
| 197 base::WeakPtrFactory<ChromotingJniInstance> weak_factory_; | 201 base::WeakPtrFactory<ChromotingJniInstance> weak_factory_; |
| 198 | 202 |
| 199 DISALLOW_COPY_AND_ASSIGN(ChromotingJniInstance); | 203 DISALLOW_COPY_AND_ASSIGN(ChromotingJniInstance); |
| 200 }; | 204 }; |
| 201 | 205 |
| 202 } // namespace remoting | 206 } // namespace remoting |
| 203 | 207 |
| 204 #endif | 208 #endif |
| OLD | NEW |