diff options
-rw-r--r-- | WebKit/android/WebCoreSupport/ChromiumIncludes.h | 76 | ||||
-rw-r--r-- | WebKit/android/WebCoreSupport/WebRequest.cpp | 4 | ||||
-rw-r--r-- | WebKit/android/WebCoreSupport/WebRequest.h | 4 | ||||
-rw-r--r-- | WebKit/android/WebCoreSupport/WebRequestContext.cpp | 8 | ||||
-rw-r--r-- | WebKit/android/WebCoreSupport/WebRequestContext.h | 4 | ||||
-rw-r--r-- | WebKit/android/WebCoreSupport/WebResourceRequest.cpp | 1 | ||||
-rw-r--r-- | WebKit/android/WebCoreSupport/WebResourceRequest.h | 3 | ||||
-rw-r--r-- | WebKit/android/WebCoreSupport/WebResponse.h | 2 | ||||
-rw-r--r-- | WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp | 5 | ||||
-rw-r--r-- | WebKit/android/WebCoreSupport/WebUrlLoaderClient.h | 3 | ||||
-rw-r--r-- | WebKitTools/DumpRenderTree/android/view_source.php | 53 |
11 files changed, 135 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> diff --git a/WebKitTools/DumpRenderTree/android/view_source.php b/WebKitTools/DumpRenderTree/android/view_source.php new file mode 100644 index 0000000..dfe6d12 --- /dev/null +++ b/WebKitTools/DumpRenderTree/android/view_source.php @@ -0,0 +1,53 @@ +<?php +# Copyright (C) 2010 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +############################################################################### + +# Show the source of the test. +# +# Usage: +# view_source.php?src=PATH +# where +# PATH - relative path in the LayoutTests dir + + # Global variables + # The server document root is LayoutTests/http/tests. See run_apache2.py. + $rootDir = realpath($_SERVER['DOCUMENT_ROOT'] . '..' . DIRECTORY_SEPARATOR . '..'); + + function getAbsolutePath($relPath) { + global $rootDir; + return $rootDir . DIRECTORY_SEPARATOR . $relPath; + } + + function main() { + global $rootDir; + + # Very primitive check if path tries to go above DOCUMENT_ROOT or is absolute + if (strpos($_GET['src'], "..") !== False || + substr($_GET['src'], 0, 1) == DIRECTORY_SEPARATOR) { + return; + } + + #If we don't want realpath to append any prefixes we need to pass it an absolute path + $src = realpath(getAbsolutePath($_GET['src'])); + + echo "<html><body>"; + # TODO: Add link following and syntax highlighting for html and js. + echo highlight_string(file_get_contents($src)); + echo "</body></html>"; + } + + main(); +?> |