Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(874)

Unified Diff: net/proxy/proxy_service.cc

Issue 27365: Add a command line flag --v8-proxy-resolver, to select the new PAC implementa... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address wtc's comments Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« chrome/browser/debugger/debugger_shell.cc ('K') | « net/proxy/proxy_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_service.cc
===================================================================
--- net/proxy/proxy_service.cc (revision 10746)
+++ net/proxy/proxy_service.cc (working copy)
@@ -21,6 +21,7 @@
#include "net/proxy/proxy_resolver_mac.h"
#endif
#include "net/proxy/proxy_resolver.h"
+#include "net/proxy/proxy_resolver_v8.h"
using base::TimeDelta;
using base::TimeTicks;
@@ -214,6 +215,38 @@
}
// static
+ProxyService* ProxyService::CreateUsingV8Resolver(
+ const ProxyInfo* pi, URLRequestContext* url_request_context) {
+ if (pi) {
+ // The ProxyResolver is set to NULL, since it should never be called
+ // (because the configuration will never require PAC).
+ return new ProxyService(new ProxyConfigServiceFixed(*pi), NULL);
+ }
+
+ // Choose the system configuration service appropriate for each platform.
+ ProxyConfigService* config_service;
+#if defined(OS_WIN)
+ config_service = new ProxyConfigServiceWin();
+#elif defined(OS_MACOSX)
+ config_service = new ProxyConfigServiceMac();
+#else
+ // TODO(port): implement ProxyConfigServiceLinux.
+ // See: http://code.google.com/p/chromium/issues/detail?id=8143
+ return CreateNull();
+#endif
+
+ // Create a ProxyService that uses V8 to evaluate PAC scripts.
+ ProxyService* proxy_service = new ProxyService(
+ config_service, new ProxyResolverV8());
+
+ // Configure PAC script downloads to be issued using |url_request_context|.
+ proxy_service->SetProxyScriptFetcher(
+ ProxyScriptFetcher::Create(url_request_context));
+
+ return proxy_service;
+}
+
+// static
ProxyService* ProxyService::CreateNull() {
// The ProxyResolver is set to NULL, since it should never be called
// (because the configuration will never require PAC).
« chrome/browser/debugger/debugger_shell.cc ('K') | « net/proxy/proxy_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698