| 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" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 if (session_) { | 68 if (session_) { |
| 69 session_->Disconnect(); | 69 session_->Disconnect(); |
| 70 runtime_->network_task_runner()->DeleteSoon(FROM_HERE, | 70 runtime_->network_task_runner()->DeleteSoon(FROM_HERE, |
| 71 session_.release()); | 71 session_.release()); |
| 72 } | 72 } |
| 73 if (secret_fetcher_) { | 73 if (secret_fetcher_) { |
| 74 runtime_->network_task_runner()->DeleteSoon(FROM_HERE, | 74 runtime_->network_task_runner()->DeleteSoon(FROM_HERE, |
| 75 secret_fetcher_.release()); | 75 secret_fetcher_.release()); |
| 76 } | 76 } |
| 77 if (display_handler_) { | 77 if (display_handler_) { |
| 78 runtime_->display_task_runner()->DeleteSoon(FROM_HERE, | 78 display_handler_.release()->Destroy(); |
| 79 display_handler_.release()); | |
| 80 } | 79 } |
| 81 } | 80 } |
| 82 | 81 |
| 83 void JniClient::OnConnectionState(protocol::ConnectionToHost::State state, | 82 void JniClient::OnConnectionState(protocol::ConnectionToHost::State state, |
| 84 protocol::ErrorCode error) { | 83 protocol::ErrorCode error) { |
| 85 DCHECK(runtime_->ui_task_runner()->BelongsToCurrentThread()); | 84 DCHECK(runtime_->ui_task_runner()->BelongsToCurrentThread()); |
| 86 | 85 |
| 87 JNIEnv* env = base::android::AttachCurrentThread(); | 86 JNIEnv* env = base::android::AttachCurrentThread(); |
| 88 Java_Client_onConnectionState(env, java_client_, state, error); | 87 Java_Client_onConnectionState(env, java_client_, state, error); |
| 89 } | 88 } |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 return weak_ptr_; | 292 return weak_ptr_; |
| 294 } | 293 } |
| 295 | 294 |
| 296 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& caller) { | 295 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& caller) { |
| 297 return reinterpret_cast<intptr_t>( | 296 return reinterpret_cast<intptr_t>( |
| 298 new JniClient(ChromotingJniRuntime::GetInstance(), | 297 new JniClient(ChromotingJniRuntime::GetInstance(), |
| 299 base::android::ScopedJavaGlobalRef<jobject>(env, caller))); | 298 base::android::ScopedJavaGlobalRef<jobject>(env, caller))); |
| 300 } | 299 } |
| 301 | 300 |
| 302 } // namespace remoting | 301 } // namespace remoting |
| OLD | NEW |