Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: remoting/client/jni/jni_client.cc

Issue 2046663002: [Remoting Android] Releases |secret_fetcher_| in DisconnectFromHost() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 session_.reset(new ChromotingJniInstance( 53 session_.reset(new ChromotingJniInstance(
54 runtime_, GetWeakPtr(), display_handler_, 54 runtime_, GetWeakPtr(), display_handler_,
55 secret_fetcher_->GetWeakPtr(), username, auth_token, host_jid, host_id, 55 secret_fetcher_->GetWeakPtr(), username, auth_token, host_jid, host_id,
56 host_pubkey, pairing_id, pairing_secret, capabilities, flags)); 56 host_pubkey, pairing_id, pairing_secret, capabilities, flags));
57 session_->Connect(); 57 session_->Connect();
58 } 58 }
59 59
60 void JniClient::DisconnectFromHost() { 60 void JniClient::DisconnectFromHost() {
61 DCHECK(runtime_->ui_task_runner()->BelongsToCurrentThread()); 61 DCHECK(runtime_->ui_task_runner()->BelongsToCurrentThread());
62 display_handler_ = nullptr; 62 display_handler_ = nullptr;
63 secret_fetcher_.reset();
63 if (session_) { 64 if (session_) {
64 session_->Disconnect(); 65 session_->Disconnect();
65 runtime_->network_task_runner()->DeleteSoon(FROM_HERE, 66 runtime_->network_task_runner()->DeleteSoon(FROM_HERE,
66 session_.release()); 67 session_.release());
67 } 68 }
68 } 69 }
69 70
70 void JniClient::OnConnectionState(protocol::ConnectionToHost::State state, 71 void JniClient::OnConnectionState(protocol::ConnectionToHost::State state,
71 protocol::ErrorCode error) { 72 protocol::ErrorCode error) {
72 DCHECK(runtime_->ui_task_runner()->BelongsToCurrentThread()); 73 DCHECK(runtime_->ui_task_runner()->BelongsToCurrentThread());
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 return weak_factory_.GetWeakPtr(); 284 return weak_factory_.GetWeakPtr();
284 } 285 }
285 286
286 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& caller) { 287 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& caller) {
287 return reinterpret_cast<intptr_t>( 288 return reinterpret_cast<intptr_t>(
288 new JniClient(ChromotingJniRuntime::GetInstance(), 289 new JniClient(ChromotingJniRuntime::GetInstance(),
289 base::android::ScopedJavaGlobalRef<jobject>(env, caller))); 290 base::android::ScopedJavaGlobalRef<jobject>(env, caller)));
290 } 291 }
291 292
292 } // namespace remoting 293 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698