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

Unified Diff: ui/android/view_android.cc

Issue 2272673003: Remove anchor view from container when reset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « ui/android/view_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/android/view_android.cc
diff --git a/ui/android/view_android.cc b/ui/android/view_android.cc
index 377ea408e7ce276214c26da734154c160adaee4a..abe344bd86931da05266263dc0c8d74d9a42f555 100644
--- a/ui/android/view_android.cc
+++ b/ui/android/view_android.cc
@@ -48,6 +48,10 @@ ViewAndroid::ScopedAnchorView::operator=(ScopedAnchorView&& other) {
}
ViewAndroid::ScopedAnchorView::~ScopedAnchorView() {
+ Reset();
+}
+
+void ViewAndroid::ScopedAnchorView::Reset() {
JNIEnv* env = base::android::AttachCurrentThread();
const ScopedJavaLocalRef<jobject> view = view_.get(env);
const ScopedJavaLocalRef<jobject> delegate = delegate_.get(env);
@@ -55,10 +59,6 @@ ViewAndroid::ScopedAnchorView::~ScopedAnchorView() {
Java_ViewAndroidDelegate_removeView(env, delegate, view);
}
view_.reset();
-}
-
-void ViewAndroid::ScopedAnchorView::Reset() {
- view_.reset();
delegate_.reset();
}
« no previous file with comments | « ui/android/view_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698