Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_impl.h |
| diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h |
| index 4f25ec790c9b4e3dd17b01c422d3cd1aa9c07734..dabd353c804aafb9073d8884ecaceb315c3f16c9 100644 |
| --- a/content/browser/renderer_host/render_widget_host_impl.h |
| +++ b/content/browser/renderer_host/render_widget_host_impl.h |
| @@ -66,6 +66,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, |
| public: |
| // routing_id can be MSG_ROUTING_NONE, in which case the next available |
| // routing id is taken from the RenderProcessHost. |
| + // If this object outlives |delegate|, DetachDelegate() must be called when |
| + // |delegate| goes away. |
| RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, |
| RenderProcessHost* process, |
| int routing_id); |
| @@ -412,6 +414,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, |
| virtual void RemoveLayer(WebKit::WebLayer* layer) {} |
| #endif |
| + void DetachDelegate() { delegate_ = NULL; } |
|
jam
2012/09/22 00:01:34
per the style guide, if this is inline this should
yzshen1
2012/09/22 00:28:08
set_delegate() implies that |delegate_| can be cha
|
| + |
| protected: |
| virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() OVERRIDE; |
| @@ -432,10 +436,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, |
| // when accelerated compositing is enabled. |
| gfx::GLSurfaceHandle GetCompositingSurface(); |
| - // "RenderWidgetHostDelegate" ------------------------------------------------ |
| - // There is no RenderWidgetHostDelegate but the following methods serve the |
| - // same purpose. They are overridden by RenderViewHost to send upwards to its |
| - // delegate. |
| + // --------------------------------------------------------------------------- |
| + // The following methods are overridden by RenderViewHost to send upwards to |
| + // its delegate. |
| // Called when a mousewheel event was not processed by the renderer. |
| virtual void UnhandledWheelEvent(const WebKit::WebMouseWheelEvent& event) {} |
| @@ -631,6 +634,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, |
| void TickActiveSmoothScrollGesture(); |
| // Our delegate, which wants to know mainly about keyboard events. |
| + // It will remain non-NULL until DetachDelegate() is called. |
| RenderWidgetHostDelegate* delegate_; |
| // Created during construction but initialized during Init*(). Therefore, it |