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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 133073012: android: Fix ContentViewCore and RenderWidgetHostViewAndroid lifetime issue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 6 years, 11 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
Index: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index 4cb6da8994f4dd65a52654b0104c558c83adf513..9442fcd38bece895a2f4a4dc6d6501fdb9677c50 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -1679,6 +1679,15 @@ void ContentViewCoreImpl::OnSmartClipDataExtracted(
env, obj.obj(), jresult.obj());
}
+void ContentViewCoreImpl::OnDetachedFromWebContents(WebContents* web_contents) {
Ted C 2014/01/23 01:28:42 Looking more at this, why don't you do this in Con
powei 2014/01/23 01:38:02 My first instinct was to put it in the destructor
Ted C 2014/01/23 02:00:15 Hmm...that is unfortunate. If that is the case, I
powei 2014/01/23 02:38:40 Done. Turns out ContentViewCoreImpl is already a
+ DCHECK_EQ(GetWebContents(), web_contents);
+
+ WebContentsViewAndroid* wcva =
+ static_cast<WebContentsViewAndroid*>(GetWebContents()->GetView());
Ted C 2014/01/23 01:28:42 +2
powei 2014/01/23 01:38:02 Done.
+ DCHECK(wcva);
+ wcva->SetContentViewCore(NULL);
+}
+
// This is called for each ContentView.
jlong Init(JNIEnv* env, jobject obj,
jboolean hardware_accelerated,
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/android/web_contents_observer_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698