summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-08-29 15:50:43 +0100
committerKristian Monsen <kristianm@google.com>2010-08-31 18:05:44 +0100
commitbdcebcb37eb20e212451130aee402c1927ad0e14 (patch)
treea522038c56fee499345b061fb4eb6decdf3e253a /WebKit
parentec079933211eb47479b2624cb6be72257d178c01 (diff)
downloadexternal_webkit-bdcebcb37eb20e212451130aee402c1927ad0e14.zip
external_webkit-bdcebcb37eb20e212451130aee402c1927ad0e14.tar.gz
external_webkit-bdcebcb37eb20e212451130aee402c1927ad0e14.tar.bz2
Move all external/chromiumn includes to one file
There are several logging errors and warnings when including files from external/chromium and the <cutils/log.h>. This commit moves all external/chromium includes to one place, and and LOG_ASSERT to what it is in <cutils/log.h> Change-Id: If908262cf1b859247d7b8a5880807a2e9ec16980
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/android/WebCoreSupport/ChromiumIncludes.h76
-rw-r--r--WebKit/android/WebCoreSupport/WebRequest.cpp4
-rw-r--r--WebKit/android/WebCoreSupport/WebRequest.h4
-rw-r--r--WebKit/android/WebCoreSupport/WebRequestContext.cpp8
-rw-r--r--WebKit/android/WebCoreSupport/WebRequestContext.h4
-rw-r--r--WebKit/android/WebCoreSupport/WebResourceRequest.cpp1
-rw-r--r--WebKit/android/WebCoreSupport/WebResourceRequest.h3
-rw-r--r--WebKit/android/WebCoreSupport/WebResponse.h2
-rw-r--r--WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp5
-rw-r--r--WebKit/android/WebCoreSupport/WebUrlLoaderClient.h3
10 files changed, 82 insertions, 28 deletions
diff --git a/WebKit/android/WebCoreSupport/ChromiumIncludes.h b/WebKit/android/WebCoreSupport/ChromiumIncludes.h
new file mode 100644
index 0000000..0ba57e2
--- /dev/null
+++ b/WebKit/android/WebCoreSupport/ChromiumIncludes.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2010, The Android Open Source Project
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ChromiumIncludes_h
+#define ChromiumIncludes_h
+
+// Include all external/chromium files in this file so the problems with the LOG
+// and LOG_ASSERT defines can be handled in one place.
+
+// Undefine LOG and LOG_ASSERT before including chrome code, and if they were
+// defined attempt to set the macros to the Android logging macros (which are
+// the only ones that actually log).
+
+#ifdef LOG
+#define LOG_WAS_DEFINED LOG
+#undef LOG
+#endif
+
+#ifdef LOG_ASSERT
+#define LOG_ASSERT_WAS_DEFINED LOG_ASSERT
+#undef LOG_ASSERT
+#endif
+
+#include <base/condition_variable.h>
+#include <base/lock.h>
+#include <base/message_loop_proxy.h>
+#include <base/ref_counted.h>
+#include <base/string_util.h>
+#include <base/thread.h>
+#include <base/tuple.h>
+#include <chrome/browser/net/sqlite_persistent_cookie_store.h>
+#include <net/base/cookie_monster.h>
+#include <net/base/data_url.h>
+#include <net/base/io_buffer.h>
+#include <net/base/ssl_config_service.h>
+#include <net/http/http_auth_handler_factory.h>
+#include <net/http/http_cache.h>
+#include <net/http/http_network_layer.h>
+#include <net/http/http_response_headers.h>
+#include <net/proxy/proxy_service.h>
+#include <net/url_request/url_request.h>
+#include <net/url_request/url_request_context.h>
+
+#undef LOG
+#if defined(LOG_WAS_DEFINED) && defined(LOG_PRI)
+#define LOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
+#endif
+
+#undef LOG_ASSERT
+#if defined(LOG_ASSERT_WAS_DEFINED) && defined(LOG_FATAL_IF)
+#define LOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ## __VA_ARGS__)
+#endif
+
+#endif
diff --git a/WebKit/android/WebCoreSupport/WebRequest.cpp b/WebKit/android/WebCoreSupport/WebRequest.cpp
index a712fb0..a5ff85d 100644
--- a/WebKit/android/WebCoreSupport/WebRequest.cpp
+++ b/WebKit/android/WebCoreSupport/WebRequest.cpp
@@ -33,10 +33,6 @@
#include "jni.h"
#include <cutils/log.h>
-#include <net/base/data_url.h>
-#include <net/base/io_buffer.h>
-#include <net/http/http_response_headers.h>
-#include <net/url_request/url_request.h>
#include <string>
#include <utils/AssetManager.h>
diff --git a/WebKit/android/WebCoreSupport/WebRequest.h b/WebKit/android/WebCoreSupport/WebRequest.h
index 26cfcbb..c5a101b 100644
--- a/WebKit/android/WebCoreSupport/WebRequest.h
+++ b/WebKit/android/WebCoreSupport/WebRequest.h
@@ -26,11 +26,9 @@
#ifndef WebRequest_h
#define WebRequest_h
+#include "ChromiumIncludes.h"
#include "WebUrlLoaderClient.h"
-#include <net/base/io_buffer.h>
-#include <net/url_request/url_request.h>
-
class MessageLoop;
namespace android {
diff --git a/WebKit/android/WebCoreSupport/WebRequestContext.cpp b/WebKit/android/WebCoreSupport/WebRequestContext.cpp
index 9a8c9a0..83e97fe 100644
--- a/WebKit/android/WebCoreSupport/WebRequestContext.cpp
+++ b/WebKit/android/WebCoreSupport/WebRequestContext.cpp
@@ -29,14 +29,6 @@
#include "JNIUtility.h"
#include "jni.h"
-#include <base/message_loop_proxy.h>
-#include <chrome/browser/net/sqlite_persistent_cookie_store.h>
-#include <net/base/cookie_monster.h>
-#include <net/base/ssl_config_service.h>
-#include <net/http/http_cache.h>
-#include <net/http/http_network_layer.h>
-#include <net/http/http_auth_handler_factory.h>
-#include <net/proxy/proxy_service.h>
#include <wtf/text/CString.h>
namespace {
diff --git a/WebKit/android/WebCoreSupport/WebRequestContext.h b/WebKit/android/WebCoreSupport/WebRequestContext.h
index a1f7973..e35d0ba 100644
--- a/WebKit/android/WebCoreSupport/WebRequestContext.h
+++ b/WebKit/android/WebCoreSupport/WebRequestContext.h
@@ -31,11 +31,9 @@
// a subclass of a chrome class.
#if USE(CHROME_NETWORK_STACK)
+#include "ChromiumIncludes.h"
#include "PlatformString.h"
-#include <net/http/http_cache.h>
-#include <net/url_request/url_request_context.h>
-
namespace android {
class WebRequestContext : public URLRequestContext {
diff --git a/WebKit/android/WebCoreSupport/WebResourceRequest.cpp b/WebKit/android/WebCoreSupport/WebResourceRequest.cpp
index f357119..edecf9c 100644
--- a/WebKit/android/WebCoreSupport/WebResourceRequest.cpp
+++ b/WebKit/android/WebCoreSupport/WebResourceRequest.cpp
@@ -28,7 +28,6 @@
#include "ResourceRequest.h"
-#include <base/string_util.h>
#include <wtf/text/CString.h>
namespace {
diff --git a/WebKit/android/WebCoreSupport/WebResourceRequest.h b/WebKit/android/WebCoreSupport/WebResourceRequest.h
index 6880340..774859d 100644
--- a/WebKit/android/WebCoreSupport/WebResourceRequest.h
+++ b/WebKit/android/WebCoreSupport/WebResourceRequest.h
@@ -26,7 +26,8 @@
#ifndef WebResourceRequest_h
#define WebResourceRequest_h
-#include <net/http/http_request_headers.h>
+#include "ChromiumIncludes.h"
+
#include <string>
namespace WebCore {
diff --git a/WebKit/android/WebCoreSupport/WebResponse.h b/WebKit/android/WebCoreSupport/WebResponse.h
index ea548d9..8fe65a8 100644
--- a/WebKit/android/WebCoreSupport/WebResponse.h
+++ b/WebKit/android/WebCoreSupport/WebResponse.h
@@ -26,10 +26,10 @@
#ifndef WebResponse_h
#define WebResponse_h
+#include "ChromiumIncludes.h"
#include "KURL.h"
#include <map>
-#include <net/url_request/url_request.h>
#include <string>
namespace WebCore {
diff --git a/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp b/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
index 80b1dbd..6e1aa76 100644
--- a/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
+++ b/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
@@ -34,11 +34,6 @@
#include "WebRequest.h"
#include "WebResourceRequest.h"
-#include <base/condition_variable.h>
-#include <base/lock.h>
-#include <base/thread.h>
-#include <net/base/io_buffer.h>
-
namespace android {
LoaderData::~LoaderData()
diff --git a/WebKit/android/WebCoreSupport/WebUrlLoaderClient.h b/WebKit/android/WebCoreSupport/WebUrlLoaderClient.h
index 1506e5e..1a8118c 100644
--- a/WebKit/android/WebCoreSupport/WebUrlLoaderClient.h
+++ b/WebKit/android/WebCoreSupport/WebUrlLoaderClient.h
@@ -26,12 +26,11 @@
#ifndef WebUrlLoaderClient_h
#define WebUrlLoaderClient_h
+#include "ChromiumIncludes.h"
#include "RefCounted.h"
#include "WebResponse.h"
#include "WebUrlLoader.h"
-#include <base/ref_counted.h>
-#include <base/tuple.h>
#include <string>
#include <deque>