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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_gtk.cc

Issue 42119: Have RenderWidgetHostViewGtk take ownership of its widget. (Closed)
Patch Set: Created 11 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/render_widget_host_view_gtk.cc
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
index 794d5ae46da50505c0c7f365c440841bfacc5847..ad9ffdf95acec1c94edcf7b5550356e10a62cbc2 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -136,6 +136,11 @@ RenderWidgetHostViewGtk::RenderWidgetHostViewGtk(RenderWidgetHost* widget_host)
: host_(widget_host) {
host_->set_view(this);
view_ = RenderWidgetHostViewGtkWidget::CreateNewWidget(this);
+ // BUG 8707: We will live in some container (in this case in WebContents).
+ // We want to destroy during Destroy(), independent of how we are managed in
+ // any containers. We need to sink the reference here to "own" the widget so
+ // it can be added and removed from containers without being destroyed.
+ g_object_ref_sink(view_);
}
RenderWidgetHostViewGtk::~RenderWidgetHostViewGtk() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698