summaryrefslogtreecommitdiffstats
path: root/net/proxy
diff options
context:
space:
mode:
Diffstat (limited to 'net/proxy')
-rw-r--r--net/proxy/proxy_service.cc7
-rw-r--r--net/proxy/proxy_service.h5
2 files changed, 10 insertions, 2 deletions
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index 644daad..8584a25 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -460,6 +460,13 @@ ProxyService* ProxyService::CreateFixed(const ProxyConfig& pc) {
}
// static
+ProxyService* ProxyService::CreateFixed(const std::string& proxy) {
+ net::ProxyConfig proxy_config;
+ proxy_config.proxy_rules().ParseFromString(proxy);
+ return ProxyService::CreateFixed(proxy_config);
+}
+
+// static
ProxyService* ProxyService::CreateDirect() {
// Use direct connections.
return new ProxyService(new ProxyConfigServiceDirect, new ProxyResolverNull,
diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h
index 0b8f873..951cd2a 100644
--- a/net/proxy/proxy_service.h
+++ b/net/proxy/proxy_service.h
@@ -181,9 +181,10 @@ class ProxyService : public base::RefCountedThreadSafe<ProxyService>,
ProxyConfigService* proxy_config_service,
NetLog* net_log);
- // Convenience method that creates a proxy service using the
- // specified fixed settings. |pc| must not be NULL.
+ // Convenience methods that creates a proxy service using the
+ // specified fixed settings.
static ProxyService* CreateFixed(const ProxyConfig& pc);
+ static ProxyService* CreateFixed(const std::string& proxy);
// Creates a proxy service that uses a DIRECT connection for all requests.
static ProxyService* CreateDirect();