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

Unified Diff: content/browser/renderer_host/render_widget_host_view_base.h

Issue 538883002: Speculative fix for DelegatedFrameHost destructor crashes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Absolutely minimal fix Created 6 years, 3 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/renderer_host/render_widget_host_view_base.h
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h
index 62daf7f3d3a9242f2b6d3d2d4803cbd092536783..4da2b56416d704d6dba154a4c15ad07922ce3ea0 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.h
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -104,6 +104,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
// changed since the last time.
bool HasDisplayPropertyChanged(gfx::NativeView view);
+ base::WeakPtr<RenderWidgetHostViewBase> GetWeakPtr();
+
//----------------------------------------------------------------------------
// The following methods can be overridden by derived classes.
@@ -225,6 +227,13 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
virtual void RenderProcessGone(base::TerminationStatus status,
int error_code) = 0;
+ // Notifies the View that the renderer's host has ceased to exist.
+ // The default implementation of this is a no-op. This hack exists to fix
+ // a crash on the branch.
+ // TODO(ccameron): Clean this up.
+ // http://crbug.com/404828
+ virtual void RenderWidgetHostGone() {}
+
// Tells the View to destroy itself.
virtual void Destroy() = 0;
@@ -424,6 +433,8 @@ protected:
base::OneShotTimer<RenderWidgetHostViewBase> flush_input_timer_;
+ base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase);
};

Powered by Google App Engine
This is Rietveld 408576698