summaryrefslogtreecommitdiffstats
path: root/WebKit/android/WebCoreSupport/WebRequestContext.h
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-03-22 18:15:40 +0000
committerKristian Monsen <kristianm@google.com>2010-07-15 11:27:25 +0100
commitf48006ff278822e558c43fa7d6635f0ff34342b6 (patch)
tree92392399395fb3bce4566ae9bbd5e33fccce6970 /WebKit/android/WebCoreSupport/WebRequestContext.h
parentfd88d7ed6810e08b8d8c4512effc4da5e9c08265 (diff)
downloadexternal_webkit-f48006ff278822e558c43fa7d6635f0ff34342b6.zip
external_webkit-f48006ff278822e558c43fa7d6635f0ff34342b6.tar.gz
external_webkit-f48006ff278822e558c43fa7d6635f0ff34342b6.tar.bz2
Initial check-in of the external/webkit part of the chrome http stack.
There are no changes in WebCore anymore, the new files live in WebKit/android/WebCoreSupport. There are two WebCore functions implemented in WebUrlLoader.cpp, they are one-liners that call a WebKit function or return a bool. Only async downloads are implemented so far. There are crashes on some websites, but better to get things checked in, and then start fixing outstanding issues. I have tried to address all the issues from the reviews, but since the code has changed a bit I have not replied to each of them. Change-Id: Ie83798e2f82ce78cb00ee5a4a558c9d8085c9567
Diffstat (limited to 'WebKit/android/WebCoreSupport/WebRequestContext.h')
-rw-r--r--WebKit/android/WebCoreSupport/WebRequestContext.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/WebKit/android/WebCoreSupport/WebRequestContext.h b/WebKit/android/WebCoreSupport/WebRequestContext.h
new file mode 100644
index 0000000..65a0865
--- /dev/null
+++ b/WebKit/android/WebCoreSupport/WebRequestContext.h
@@ -0,0 +1,52 @@
+/*
+ * 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 WebRequestContext_h
+#define WebRequestContext_h
+
+#include "net/http/http_cache.h"
+#include "net/url_request/url_request_context.h"
+
+namespace android {
+
+class WebRequestContext : public URLRequestContext {
+public:
+ virtual const std::string& GetUserAgent(const GURL& url) const;
+ static WebRequestContext* GetAndroidContext();
+private:
+ static const std::string* GetDataDirectory();
+ WebRequestContext();
+ ~WebRequestContext();
+
+ // Caching this query from java
+ static std::string* s_dataDirectory;
+
+ // Not deleted on deletion of URLRequest
+ static net::HttpCache* s_cache;
+};
+
+} // namespace android
+
+#endif