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

Unified Diff: remoting/client/jni/jni_client.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_client.h ('k') | remoting/client/jni/jni_display_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/jni/jni_client.cc
diff --git a/remoting/client/jni/jni_client.cc b/remoting/client/jni/jni_client.cc
index 90db7a917fff0b1f3bd08615f6268748c8ccca65..9c7f060b396ac96174e6dbae7afe86140a44e3f6 100644
--- a/remoting/client/jni/jni_client.cc
+++ b/remoting/client/jni/jni_client.cc
@@ -26,7 +26,9 @@ JniClient::JniClient(ChromotingJniRuntime* runtime,
base::android::ScopedJavaGlobalRef<jobject> java_client)
: runtime_(runtime),
java_client_(java_client),
- weak_factory_(this) {}
+ weak_factory_(this) {
+ weak_ptr_ = weak_factory_.GetWeakPtr();
+}
JniClient::~JniClient() {
DCHECK(runtime_->ui_task_runner()->BelongsToCurrentThread());
@@ -295,7 +297,7 @@ void JniClient::Destroy(JNIEnv* env, const JavaParamRef<jobject>& caller) {
}
base::WeakPtr<JniClient> JniClient::GetWeakPtr() {
- return weak_factory_.GetWeakPtr();
+ return weak_ptr_;
}
static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& caller) {
« no previous file with comments | « remoting/client/jni/jni_client.h ('k') | remoting/client/jni/jni_display_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698