summaryrefslogtreecommitdiffstats
path: root/net/proxy
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-23 23:52:57 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-23 23:52:57 +0000
commit2fb62920c987513f7b5f041c99be5a8ed09888ec (patch)
tree7c0355bb9fb4ecae13aeecc572a8261e94d89436 /net/proxy
parent24d5cc6bb1328948d7a0658a7fa3acf6de5b91f8 (diff)
downloadchromium_src-2fb62920c987513f7b5f041c99be5a8ed09888ec.zip
chromium_src-2fb62920c987513f7b5f041c99be5a8ed09888ec.tar.gz
chromium_src-2fb62920c987513f7b5f041c99be5a8ed09888ec.tar.bz2
Create a URLRequestContext for PAC fetching.
Originally I was going to create a single "system" URLRequestContext. I realized that was wrong, I need one for proxy script fetching that uses a direct ProxyService. This way, we don't have the circular dependencies for URLRequestContext(A)=>ProxyService=>ProxyScriptFetcherImpl=>URLRequestContext(A). Instead, we have URLRequestContext(A)=>ProxyService=>ProxyScriptFetcherImpl=>URLRequestContext(special one for proxy). This also exposes some setters in URLRequestContext that were in ChromeURLRequestContext. I guess this makes URLRequestContext a bit more "dangerous" since it could be mutated during runtime, but really we should probably pass around a const URLRequestContext within the network stack. I've filed http://crbug.com/67597 to track this. BUG=67232 TEST=none Review URL: http://codereview.chromium.org/5961005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70116 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy')
-rw-r--r--net/proxy/proxy_service.cc6
-rw-r--r--net/proxy/proxy_service.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index f321ef03..13d049e 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -468,9 +468,13 @@ ProxyService* ProxyService::CreateFixed(const std::string& proxy) {
// static
ProxyService* ProxyService::CreateDirect() {
+ return CreateDirectWithNetLog(NULL);
+}
+
+ProxyService* ProxyService::CreateDirectWithNetLog(NetLog* net_log) {
// Use direct connections.
return new ProxyService(new ProxyConfigServiceDirect, new ProxyResolverNull,
- NULL);
+ net_log);
}
// static
diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h
index 8a161ea..ba56f4d6 100644
--- a/net/proxy/proxy_service.h
+++ b/net/proxy/proxy_service.h
@@ -193,6 +193,8 @@ class ProxyService : public base::RefCountedThreadSafe<ProxyService>,
// Creates a proxy service that uses a DIRECT connection for all requests.
static ProxyService* CreateDirect();
+ // |net_log|'s lifetime must exceed ProxyService.
+ static ProxyService* CreateDirectWithNetLog(NetLog* net_log);
// This method is used by tests to create a ProxyService that returns a
// hardcoded proxy fallback list (|pac_string|) for every URL.