Index: content/browser/renderer_host/render_widget_host_view_android.h |
diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h |
index 462cabde47f61333c9499a8373932be10ecacbee..180e0f0e986040d44a9bfe19ba85652d4fc73ba4 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_android.h |
+++ b/content/browser/renderer_host/render_widget_host_view_android.h |
@@ -330,6 +330,13 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid |
// ContentViewCoreImpl is our interface to the view system. |
ContentViewCoreImpl* content_view_core_; |
+ // Cache the WindowAndroid instance exposed by ContentViewCore to avoid |
+ // calling into ContentViewCore when it is being detached from the |
+ // WebContents during destruction. The WindowAndroid has stronger lifetime |
+ // guarantees, and should be safe to use for observer detachment. |
+ // This will be non-null iff |content_view_core_| is non-null. |
+ ui::WindowAndroid* content_view_core_window_android_; |
+ |
ImeAdapterAndroid ime_adapter_android_; |
// Body background color of the underlying document. |