summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-12-15 16:35:18 +0000
committerKristian Monsen <kristianm@google.com>2010-12-15 16:45:12 +0000
commita27aeefa969a6478d8defe52be7526d611970b49 (patch)
treea3b79be2b2eb8558a085e1a565ef6c198be241b9
parente35d586e6546fcc07083b8988d6ceae5a18ee04f (diff)
downloadexternal_webkit-a27aeefa969a6478d8defe52be7526d611970b49.zip
external_webkit-a27aeefa969a6478d8defe52be7526d611970b49.tar.gz
external_webkit-a27aeefa969a6478d8defe52be7526d611970b49.tar.bz2
Adding proxy support to the Webkit layer
Right now it is only used as a direct proxy so no functional change. Change-Id: I69be139f6567ca0b34f051a1429b78395fe1a3fe
-rw-r--r--WebKit/android/WebCoreSupport/ChromiumIncludes.h1
-rw-r--r--WebKit/android/WebCoreSupport/WebCache.cpp3
-rw-r--r--WebKit/android/WebCoreSupport/WebCache.h4
3 files changed, 7 insertions, 1 deletions
diff --git a/WebKit/android/WebCoreSupport/ChromiumIncludes.h b/WebKit/android/WebCoreSupport/ChromiumIncludes.h
index 32966a4..8166eb7 100644
--- a/WebKit/android/WebCoreSupport/ChromiumIncludes.h
+++ b/WebKit/android/WebCoreSupport/ChromiumIncludes.h
@@ -72,6 +72,7 @@
#include <net/http/http_cache.h>
#include <net/http/http_network_layer.h>
#include <net/http/http_response_headers.h>
+#include <net/proxy/proxy_config_service_android.h>
#include <net/proxy/proxy_service.h>
#include <net/url_request/url_request.h>
#include <net/url_request/url_request_context.h>
diff --git a/WebKit/android/WebCoreSupport/WebCache.cpp b/WebKit/android/WebCoreSupport/WebCache.cpp
index d606f31..602395d 100644
--- a/WebKit/android/WebCoreSupport/WebCache.cpp
+++ b/WebKit/android/WebCoreSupport/WebCache.cpp
@@ -98,6 +98,7 @@ WebCache::WebCache(bool isPrivateBrowsing)
static const int kMaximumCacheSizeBytes = 20 * 1024 * 1024;
m_hostResolver = net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, 0, 0);
+ m_proxyConfigService = new ProxyConfigServiceAndroid();
net::HttpCache::BackendFactory* backendFactory;
if (isPrivateBrowsing)
backendFactory = net::HttpCache::DefaultBackend::InMemory(kMaximumCacheSizeBytes / 2);
@@ -108,7 +109,7 @@ WebCache::WebCache(bool isPrivateBrowsing)
m_cache = new net::HttpCache(m_hostResolver.get(),
0, // dnsrr_resolver
- net::ProxyService::CreateDirect(),
+ net::ProxyService::CreateWithoutProxyResolver(m_proxyConfigService, 0 /* net_log */),
net::SSLConfigService::CreateSystemSSLConfigService(),
net::HttpAuthHandlerFactory::CreateDefault(m_hostResolver.get()),
0, // network_delegate
diff --git a/WebKit/android/WebCoreSupport/WebCache.h b/WebKit/android/WebCoreSupport/WebCache.h
index 87d678e..a231eb8 100644
--- a/WebKit/android/WebCoreSupport/WebCache.h
+++ b/WebKit/android/WebCoreSupport/WebCache.h
@@ -43,6 +43,7 @@ public:
void clear();
net::HostResolver* hostResolver() { return m_hostResolver.get(); }
net::HttpCache* cache() { return m_cache.get(); }
+ net::ProxyConfigServiceAndroid* proxy() { return m_proxyConfigService; }
private:
WebCache(bool isPrivateBrowsing);
@@ -54,6 +55,9 @@ private:
OwnPtr<net::HostResolver> m_hostResolver;
OwnPtr<net::HttpCache> m_cache;
+ // This is owned by the ProxyService, which is owned by the HttpNetworkLayer,
+ // which is owned by the HttpCache, which is owned by this class.
+ net::ProxyConfigServiceAndroid* m_proxyConfigService;
// For clear()
net::CompletionCallbackImpl<WebCache> m_doomAllEntriesCallback;