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

Unified Diff: views/controls/native/native_view_host_gtk.h

Issue 159751: Fix leak of GtkWidgets in NativeViewHost, and in doing so fix a crash on shut... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | « chrome/browser/views/location_bar_view.cc ('k') | views/controls/native/native_view_host_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/native/native_view_host_gtk.h
===================================================================
--- views/controls/native/native_view_host_gtk.h (revision 22173)
+++ views/controls/native/native_view_host_gtk.h (working copy)
@@ -17,6 +17,10 @@
class View;
class WidgetGtk;
+// Note that the NativeViewHostGtk assumes ownership of the GtkWidget attached
+// to it for the duration of its attachment. This is so the NativeViewHostGtk
+// can safely reparent the GtkWidget in multiple passes without having to worry
+// about the GtkWidget's refcnt falling to 0.
class NativeViewHostGtk : public NativeViewHostWrapper {
public:
explicit NativeViewHostGtk(NativeViewHost* host);
@@ -45,10 +49,8 @@
// DestroyFixed returns true if an associated GtkWidget was addref'ed.
jcampan 2009/07/31 23:51:56 It does not return anything anymore, fix comment.
// It does this because when the fixed is destroyed the refcount for the
// contained GtkWidget is decremented, which may cause it to be destroyed
- // which we do not want. If this function returns true, the caller is
- // responsible for unrefing the GtkWidget after it has been added to the new
- // container.
- bool DestroyFixed();
+ // which we do not want.
+ void DestroyFixed();
WidgetGtk* GetHostWidget() const;
« no previous file with comments | « chrome/browser/views/location_bar_view.cc ('k') | views/controls/native/native_view_host_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698