summaryrefslogtreecommitdiffstats
path: root/net/proxy
diff options
context:
space:
mode:
Diffstat (limited to 'net/proxy')
-rw-r--r--net/proxy/proxy_config_service_fixed.h1
-rw-r--r--net/proxy/proxy_service.cc11
-rw-r--r--net/proxy/proxy_service.h24
3 files changed, 14 insertions, 22 deletions
diff --git a/net/proxy/proxy_config_service_fixed.h b/net/proxy/proxy_config_service_fixed.h
index 361c2b4..54fd9ac 100644
--- a/net/proxy/proxy_config_service_fixed.h
+++ b/net/proxy/proxy_config_service_fixed.h
@@ -5,6 +5,7 @@
#ifndef NET_PROXY_PROXY_CONFIG_SERVICE_FIXED_H_
#define NET_PROXY_PROXY_CONFIG_SERVICE_FIXED_H_
+#include "net/base/net_errors.h"
#include "net/proxy/proxy_config_service.h"
namespace net {
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index 6d881be..c74f6de 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -212,15 +212,10 @@ ProxyService::ProxyService(ProxyConfigService* config_service,
// static
ProxyService* ProxyService::Create(
- const ProxyConfig* pc,
+ ProxyConfigService* proxy_config_service,
bool use_v8_resolver,
URLRequestContext* url_request_context,
- MessageLoop* io_loop, MessageLoop* file_loop) {
- // Choose the system configuration service appropriate for each platform.
- ProxyConfigService* proxy_config_service = pc ?
- new ProxyConfigServiceFixed(*pc) :
- CreateSystemProxyConfigService(io_loop, file_loop);
-
+ MessageLoop* io_loop) {
ProxyResolver* proxy_resolver;
if (use_v8_resolver) {
@@ -253,7 +248,7 @@ ProxyService* ProxyService::Create(
// static
ProxyService* ProxyService::CreateFixed(const ProxyConfig& pc) {
- return Create(&pc, false, NULL, NULL, NULL);
+ return Create(new ProxyConfigServiceFixed(pc), false, NULL, NULL);
}
// static
diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h
index c5c4516..d7ed7ab 100644
--- a/net/proxy/proxy_service.h
+++ b/net/proxy/proxy_service.h
@@ -120,29 +120,25 @@ class ProxyService : public base::RefCountedThreadSafe<ProxyService> {
return config_;
}
- // Creates a proxy service using the specified settings. If |pc| is NULL then
- // the system's default proxy settings will be used (on Windows this will
- // use IE's settings).
+ // Creates a proxy service that polls |proxy_config_service| to notice when
+ // the proxy settings change. We take ownership of |proxy_config_service|.
// Iff |use_v8_resolver| is true, then the V8 implementation is
// used.
// |url_request_context| is only used when use_v8_resolver is true:
// it specifies the URL request context that will be used if a PAC
// script needs to be fetched.
// |io_loop| points to the IO thread's message loop. It is only used
- // when pc is NULL. If both pc and io_loop are NULL, then monitoring
- // of proxy setting changes will be disabled in ProxyConfigServiceLinux.
- // |file_loop| points to the file thread's message loop. It is used
- // to read any files necessary to get proxy settings.
+ // when pc is NULL.
// ##########################################################################
// # See the warnings in net/proxy/proxy_resolver_v8.h describing the
// # multi-threading model. In order for this to be safe to use, *ALL* the
// # other V8's running in the process must use v8::Locker.
// ##########################################################################
static ProxyService* Create(
- const ProxyConfig* pc,
+ ProxyConfigService* proxy_config_service,
bool use_v8_resolver,
URLRequestContext* url_request_context,
- MessageLoop* io_loop, MessageLoop* file_loop);
+ MessageLoop* io_loop);
// Convenience method that creates a proxy service using the
// specified fixed settings. |pc| must not be NULL.
@@ -152,6 +148,11 @@ class ProxyService : public base::RefCountedThreadSafe<ProxyService> {
// so it falls back to direct connect.
static ProxyService* CreateNull();
+ // Creates a config service appropriate for this platform that fetches the
+ // system proxy settings.
+ static ProxyConfigService* CreateSystemProxyConfigService(
+ MessageLoop* io_loop, MessageLoop* file_loop);
+
private:
FRIEND_TEST(ProxyServiceTest, IsLocalName);
FRIEND_TEST(ProxyServiceTest, UpdateConfigAfterFailedAutodetect);
@@ -163,11 +164,6 @@ class ProxyService : public base::RefCountedThreadSafe<ProxyService> {
// which expects requests to finish in the order they were added.
typedef std::vector<scoped_refptr<PacRequest> > PendingRequests;
- // Creates a config service appropriate for this platform that fetches the
- // system proxy settings.
- static ProxyConfigService* CreateSystemProxyConfigService(
- MessageLoop* io_loop, MessageLoop* file_loop);
-
// Creates a proxy resolver appropriate for this platform that doesn't rely
// on V8.
static ProxyResolver* CreateNonV8ProxyResolver();