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/glue/resource_fetcher_unittest.cc | |
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/glue/resource_fetcher_unittest.cc')
-rw-r--r-- | webkit/glue/resource_fetcher_unittest.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/webkit/glue/resource_fetcher_unittest.cc b/webkit/glue/resource_fetcher_unittest.cc index e1022a0..f83cebc 100644 --- a/webkit/glue/resource_fetcher_unittest.cc +++ b/webkit/glue/resource_fetcher_unittest.cc @@ -2,18 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(OS_LINUX) -#include <gtk/gtk.h> -#endif +#include "webkit/glue/resource_fetcher.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" #include "third_party/WebKit/WebKit/chromium/public/WebView.h" #include "webkit/glue/unittest_test_server.h" -#include "webkit/glue/resource_fetcher.h" #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" #include "webkit/tools/test_shell/test_shell_test.h" +#if defined(TOOLKIT_USES_GTK) +#include <gtk/gtk.h> +#endif + using WebKit::WebFrame; using WebKit::WebURLResponse; using webkit_glue::ResourceFetcher; @@ -76,7 +77,7 @@ class FetcherDelegate { #if defined(OS_WIN) timer_id_ = ::SetTimer(NULL, NULL, interval, &FetcherDelegate::TimerCallback); -#elif defined(OS_LINUX) +#elif defined(TOOLKIT_USES_GTK) timer_id_ = g_timeout_add(interval, &FetcherDelegate::TimerCallback, NULL); #elif defined(OS_MACOSX) // CFAbsoluteTime is in seconds and |interval| is in ms, so make sure we @@ -93,7 +94,7 @@ class FetcherDelegate { void DestroyTimer() { #if defined(OS_WIN) ::KillTimer(NULL, timer_id_); -#elif defined(OS_LINUX) +#elif defined(TOOLKIT_USES_GTK) g_source_remove(timer_id_); #elif defined(OS_MACOSX) CFRunLoopRemoveTimer(CFRunLoopGetCurrent(), timer_id_, @@ -108,7 +109,7 @@ class FetcherDelegate { DWORD ms) { instance_->TimerFired(); } -#elif defined(OS_LINUX) +#elif defined(TOOLKIT_USES_GTK) static gboolean TimerCallback(gpointer data) { instance_->TimerFired(); return true; @@ -137,7 +138,7 @@ class FetcherDelegate { private: #if defined(OS_WIN) UINT_PTR timer_id_; -#elif defined(OS_LINUX) +#elif defined(TOOLKIT_USES_GTK) guint timer_id_; #elif defined(OS_MACOSX) CFRunLoopTimerRef timer_id_; |