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

Unified Diff: remoting/client/jni/jni_pairing_secret_fetcher.cc

Issue 2142253002: [Remoting Android] Fix GetWeakPtr() calls on multiple threads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/jni/jni_pairing_secret_fetcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/jni/jni_pairing_secret_fetcher.cc
diff --git a/remoting/client/jni/jni_pairing_secret_fetcher.cc b/remoting/client/jni/jni_pairing_secret_fetcher.cc
index f6593271c12120bf3108fedb6896d70cac1d0f6e..39a36520e13e261c40032a5c589f69e6adb4c16c 100644
--- a/remoting/client/jni/jni_pairing_secret_fetcher.cc
+++ b/remoting/client/jni/jni_pairing_secret_fetcher.cc
@@ -16,7 +16,9 @@ JniPairingSecretFetcher::JniPairingSecretFetcher(ChromotingJniRuntime* runtime,
jni_runtime_(runtime),
jni_client_(client),
host_id_(host_id),
- weak_factory_(this) {}
+ weak_factory_(this) {
+ weak_ptr_ = weak_factory_.GetWeakPtr();
+}
JniPairingSecretFetcher::~JniPairingSecretFetcher() {
DCHECK(jni_runtime_->network_task_runner()->BelongsToCurrentThread());
@@ -42,7 +44,7 @@ void JniPairingSecretFetcher::ProvideSecret(const std::string& pin) {
}
base::WeakPtr<JniPairingSecretFetcher> JniPairingSecretFetcher::GetWeakPtr() {
- return weak_factory_.GetWeakPtr();
+ return weak_ptr_;
}
// static
« no previous file with comments | « remoting/client/jni/jni_pairing_secret_fetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698