diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-31 01:03:52 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-31 01:03:52 +0000 |
commit | 10a6e77b356565b7c8d18812747b261f0605aae4 (patch) | |
tree | 669258341cb2099c6be4d7d5909bcebb0307dcc4 /webkit/tools | |
parent | b7b412a5ee120091770e9c8bd10b5cb17a8a9aa4 (diff) | |
download | chromium_src-10a6e77b356565b7c8d18812747b261f0605aae4.zip chromium_src-10a6e77b356565b7c8d18812747b261f0605aae4.tar.gz chromium_src-10a6e77b356565b7c8d18812747b261f0605aae4.tar.bz2 |
bsds: views/ and webkit/ support for FreeBSD/OpenBSD
- add a TOOLKIT_USES_GTK #define to catch GTK and Views+GTK
- lots of ifdef twiddling
Review URL: http://codereview.chromium.org/519030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35402 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r-- | webkit/tools/layout_tests/layout_package/platform_utils.py | 2 | ||||
-rw-r--r-- | webkit/tools/npapi_layout_test_plugin/main.cpp | 16 | ||||
-rw-r--r-- | webkit/tools/test_shell/keyboard_unittest.cc | 6 | ||||
-rw-r--r-- | webkit/tools/test_shell/media_leak_test.cc | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/mock_webclipboard_impl.cc | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/plugin_tests.cc | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.gyp | 16 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_request_context.cc | 3 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.cc | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.h | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/webview_host.h | 7 | ||||
-rw-r--r-- | webkit/tools/test_shell/webwidget_host.h | 4 |
13 files changed, 36 insertions, 34 deletions
diff --git a/webkit/tools/layout_tests/layout_package/platform_utils.py b/webkit/tools/layout_tests/layout_package/platform_utils.py index 2b6755b..64ccce2 100644 --- a/webkit/tools/layout_tests/layout_package/platform_utils.py +++ b/webkit/tools/layout_tests/layout_package/platform_utils.py @@ -21,5 +21,5 @@ if sys.platform in ('cygwin', 'win32'): from platform_utils_win import * elif sys.platform == 'darwin': from platform_utils_mac import * -elif sys.platform in ('linux', 'linux2'): +elif sys.platform in ('linux', 'linux2', 'freebsd7', 'openbsd4'): from platform_utils_linux import * diff --git a/webkit/tools/npapi_layout_test_plugin/main.cpp b/webkit/tools/npapi_layout_test_plugin/main.cpp index 1b41f7e6..a644d03 100644 --- a/webkit/tools/npapi_layout_test_plugin/main.cpp +++ b/webkit/tools/npapi_layout_test_plugin/main.cpp @@ -49,21 +49,21 @@ #define EXPORT #endif -#if defined(OS_LINUX) +#if defined(USE_X11) #include <X11/Xlib.h> #endif // Plugin entry points extern "C" { EXPORT NPError NPAPI NP_Initialize(NPNetscapeFuncs *browserFuncs -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) , NPPluginFuncs *pluginFuncs #endif ); EXPORT NPError NPAPI NP_GetEntryPoints(NPPluginFuncs *pluginFuncs); EXPORT void NPAPI NP_Shutdown(void); -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) EXPORT NPError NPAPI NP_GetValue(NPP instance, NPPVariable variable, void *value); EXPORT const char* NPAPI NP_GetMIMEDescription(void); #endif @@ -71,13 +71,13 @@ extern "C" { // Plugin entry points EXPORT NPError NPAPI NP_Initialize(NPNetscapeFuncs *browserFuncs -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) , NPPluginFuncs *pluginFuncs #endif ) { browser = browserFuncs; -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) return NP_GetEntryPoints(pluginFuncs); #else return NPERR_NO_ERROR; @@ -318,7 +318,7 @@ int16 NPP_HandleEvent(NPP instance, void *event) fflush(stdout); -#elif defined(OS_LINUX) +#elif defined(USE_X11) XEvent* evt = static_cast<XEvent*>(event); XButtonPressedEvent* bpress_evt = reinterpret_cast<XButtonPressedEvent*>(evt); XButtonReleasedEvent* brelease_evt = reinterpret_cast<XButtonReleasedEvent*>(evt); @@ -445,7 +445,7 @@ NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value) NPError err = NPERR_NO_ERROR; switch (variable) { -#if defined(OS_LINUX) +#if defined(USE_X11) case NPPVpluginNameString: *((const char **)value) = "WebKit Test PlugIn"; break; @@ -478,7 +478,7 @@ NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value) return NPERR_GENERIC_ERROR; } -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) EXPORT NPError NPAPI NP_GetValue(NPP instance, NPPVariable variable, void *value) { return NPP_GetValue(instance, variable, value); diff --git a/webkit/tools/test_shell/keyboard_unittest.cc b/webkit/tools/test_shell/keyboard_unittest.cc index 65ac39b..6c0e139 100644 --- a/webkit/tools/test_shell/keyboard_unittest.cc +++ b/webkit/tools/test_shell/keyboard_unittest.cc @@ -64,10 +64,10 @@ class KeyboardTest : public testing::Test { // platforms, but meta (command) on Mac. const char* InterpretOSModifierKeyPress(char key_code) { WebKeyboardEvent keyboard_event; -#if defined(OS_WIN) || defined(OS_LINUX) - WebInputEvent::Modifiers os_modifier = WebInputEvent::ControlKey; -#elif defined(OS_MACOSX) +#if defined(OS_MACOSX) WebInputEvent::Modifiers os_modifier = WebInputEvent::MetaKey; +#else + WebInputEvent::Modifiers os_modifier = WebInputEvent::ControlKey; #endif SetupKeyDownEvent(&keyboard_event, key_code, os_modifier); return InterpretKeyEvent(keyboard_event, PlatformKeyboardEvent::RawKeyDown); diff --git a/webkit/tools/test_shell/media_leak_test.cc b/webkit/tools/test_shell/media_leak_test.cc index e56054b..1332b67 100644 --- a/webkit/tools/test_shell/media_leak_test.cc +++ b/webkit/tools/test_shell/media_leak_test.cc @@ -12,7 +12,7 @@ class MediaLeakTest : public TestShellTest { }; -#if defined(OS_WIN) || defined(OS_LINUX) +#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) // This test plays a Theora video file for 1 second. It tries to expose // memory leaks during a normal playback. diff --git a/webkit/tools/test_shell/mock_webclipboard_impl.cc b/webkit/tools/test_shell/mock_webclipboard_impl.cc index 867d076..d161291 100644 --- a/webkit/tools/test_shell/mock_webclipboard_impl.cc +++ b/webkit/tools/test_shell/mock_webclipboard_impl.cc @@ -33,7 +33,7 @@ bool MockWebClipboardImpl::isFormatAvailable(Format format, Buffer buffer) { case BufferStandard: break; case BufferSelection: -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) break; #endif default: diff --git a/webkit/tools/test_shell/plugin_tests.cc b/webkit/tools/test_shell/plugin_tests.cc index 4dc58da..816a846 100644 --- a/webkit/tools/test_shell/plugin_tests.cc +++ b/webkit/tools/test_shell/plugin_tests.cc @@ -26,7 +26,7 @@ using WebKit::WebString; #define TEST_PLUGIN_NAME "npapi_test_plugin.dll" #elif defined(OS_MACOSX) #define TEST_PLUGIN_NAME "npapi_test_plugin.plugin" -#elif defined(OS_LINUX) +#elif defined(OS_POSIX) #define TEST_PLUGIN_NAME "libnpapi_test_plugin.so" #endif diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index 9793381..1745f37 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -300,10 +300,10 @@ std::string TestShell::DumpImage(skia::PlatformCanvas* canvas, #if defined(OS_WIN) bool discard_transparency = true; device.makeOpaque(0, 0, src_bmp.width(), src_bmp.height()); -#elif defined(OS_LINUX) - bool discard_transparency = true; #elif defined(OS_MACOSX) bool discard_transparency = false; +#elif defined(OS_POSIX) + bool discard_transparency = true; #endif // Compute MD5 sum. We should have done this before calling diff --git a/webkit/tools/test_shell/test_shell.gyp b/webkit/tools/test_shell/test_shell.gyp index 3b78abf..bb27787 100644 --- a/webkit/tools/test_shell/test_shell.gyp +++ b/webkit/tools/test_shell/test_shell.gyp @@ -134,7 +134,7 @@ 'npapi_test_plugin', ], }], - ['OS=="linux"', { + ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', { 'dependencies': [ 'test_shell_resources', '../../../build/linux/system.gyp:gtk', @@ -148,7 +148,7 @@ ['exclude', '_x11\\.cc$'], ], }], - ['OS=="linux"', { + ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', { # See below TODO in the Windows branch. 'copies': [ { @@ -212,7 +212,7 @@ 'pak_path': '<(INTERMEDIATE_DIR)/repack/test_shell.pak', }, 'conditions': [ - ['OS=="linux"', { + ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', { 'actions': [ { 'action_name': 'test_shell_repack', @@ -295,7 +295,7 @@ '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.rc', ], }], - ['OS=="linux"', { + ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', { 'conditions': [ ['linux_use_tcmalloc==1', { 'dependencies': [ @@ -445,7 +445,7 @@ ], 'sources': [ '<@(test_shell_windows_resource_files)' ], }], - ['OS=="linux"', { + ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', { 'dependencies': [ 'test_shell_pak', '../../../build/linux/system.gyp:gtk', @@ -557,7 +557,7 @@ ], }, }], - ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', { + ['(OS=="linux" or OS=="freebsd" or OS=="openbsd") and (target_arch=="x64" or target_arch=="arm")', { # Shared libraries need -fPIC on x86-64 'cflags': ['-fPIC'] }], @@ -659,7 +659,7 @@ '../../glue/plugins/test/plugin_windowless_test.cc', ], }], - ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', { + ['(OS=="linux" or OS=="freebsd" or OS=="openbsd") and (target_arch=="x64" or target_arch=="arm")', { # Shared libraries need -fPIC on x86-64 'cflags': ['-fPIC'] }], @@ -667,7 +667,7 @@ }, ], }], - ['OS=="linux"', { + ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', { 'targets': [ { 'target_name': 'test_shell_resources', diff --git a/webkit/tools/test_shell/test_shell_request_context.cc b/webkit/tools/test_shell/test_shell_request_context.cc index d7055b6f..678b375 100644 --- a/webkit/tools/test_shell/test_shell_request_context.cc +++ b/webkit/tools/test_shell/test_shell_request_context.cc @@ -37,7 +37,7 @@ void TestShellRequestContext::Init( accept_language_ = "en-us,en"; accept_charset_ = "iso-8859-1,*,utf-8"; -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) // Use no proxy to avoid ProxyConfigServiceLinux. // Enabling use of the ProxyConfigServiceLinux requires: // -Calling from a thread with a TYPE_UI MessageLoop, @@ -45,6 +45,7 @@ void TestShellRequestContext::Init( // -Keep in mind that proxy auto configuration is also // non-functional on linux in this context because of v8 threading // issues. + // TODO(port): rename "linux" to some nonspecific unix. scoped_ptr<net::ProxyConfigService> proxy_config_service( new net::ProxyConfigServiceFixed(net::ProxyConfig())); #else diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index 3252ace..d283df5 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -975,7 +975,7 @@ TestWebViewDelegate::TestWebViewDelegate(TestShell* shell) page_id_(-1), last_page_id_updated_(-1), using_fake_rect_(false), -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) cursor_type_(GDK_X_CURSOR), #endif smart_insert_delete_enabled_(true), diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index 079cb5a..25ec35e 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -18,7 +18,7 @@ #include <map> #include <string> -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) #include <gdk/gdkcursor.h> #endif @@ -352,7 +352,7 @@ class TestWebViewDelegate : public WebKit::WebViewClient, scoped_refptr<TestDropDelegate> drop_delegate_; #endif -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) // The type of cursor the window is currently using. // Used for judging whether a new SetCursor call is actually changing the // cursor. diff --git a/webkit/tools/test_shell/webview_host.h b/webkit/tools/test_shell/webview_host.h index f9fd21a..ed783dd 100644 --- a/webkit/tools/test_shell/webview_host.h +++ b/webkit/tools/test_shell/webview_host.h @@ -11,7 +11,8 @@ #include "base/basictypes.h" #include "base/gfx/rect.h" #include "webkit/tools/test_shell/webwidget_host.h" -#if defined(OS_LINUX) + +#if defined(TOOLKIT_USES_GTK) #include "webkit/glue/plugins/gtk_plugin_container_manager.h" #endif @@ -34,7 +35,7 @@ class WebViewHost : public WebWidgetHost { WebKit::WebView* webview() const; -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) // Create a new plugin parent container for a given plugin XID. void CreatePluginContainer(gfx::PluginWindowHandle id); @@ -55,7 +56,7 @@ class WebViewHost : public WebWidgetHost { } #endif -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) // Helper class that creates and moves plugin containers. GtkPluginContainerManager plugin_container_manager_; #endif diff --git a/webkit/tools/test_shell/webwidget_host.h b/webkit/tools/test_shell/webwidget_host.h index cf66ed8..86188c0 100644 --- a/webkit/tools/test_shell/webwidget_host.h +++ b/webkit/tools/test_shell/webwidget_host.h @@ -94,7 +94,7 @@ class WebWidgetHost { void KeyEvent(NSEvent *); void SetFocus(bool enable); protected: -#elif defined(OS_LINUX) +#elif defined(TOOLKIT_USES_GTK) public: // --------------------------------------------------------------------------- // This is needed on Linux because the GtkWidget creation is the same between @@ -139,7 +139,7 @@ class WebWidgetHost { bool track_mouse_leave_; #endif -#if defined(OS_LINUX) +#if defined(TOOLKIT_GTK) // Since GtkWindow resize is asynchronous, we have to stash the dimensions, // so that the backing store doesn't have to wait for sizing to take place. gfx::Size logical_size_; |