| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "remoting/client/jni/jni_client.h" | 5 #include "remoting/client/jni/jni_client.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "jni/Client_jni.h" | 10 #include "jni/Client_jni.h" |
| 11 #include "remoting/client/jni/chromoting_jni_instance.h" | 11 #include "remoting/client/jni/chromoting_jni_instance.h" |
| 12 #include "remoting/client/jni/chromoting_jni_runtime.h" | 12 #include "remoting/client/jni/chromoting_jni_runtime.h" |
| 13 #include "remoting/client/jni/display_updater_factory.h" | |
| 14 #include "remoting/client/jni/jni_gl_display_handler.h" | 13 #include "remoting/client/jni/jni_gl_display_handler.h" |
| 15 #include "remoting/client/jni/jni_pairing_secret_fetcher.h" | 14 #include "remoting/client/jni/jni_pairing_secret_fetcher.h" |
| 16 #include "remoting/client/jni/jni_touch_event_data.h" | 15 #include "remoting/client/jni/jni_touch_event_data.h" |
| 17 #include "remoting/protocol/video_renderer.h" | 16 #include "remoting/protocol/video_renderer.h" |
| 18 | 17 |
| 19 using base::android::ConvertJavaStringToUTF8; | 18 using base::android::ConvertJavaStringToUTF8; |
| 20 using base::android::ConvertUTF8ToJavaString; | 19 using base::android::ConvertUTF8ToJavaString; |
| 21 using base::android::JavaParamRef; | 20 using base::android::JavaParamRef; |
| 22 using base::android::ScopedJavaLocalRef; | 21 using base::android::ScopedJavaLocalRef; |
| 23 | 22 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 DCHECK(runtime_->ui_task_runner()->BelongsToCurrentThread()); | 66 DCHECK(runtime_->ui_task_runner()->BelongsToCurrentThread()); |
| 68 if (session_) { | 67 if (session_) { |
| 69 session_->Disconnect(); | 68 session_->Disconnect(); |
| 70 runtime_->network_task_runner()->DeleteSoon(FROM_HERE, | 69 runtime_->network_task_runner()->DeleteSoon(FROM_HERE, |
| 71 session_.release()); | 70 session_.release()); |
| 72 } | 71 } |
| 73 if (secret_fetcher_) { | 72 if (secret_fetcher_) { |
| 74 runtime_->network_task_runner()->DeleteSoon(FROM_HERE, | 73 runtime_->network_task_runner()->DeleteSoon(FROM_HERE, |
| 75 secret_fetcher_.release()); | 74 secret_fetcher_.release()); |
| 76 } | 75 } |
| 77 if (display_handler_) { | 76 display_handler_.reset(); |
| 78 runtime_->display_task_runner()->DeleteSoon(FROM_HERE, | |
| 79 display_handler_.release()); | |
| 80 } | |
| 81 } | 77 } |
| 82 | 78 |
| 83 void JniClient::OnConnectionState(protocol::ConnectionToHost::State state, | 79 void JniClient::OnConnectionState(protocol::ConnectionToHost::State state, |
| 84 protocol::ErrorCode error) { | 80 protocol::ErrorCode error) { |
| 85 DCHECK(runtime_->ui_task_runner()->BelongsToCurrentThread()); | 81 DCHECK(runtime_->ui_task_runner()->BelongsToCurrentThread()); |
| 86 | 82 |
| 87 JNIEnv* env = base::android::AttachCurrentThread(); | 83 JNIEnv* env = base::android::AttachCurrentThread(); |
| 88 Java_Client_onConnectionState(env, java_client_, state, error); | 84 Java_Client_onConnectionState(env, java_client_, state, error); |
| 89 } | 85 } |
| 90 | 86 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 return weak_ptr_; | 289 return weak_ptr_; |
| 294 } | 290 } |
| 295 | 291 |
| 296 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& caller) { | 292 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& caller) { |
| 297 return reinterpret_cast<intptr_t>( | 293 return reinterpret_cast<intptr_t>( |
| 298 new JniClient(ChromotingJniRuntime::GetInstance(), | 294 new JniClient(ChromotingJniRuntime::GetInstance(), |
| 299 base::android::ScopedJavaGlobalRef<jobject>(env, caller))); | 295 base::android::ScopedJavaGlobalRef<jobject>(env, caller))); |
| 300 } | 296 } |
| 301 | 297 |
| 302 } // namespace remoting | 298 } // namespace remoting |
| OLD | NEW |