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

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

Issue 1453803002: Separate RenderViewHost from RenderWidgetHost, part 10: shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: all in destroy, plus mac Created 5 years, 1 month 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_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 678c42272cac0005d0bd2f75407a8dac6b1f1391..10e4da39359b1aa32f786d7740cc0508c75cf72e 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -196,8 +196,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost,
return owned_by_render_frame_host_;
}
- // Tells the renderer to die and then calls Destroy().
- virtual void Shutdown();
+ // Tells the renderer to die and optionally delete it.
+ void ShutdownAndDestroyWidget(bool also_delete);
// IPC::Listener
bool OnMessageReceived(const IPC::Message& msg) override;
@@ -523,19 +523,14 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost,
// crashes, its View is destroyed and this pointer becomes NULL, even though
// render_view_host_ lives on to load another URL (creating a new View while
// doing so).
- RenderWidgetHostViewBase* view_;
-
- // A weak pointer to the view. The above pointer should be weak, but changing
- // that to be weak causes crashes on Android.
- // TODO(ccameron): Fix this.
- // http://crbug.com/404828
- base::WeakPtr<RenderWidgetHostViewBase> view_weak_;
+ base::WeakPtr<RenderWidgetHostViewBase> view_;
private:
friend class MockRenderWidgetHost;
- // Tell this object to destroy itself.
- void Destroy();
+ // Tell this object to destroy itself. If |also_delete| is specified, the
+ // destructor is called as well.
+ void Destroy(bool also_delete);
// Called by |hang_monitor_timeout_| on delayed response from the renderer.
void RendererIsUnresponsive();
@@ -647,6 +642,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost,
// initialization.
bool renderer_initialized_;
+ // True if |Destroy()| has been called.
+ bool destroyed_;
+
// Our delegate, which wants to know mainly about keyboard events.
// It will remain non-NULL until DetachDelegate() is called.
RenderWidgetHostDelegate* delegate_;

Powered by Google App Engine
This is Rietveld 408576698