summaryrefslogtreecommitdiffstats
path: root/ui/gfx
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-16 18:16:01 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-16 18:16:01 +0000
commit524283de25962f9182fe37975c4245012f722b60 (patch)
treee5ef1720255f18b6d3836d8acdb26f3b09b296d2 /ui/gfx
parent63b8201d4abcbfcc9d27ce3b410e6206e19d64c5 (diff)
downloadchromium_src-524283de25962f9182fe37975c4245012f722b60.zip
chromium_src-524283de25962f9182fe37975c4245012f722b60.tar.gz
chromium_src-524283de25962f9182fe37975c4245012f722b60.tar.bz2
Warn/error on "using namespace blah;" in headers on clang machines.
This adds about 25s to "make -j8" on linux. I have a few ideas on how to reduce runtime to compensate though. BUG=carnitas TEST=compiles Review URL: http://codereview.chromium.org/6698051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78395 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx')
-rw-r--r--ui/gfx/gtk_util.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/ui/gfx/gtk_util.h b/ui/gfx/gtk_util.h
index 71cb792..fd3575f 100644
--- a/ui/gfx/gtk_util.h
+++ b/ui/gfx/gtk_util.h
@@ -61,23 +61,21 @@ uint8_t* BGRAToRGBA(const uint8_t* pixels, int width, int height, int stride);
} // 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 {
+ // A helper class that will g_object_unref |p| when it goes out of scope.
+ // This never adds a ref, it only unrefs.
+ template<class U>
+ struct GObjectUnrefer {
+ void operator()(U* ptr) const {
+ if (ptr)
+ g_object_unref(ptr);
+ }
+ };
+
typedef scoped_ptr_malloc<T, GObjectUnrefer<T> > Type;
};