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

Unified Diff: gfx/gtk_util.h

Issue 2804042: Incomplete changes to make scoped_ptr_malloc use plain functions. (Closed)
Patch Set: chrome now builds & links Created 10 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/third_party/mozilla_security_manager/nsNSSCertHelper.h ('k') | media/ffmpeg/ffmpeg_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gfx/gtk_util.h
diff --git a/gfx/gtk_util.h b/gfx/gtk_util.h
index 5af37df3fc290f3f5a3bc173cc15f67b4f348a62..143694a90967c81d98a558c3bdaa61001ca24ff2 100644
--- a/gfx/gtk_util.h
+++ b/gfx/gtk_util.h
@@ -50,24 +50,12 @@ double GetPangoResolution();
} // namespace gfx
-namespace {
-// A helper class that will g_object_unref |p| when it goes out of scope.
-// This never adds a ref, it only unrefs.
-template <typename Type>
-struct GObjectUnrefer {
- void operator()(Type* ptr) const {
- if (ptr)
- g_object_unref(ptr);
- }
-};
-} // namespace
-
// It's not legal C++ to have a templatized typedefs, so we wrap it in a
// struct. When using this, you need to include ::Type. E.g.,
// ScopedGObject<GdkPixbufLoader>::Type loader(gdk_pixbuf_loader_new());
template<class T>
struct ScopedGObject {
- typedef scoped_ptr_malloc<T, GObjectUnrefer<T> > Type;
+ typedef scoped_ptr_malloc<T, FreeFnAdapter<g_object_unref> > Type;
};
#endif // GFX_GTK_UTIL_H_
« no previous file with comments | « chrome/third_party/mozilla_security_manager/nsNSSCertHelper.h ('k') | media/ffmpeg/ffmpeg_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698