summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-29 01:13:23 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-29 01:13:23 +0000
commit031e4d30e56ca9fc438e7e32bf6e51bdee74e8d0 (patch)
treefd9e8d470de5f79c0e531fecc1338ca6197974a7 /app
parente76049f366a8ffd17708d8915d7d3881b35d53a4 (diff)
downloadchromium_src-031e4d30e56ca9fc438e7e32bf6e51bdee74e8d0.zip
chromium_src-031e4d30e56ca9fc438e7e32bf6e51bdee74e8d0.tar.gz
chromium_src-031e4d30e56ca9fc438e7e32bf6e51bdee74e8d0.tar.bz2
linux: reduce header interdependencies
By analyzing gcc -H output, I found some of our worst offenders for headers bringing in other headers. native_web_keyboard_event.h was responsible for just under 60,000 extra includes! This change will in theory make the build faster. Review URL: http://codereview.chromium.org/524004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35326 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/gfx/native_widget_types.h2
-rw-r--r--app/scoped_handle_gtk.h50
-rw-r--r--app/theme_provider.h3
3 files changed, 53 insertions, 2 deletions
diff --git a/app/gfx/native_widget_types.h b/app/gfx/native_widget_types.h
index eda722d..ba845a0 100644
--- a/app/gfx/native_widget_types.h
+++ b/app/gfx/native_widget_types.h
@@ -48,10 +48,10 @@ class NSTextField;
#endif // __OBJC__
#elif defined(USE_X11)
typedef struct _GdkCursor GdkCursor;
+typedef struct _GdkRegion GdkRegion;
typedef struct _GtkWidget GtkWidget;
typedef struct _GtkWindow GtkWindow;
typedef struct _cairo cairo_t;
-typedef struct _GdkRegion GdkRegion;
#endif
namespace gfx {
diff --git a/app/scoped_handle_gtk.h b/app/scoped_handle_gtk.h
new file mode 100644
index 0000000..d501f91
--- /dev/null
+++ b/app/scoped_handle_gtk.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef APP_SCOPED_HANDLE_GTK_H_
+#define APP_SCOPED_HANDLE_GTK_H_
+
+#include <gdk/gdk.h>
+
+// Wraps a GdkRegion. This class provides the same methods as ScopedGDIObject in
+// scoped_handle_win.
+class ScopedRegion {
+ public:
+ ScopedRegion() : region_(NULL) {}
+ explicit ScopedRegion(GdkRegion* region) : region_(region) {}
+
+ ~ScopedRegion() {
+ Close();
+ }
+
+ void Set(GdkRegion* region) {
+ Close();
+
+ region_ = region;
+ }
+
+ GdkRegion* Get() {
+ return region_;
+ }
+
+ GdkRegion* release() {
+ GdkRegion* region = region_;
+ region_ = NULL;
+ return region;
+ }
+
+ private:
+ void Close() {
+ if (region_) {
+ gdk_region_destroy(region_);
+ region_ = NULL;
+ }
+ }
+
+ GdkRegion* region_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedRegion);
+};
+
+#endif // APP_SCOPED_HANDLE_GTK_H_
diff --git a/app/theme_provider.h b/app/theme_provider.h
index 0bd7ae1..13b421e 100644
--- a/app/theme_provider.h
+++ b/app/theme_provider.h
@@ -11,7 +11,8 @@
#include "third_party/skia/include/core/SkColor.h"
#if defined(OS_LINUX)
-#include <gdk/gdk.h>
+typedef struct _GdkColor GdkColor;
+typedef struct _GdkPixbuf GdkPixbuf;
#elif defined(OS_MACOSX)
#ifdef __OBJC__
@class NSColor;