Made the OS_LINUX ifdefs in ui/ and webkit/ directories more cross-platform,...

Made the OS_LINUX ifdefs in ui/ and webkit/ directories more cross-platform, so that these files can be used on multiple POSIX platforms.

Review URL: http://codereview.chromium.org/6990051

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86742 0039d316-1c4b-4281-b951-d872f2087c98
parent 88efcce0
...@@ -142,7 +142,7 @@ TEST_F(ClipboardTest, TrickyHTMLTest) { ...@@ -142,7 +142,7 @@ TEST_F(ClipboardTest, TrickyHTMLTest) {
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
} }
#if defined(OS_LINUX) #if defined(OS_POSIX) && !defined(OS_MACOSX)
// Regression test for crbug.com/56298 (pasting empty HTML crashes Linux). // Regression test for crbug.com/56298 (pasting empty HTML crashes Linux).
TEST_F(ClipboardTest, EmptyHTMLTest) { TEST_F(ClipboardTest, EmptyHTMLTest) {
Clipboard clipboard; Clipboard clipboard;
...@@ -239,11 +239,11 @@ TEST_F(ClipboardTest, URLTest) { ...@@ -239,11 +239,11 @@ TEST_F(ClipboardTest, URLTest) {
clipboard.ReadAsciiText(Clipboard::BUFFER_STANDARD, &ascii_text); clipboard.ReadAsciiText(Clipboard::BUFFER_STANDARD, &ascii_text);
EXPECT_EQ(UTF16ToUTF8(url), ascii_text); EXPECT_EQ(UTF16ToUTF8(url), ascii_text);
#if defined(OS_LINUX) #if defined(OS_POSIX) && !defined(OS_MACOSX)
ascii_text.clear(); ascii_text.clear();
clipboard.ReadAsciiText(Clipboard::BUFFER_SELECTION, &ascii_text); clipboard.ReadAsciiText(Clipboard::BUFFER_SELECTION, &ascii_text);
EXPECT_EQ(UTF16ToUTF8(url), ascii_text); EXPECT_EQ(UTF16ToUTF8(url), ascii_text);
#endif // defined(OS_LINUX) #endif
} }
TEST_F(ClipboardTest, SharedBitmapTest) { TEST_F(ClipboardTest, SharedBitmapTest) {
......
...@@ -320,7 +320,7 @@ bool CheckAndResolveLocale(const std::string& locale, ...@@ -320,7 +320,7 @@ bool CheckAndResolveLocale(const std::string& locale,
// if "foo bar" is RTL. So this function prepends the necessary RLM in such // if "foo bar" is RTL. So this function prepends the necessary RLM in such
// cases. // cases.
void AdjustParagraphDirectionality(string16* paragraph) { void AdjustParagraphDirectionality(string16* paragraph) {
#if defined(OS_LINUX) #if defined(OS_POSIX) && !defined(OS_MACOSX)
if (base::i18n::IsRTL() && if (base::i18n::IsRTL() &&
base::i18n::StringContainsStrongRTLChars(*paragraph)) { base::i18n::StringContainsStrongRTLChars(*paragraph)) {
paragraph->insert(0, 1, static_cast<char16>(base::i18n::kRightToLeftMark)); paragraph->insert(0, 1, static_cast<char16>(base::i18n::kRightToLeftMark));
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "base/utf_string_conversions.h" #include "base/utf_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#if defined(OS_LINUX) #if defined(OS_POSIX) && !defined(OS_MACOSX)
#include <pango/pango.h> #include <pango/pango.h>
#elif defined(OS_WIN) #elif defined(OS_WIN)
#include "ui/gfx/platform_font_win.h" #include "ui/gfx/platform_font_win.h"
...@@ -22,7 +22,7 @@ class FontTest : public testing::Test { ...@@ -22,7 +22,7 @@ class FontTest : public testing::Test {
// Fulfills the memory management contract as outlined by the comment at // Fulfills the memory management contract as outlined by the comment at
// gfx::Font::GetNativeFont(). // gfx::Font::GetNativeFont().
void FreeIfNecessary(gfx::NativeFont font) { void FreeIfNecessary(gfx::NativeFont font) {
#if defined(OS_LINUX) #if defined(OS_POSIX) && !defined(OS_MACOSX)
pango_font_description_free(font); pango_font_description_free(font);
#endif #endif
} }
......
...@@ -22,7 +22,9 @@ ...@@ -22,7 +22,9 @@
// The standard OpenGL native extension headers are also included. // The standard OpenGL native extension headers are also included.
#if defined(OS_WIN) #if defined(OS_WIN)
#include <GL/wglext.h> #include <GL/wglext.h>
#elif defined(OS_LINUX) #elif defined(OS_MACOSX)
#include <OpenGL/OpenGL.h>
#elif defined(USE_X11)
#include <GL/glx.h> #include <GL/glx.h>
#include <GL/glxext.h> #include <GL/glxext.h>
...@@ -31,9 +33,6 @@ ...@@ -31,9 +33,6 @@
#undef Bool #undef Bool
#undef None #undef None
#undef Status #undef Status
#elif defined(OS_MACOSX)
#include <OpenGL/OpenGL.h>
#endif #endif
#if defined(OS_WIN) #if defined(OS_WIN)
...@@ -52,7 +51,7 @@ ...@@ -52,7 +51,7 @@
typedef struct osmesa_context *OSMesaContext; typedef struct osmesa_context *OSMesaContext;
typedef void (*OSMESAproc)(); typedef void (*OSMESAproc)();
#if defined(OS_WIN) || defined(OS_LINUX) #if !defined(OS_MACOSX)
// Forward declare EGL types. // Forward declare EGL types.
typedef unsigned int EGLBoolean; typedef unsigned int EGLBoolean;
...@@ -75,7 +74,7 @@ typedef Pixmap EGLNativePixmapType; ...@@ -75,7 +74,7 @@ typedef Pixmap EGLNativePixmapType;
typedef Window EGLNativeWindowType; typedef Window EGLNativeWindowType;
#endif #endif
#endif // OS_WIN || OS_LINUX #endif // !OS_MACOSX
#include "gl_bindings_autogen_gl.h" #include "gl_bindings_autogen_gl.h"
#include "gl_bindings_autogen_osmesa.h" #include "gl_bindings_autogen_osmesa.h"
...@@ -83,7 +82,7 @@ typedef Window EGLNativeWindowType; ...@@ -83,7 +82,7 @@ typedef Window EGLNativeWindowType;
#if defined(OS_WIN) #if defined(OS_WIN)
#include "gl_bindings_autogen_egl.h" #include "gl_bindings_autogen_egl.h"
#include "gl_bindings_autogen_wgl.h" #include "gl_bindings_autogen_wgl.h"
#elif defined(OS_LINUX) #elif defined(USE_X11)
#include "gl_bindings_autogen_egl.h" #include "gl_bindings_autogen_egl.h"
#include "gl_bindings_autogen_glx.h" #include "gl_bindings_autogen_glx.h"
#endif #endif
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
// it brings in #defines that cause conflicts. // it brings in #defines that cause conflicts.
#include "ui/gfx/gl/gl_bindings.h" #include "ui/gfx/gl/gl_bindings.h"
#if defined(OS_LINUX) #if defined(USE_X11)
extern "C" { extern "C" {
#include <X11/Xlib.h> #include <X11/Xlib.h>
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
// it brings in #defines that cause conflicts. // it brings in #defines that cause conflicts.
#include "ui/gfx/gl/gl_bindings.h" #include "ui/gfx/gl/gl_bindings.h"
#if defined(OS_LINUX) #if defined(USE_X11)
extern "C" { extern "C" {
#include <X11/Xlib.h> #include <X11/Xlib.h>
} }
...@@ -38,7 +38,7 @@ bool GLSurfaceEGL::InitializeOneOff() { ...@@ -38,7 +38,7 @@ bool GLSurfaceEGL::InitializeOneOff() {
if (initialized) if (initialized)
return true; return true;
#ifdef OS_LINUX #if defined(USE_X11)
EGLNativeDisplayType native_display = XOpenDisplay(NULL); EGLNativeDisplayType native_display = XOpenDisplay(NULL);
#else #else
EGLNativeDisplayType native_display = EGL_DEFAULT_DISPLAY; EGLNativeDisplayType native_display = EGL_DEFAULT_DISPLAY;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "base/stl_util-inl.h" #include "base/stl_util-inl.h"
#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkBitmap.h"
#if defined(OS_LINUX) #if defined(TOOLKIT_USES_GTK)
#include <gdk-pixbuf/gdk-pixbuf.h> #include <gdk-pixbuf/gdk-pixbuf.h>
#include <glib-object.h> #include <glib-object.h>
#include "ui/gfx/canvas_skia.h" #include "ui/gfx/canvas_skia.h"
...@@ -30,7 +30,7 @@ namespace internal { ...@@ -30,7 +30,7 @@ namespace internal {
bool NSImageToSkBitmaps(NSImage* image, std::vector<const SkBitmap*>* bitmaps); bool NSImageToSkBitmaps(NSImage* image, std::vector<const SkBitmap*>* bitmaps);
#endif #endif
#if defined(OS_LINUX) #if defined(TOOLKIT_USES_GTK)
const SkBitmap* GdkPixbufToSkBitmap(GdkPixbuf* pixbuf) { const SkBitmap* GdkPixbufToSkBitmap(GdkPixbuf* pixbuf) {
gfx::CanvasSkia canvas(gdk_pixbuf_get_width(pixbuf), gfx::CanvasSkia canvas(gdk_pixbuf_get_width(pixbuf),
gdk_pixbuf_get_height(pixbuf), gdk_pixbuf_get_height(pixbuf),
...@@ -62,7 +62,7 @@ class ImageRep { ...@@ -62,7 +62,7 @@ class ImageRep {
return reinterpret_cast<ImageRepSkia*>(this); return reinterpret_cast<ImageRepSkia*>(this);
} }
#if defined(OS_LINUX) #if defined(TOOLKIT_USES_GTK)
ImageRepGdk* AsImageRepGdk() { ImageRepGdk* AsImageRepGdk() {
CHECK_EQ(type_, Image::kImageRepGdk); CHECK_EQ(type_, Image::kImageRepGdk);
return reinterpret_cast<ImageRepGdk*>(this); return reinterpret_cast<ImageRepGdk*>(this);
...@@ -110,7 +110,7 @@ class ImageRepSkia : public ImageRep { ...@@ -110,7 +110,7 @@ class ImageRepSkia : public ImageRep {
DISALLOW_COPY_AND_ASSIGN(ImageRepSkia); DISALLOW_COPY_AND_ASSIGN(ImageRepSkia);
}; };
#if defined(OS_LINUX) #if defined(TOOLKIT_USES_GTK)
class ImageRepGdk : public ImageRep { class ImageRepGdk : public ImageRep {
public: public:
explicit ImageRepGdk(GdkPixbuf* pixbuf) explicit ImageRepGdk(GdkPixbuf* pixbuf)
...@@ -207,7 +207,7 @@ Image::Image(const std::vector<const SkBitmap*>& bitmaps) ...@@ -207,7 +207,7 @@ Image::Image(const std::vector<const SkBitmap*>& bitmaps)
AddRepresentation(rep); AddRepresentation(rep);
} }
#if defined(OS_LINUX) #if defined(TOOLKIT_USES_GTK)
Image::Image(GdkPixbuf* pixbuf) Image::Image(GdkPixbuf* pixbuf)
: storage_(new internal::ImageStorage(Image::kImageRepGdk)) { : storage_(new internal::ImageStorage(Image::kImageRepGdk)) {
internal::ImageRepGdk* rep = new internal::ImageRepGdk(pixbuf); internal::ImageRepGdk* rep = new internal::ImageRepGdk(pixbuf);
...@@ -243,7 +243,7 @@ Image::operator const SkBitmap&() const { ...@@ -243,7 +243,7 @@ Image::operator const SkBitmap&() const {
return *(this->operator const SkBitmap*()); return *(this->operator const SkBitmap*());
} }
#if defined(OS_LINUX) #if defined(TOOLKIT_USES_GTK)
Image::operator GdkPixbuf*() const { Image::operator GdkPixbuf*() const {
internal::ImageRep* rep = GetRepresentation(Image::kImageRepGdk); internal::ImageRep* rep = GetRepresentation(Image::kImageRepGdk);
return rep->AsImageRepGdk()->pixbuf(); return rep->AsImageRepGdk()->pixbuf();
...@@ -295,7 +295,7 @@ internal::ImageRep* Image::GetRepresentation( ...@@ -295,7 +295,7 @@ internal::ImageRep* Image::GetRepresentation(
// Handle native-to-Skia conversion. // Handle native-to-Skia conversion.
if (rep_type == Image::kImageRepSkia) { if (rep_type == Image::kImageRepSkia) {
internal::ImageRepSkia* rep = NULL; internal::ImageRepSkia* rep = NULL;
#if defined(OS_LINUX) #if defined(TOOLKIT_USES_GTK)
if (storage_->default_representation_type() == Image::kImageRepGdk) { if (storage_->default_representation_type() == Image::kImageRepGdk) {
internal::ImageRepGdk* pixbuf_rep = default_rep->AsImageRepGdk(); internal::ImageRepGdk* pixbuf_rep = default_rep->AsImageRepGdk();
rep = new internal::ImageRepSkia( rep = new internal::ImageRepSkia(
...@@ -318,7 +318,7 @@ internal::ImageRep* Image::GetRepresentation( ...@@ -318,7 +318,7 @@ internal::ImageRep* Image::GetRepresentation(
if (default_rep->type() == Image::kImageRepSkia) { if (default_rep->type() == Image::kImageRepSkia) {
internal::ImageRepSkia* skia_rep = default_rep->AsImageRepSkia(); internal::ImageRepSkia* skia_rep = default_rep->AsImageRepSkia();
internal::ImageRep* native_rep = NULL; internal::ImageRep* native_rep = NULL;
#if defined(OS_LINUX) #if defined(TOOLKIT_USES_GTK)
if (rep_type == Image::kImageRepGdk) { if (rep_type == Image::kImageRepGdk) {
GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(skia_rep->bitmap()); GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(skia_rep->bitmap());
native_rep = new internal::ImageRepGdk(pixbuf); native_rep = new internal::ImageRepGdk(pixbuf);
......
...@@ -58,7 +58,7 @@ class Image { ...@@ -58,7 +58,7 @@ class Image {
// of bitmaps, one for each resolution. // of bitmaps, one for each resolution.
explicit Image(const std::vector<const SkBitmap*>& bitmaps); explicit Image(const std::vector<const SkBitmap*>& bitmaps);
#if defined(OS_LINUX) #if defined(TOOLKIT_USES_GTK)
// Does not increase |pixbuf|'s reference count; expects to take ownership. // Does not increase |pixbuf|'s reference count; expects to take ownership.
explicit Image(GdkPixbuf* pixbuf); explicit Image(GdkPixbuf* pixbuf);
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
...@@ -81,7 +81,7 @@ class Image { ...@@ -81,7 +81,7 @@ class Image {
// Conversion handlers. // Conversion handlers.
operator const SkBitmap*() const ; operator const SkBitmap*() const ;
operator const SkBitmap&() const; operator const SkBitmap&() const;
#if defined(OS_LINUX) #if defined(TOOLKIT_USES_GTK)
operator GdkPixbuf*() const; operator GdkPixbuf*() const;
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
operator NSImage*() const; operator NSImage*() const;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "ui/gfx/image.h" #include "ui/gfx/image.h"
#include "ui/gfx/image_unittest_util.h" #include "ui/gfx/image_unittest_util.h"
#if defined(OS_LINUX) #if defined(TOOLKIT_USES_GTK)
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "ui/gfx/gtk_util.h" #include "ui/gfx/gtk_util.h"
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkBitmap.h"
#if defined(OS_LINUX) #if defined(TOOLKIT_USES_GTK)
#include "ui/gfx/gtk_util.h" #include "ui/gfx/gtk_util.h"
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
#include "base/mac/mac_util.h" #include "base/mac/mac_util.h"
...@@ -34,7 +34,7 @@ PlatformImage CreatePlatformImage() { ...@@ -34,7 +34,7 @@ PlatformImage CreatePlatformImage() {
NSImage* image = gfx::SkBitmapToNSImage(*(bitmap.get())); NSImage* image = gfx::SkBitmapToNSImage(*(bitmap.get()));
base::mac::NSObjectRetain(image); base::mac::NSObjectRetain(image);
return image; return image;
#elif defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) #elif defined(TOOLKIT_GTK)
return gfx::GdkPixbufFromSkBitmap(bitmap.get()); return gfx::GdkPixbufFromSkBitmap(bitmap.get());
#else #else
return bitmap.release(); return bitmap.release();
...@@ -44,7 +44,7 @@ PlatformImage CreatePlatformImage() { ...@@ -44,7 +44,7 @@ PlatformImage CreatePlatformImage() {
gfx::Image::RepresentationType GetPlatformRepresentationType() { gfx::Image::RepresentationType GetPlatformRepresentationType() {
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
return gfx::Image::kImageRepCocoa; return gfx::Image::kImageRepCocoa;
#elif defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) #elif defined(TOOLKIT_GTK)
return gfx::Image::kImageRepGdk; return gfx::Image::kImageRepGdk;
#else #else
return gfx::Image::kImageRepSkia; return gfx::Image::kImageRepSkia;
......
...@@ -15,7 +15,7 @@ namespace test { ...@@ -15,7 +15,7 @@ namespace test {
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
typedef NSImage* PlatformImage; typedef NSImage* PlatformImage;
#elif defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) #elif defined(TOOLKIT_GTK)
typedef GdkPixbuf* PlatformImage; typedef GdkPixbuf* PlatformImage;
#else #else
typedef const SkBitmap* PlatformImage; typedef const SkBitmap* PlatformImage;
......
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -97,7 +97,7 @@ typedef GdkRegion* NativeRegion; ...@@ -97,7 +97,7 @@ typedef GdkRegion* NativeRegion;
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
typedef NSImage NativeImageType; typedef NSImage NativeImageType;
#elif defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) #elif defined(TOOLKIT_GTK)
typedef GdkPixbuf NativeImageType; typedef GdkPixbuf NativeImageType;
#else #else
typedef SkBitmap NativeImageType; typedef SkBitmap NativeImageType;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#if defined(OS_WIN) #if defined(OS_WIN)
#include <windows.h> #include <windows.h>
#elif defined(OS_LINUX) #elif defined(TOOLKIT_USES_GTK)
#include <gdk/gdk.h> #include <gdk/gdk.h>
#endif #endif
...@@ -99,7 +99,7 @@ string16 GetShortcutTextForAccelerator(const Accelerator& accelerator) { ...@@ -99,7 +99,7 @@ string16 GetShortcutTextForAccelerator(const Accelerator& accelerator) {
else else
key = LOWORD(::MapVirtualKeyW(accelerator.key_code(), MAPVK_VK_TO_CHAR)); key = LOWORD(::MapVirtualKeyW(accelerator.key_code(), MAPVK_VK_TO_CHAR));
shortcut += key; shortcut += key;
#elif defined(OS_LINUX) #elif defined(TOOLKIT_USES_GTK)
const gchar* name = NULL; const gchar* name = NULL;
switch (accelerator.key_code()) { switch (accelerator.key_code()) {
case ui::VKEY_OEM_2: case ui::VKEY_OEM_2:
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#if defined(OS_LINUX) #if defined(TOOLKIT_USES_GTK)
#include <gdk/gdk.h> #include <gdk/gdk.h>
#endif #endif
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#if defined(OS_LINUX) #if defined(TOOLKIT_USES_GTK)
#include <gtk/gtk.h> #include <gtk/gtk.h>
#endif #endif
......
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "base/third_party/purify/pure.h" #include "base/third_party/purify/pure.h"
#endif // QUANTIFY #endif // QUANTIFY
#if defined(USE_TCMALLOC) && defined(OS_LINUX) #if defined(USE_TCMALLOC) && defined(OS_POSIX) && !defined(OS_MACOSX)
#include "third_party/tcmalloc/chromium/src/google/profiler.h" #include "third_party/tcmalloc/chromium/src/google/profiler.h"
#endif #endif
...@@ -71,7 +71,7 @@ class ProfilerWrapper : public v8::Extension { ...@@ -71,7 +71,7 @@ class ProfilerWrapper : public v8::Extension {
const v8::Arguments& args) { const v8::Arguments& args) {
#if defined(QUANTIFY) #if defined(QUANTIFY)
QuantifyStartRecordingData(); QuantifyStartRecordingData();
#elif defined(USE_TCMALLOC) && defined(OS_LINUX) #elif defined(USE_TCMALLOC) && defined(OS_POSIX) && !defined(OS_MACOSX)
::ProfilerStart("chrome-profile"); ::ProfilerStart("chrome-profile");
#endif #endif
return v8::Undefined(); return v8::Undefined();
...@@ -81,7 +81,7 @@ class ProfilerWrapper : public v8::Extension { ...@@ -81,7 +81,7 @@ class ProfilerWrapper : public v8::Extension {
const v8::Arguments& args) { const v8::Arguments& args) {
#if defined(QUANTIFY) #if defined(QUANTIFY)
QuantifyStopRecordingData(); QuantifyStopRecordingData();
#elif defined(USE_TCMALLOC) && defined(OS_LINUX) #elif defined(USE_TCMALLOC) && defined(OS_POSIX) && !defined(OS_MACOSX)
::ProfilerStop(); ::ProfilerStop();
#endif #endif
return v8::Undefined(); return v8::Undefined();
...@@ -97,7 +97,7 @@ class ProfilerWrapper : public v8::Extension { ...@@ -97,7 +97,7 @@ class ProfilerWrapper : public v8::Extension {
static v8::Handle<v8::Value> ProfilerFlush( static v8::Handle<v8::Value> ProfilerFlush(
const v8::Arguments& args) { const v8::Arguments& args) {
#if defined(USE_TCMALLOC) && defined(OS_LINUX) #if defined(USE_TCMALLOC) && defined(OS_POSIX) && !defined(OS_MACOSX)
::ProfilerFlush(); ::ProfilerFlush();
#endif #endif
return v8::Undefined(); return v8::Undefined();
......
...@@ -206,11 +206,7 @@ WebKitClientImpl::~WebKitClientImpl() { ...@@ -206,11 +206,7 @@ WebKitClientImpl::~WebKitClientImpl() {
} }
WebThemeEngine* WebKitClientImpl::themeEngine() { WebThemeEngine* WebKitClientImpl::themeEngine() {
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MACOSX)
return &theme_engine_; return &theme_engine_;
#else
return NULL;
#endif
} }
WebURLLoader* WebKitClientImpl::createURLLoader() { WebURLLoader* WebKitClientImpl::createURLLoader() {
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h"
#if defined(OS_WIN) #if defined(OS_WIN)
#include "webkit/glue/webthemeengine_impl_win.h" #include "webkit/glue/webthemeengine_impl_win.h"
#elif defined(OS_LINUX)
#include "webkit/glue/webthemeengine_impl_linux.h"
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
#include "webkit/glue/webthemeengine_impl_mac.h" #include "webkit/glue/webthemeengine_impl_mac.h"
#elif defined(OS_POSIX)
#include "webkit/glue/webthemeengine_impl_linux.h"
#endif #endif
...@@ -91,10 +91,7 @@ class WebKitClientImpl : public WebKit::WebKitClient { ...@@ -91,10 +91,7 @@ class WebKitClientImpl : public WebKit::WebKitClient {
void (*shared_timer_func_)(); void (*shared_timer_func_)();
double shared_timer_fire_time_; double shared_timer_fire_time_;
int shared_timer_suspended_; // counter int shared_timer_suspended_; // counter
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MACOSX)
WebThemeEngineImpl theme_engine_; WebThemeEngineImpl theme_engine_;
#endif
}; };
} // namespace webkit_glue } // namespace webkit_glue
......
// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -60,7 +60,7 @@ TEST(PluginLibLoading, UnloadAllPlugins) { ...@@ -60,7 +60,7 @@ TEST(PluginLibLoading, UnloadAllPlugins) {
PluginLib::UnloadAllPlugins(); PluginLib::UnloadAllPlugins();
} }
#if defined(OS_LINUX) #if defined(OS_POSIX) && !defined(OS_MACOSX)
// Test parsing a simple description: Real Audio. // Test parsing a simple description: Real Audio.
TEST(MIMEDescriptionParse, Simple) { TEST(MIMEDescriptionParse, Simple) {
...@@ -174,7 +174,7 @@ TEST(PluginDescriptionParse, ExtractVersion) { ...@@ -174,7 +174,7 @@ TEST(PluginDescriptionParse, ExtractVersion) {
EXPECT_EQ(ASCIIToUTF16("1.9.3"), info.version); EXPECT_EQ(ASCIIToUTF16("1.9.3"), info.version);
} }
#endif // defined(OS_LINUX) #endif // defined(OS_POSIX) && !defined(OS_MACOSX)
} // namespace npapi } // namespace npapi
} // namespace webkit } // namespace webkit
...@@ -30,7 +30,7 @@ class PPB_Flash_Impl { ...@@ -30,7 +30,7 @@ class PPB_Flash_Impl {
uint32_t glyph_count, uint32_t glyph_count,
const uint16_t glyph_indices[], const uint16_t glyph_indices[],
const PP_Point glyph_advances[]) const PP_Point glyph_advances[])
#if defined(OS_LINUX) #if defined(OS_POSIX) && !defined(OS_MACOSX)
; ;
#else #else
{ return PP_FALSE; } { return PP_FALSE; }
......
...@@ -55,10 +55,10 @@ ...@@ -55,10 +55,10 @@
#if defined(OS_WIN) #if defined(OS_WIN)
#include "third_party/WebKit/Source/WebKit/chromium/public/win/WebThemeEngine.h" #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebThemeEngine.h"
#include "webkit/tools/test_shell/test_shell_webthemeengine.h" #include "webkit/tools/test_shell/test_shell_webthemeengine.h"
#elif defined(OS_LINUX)
#include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebThemeEngine.h"
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
#include "base/mac/mac_util.h" #include "base/mac/mac_util.h"
#elif defined(OS_POSIX)
#include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebThemeEngine.h"
#endif #endif
using WebKit::WebScriptController; using WebKit::WebScriptController;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment