summaryrefslogtreecommitdiffstats
path: root/net/proxy/proxy_service.h
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-17 19:53:00 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-17 19:53:00 +0000
commit7258defe34a4482e53ed23d2e04bb8d4fe7b4002 (patch)
tree57606849c4e643f9c08337d431227276ebb6dadd /net/proxy/proxy_service.h
parent7ae3de9741146e4f429123e4980733be4c52e66d (diff)
downloadchromium_src-7258defe34a4482e53ed23d2e04bb8d4fe7b4002.zip
chromium_src-7258defe34a4482e53ed23d2e04bb8d4fe7b4002.tar.gz
chromium_src-7258defe34a4482e53ed23d2e04bb8d4fe7b4002.tar.bz2
Adds support for the DHCP portion of the WPAD (proxy auto-discovery) protocol.
This is Windows-only for now, and is disabled by default. Start Chrome with the flag --enable-dhcp-wpad to enable the feature. See discussion in comment on DhcpProxyScriptFetcherFactory for why this needs to be done in a per-platform way rather than cross-platform. The code is factored so that adding other platform implementations will be straight forward. Most of the implementation is stand-alone and extends the ScriptProxyFetcher class hierarchy (and makes its interface slightly more generic). The integration point into existing code is in InitProxyResolver, which previously handled fallback from DNS auto-detect to custom PAC URL and now does fallback from DHCP to DNS to custom PAC URL. BUG=18575 TEST=net_unittests has good coverage for the new and changed code, but manual tests on a network with a PAC URL configured in DHCP are also needed. Original commit r85646. Reverted (test failures on some release bots) r85648. Will reland with fix. Review URL: http://codereview.chromium.org/6831025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85661 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_service.h')
-rw-r--r--net/proxy/proxy_service.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h
index f7856e5..cee7ef6 100644
--- a/net/proxy/proxy_service.h
+++ b/net/proxy/proxy_service.h
@@ -25,6 +25,7 @@ class MessageLoop;
namespace net {
+class DhcpProxyScriptFetcher;
class HostResolver;
class InitProxyResolver;
class NetworkDelegate;
@@ -98,10 +99,12 @@ class ProxyService : public NetworkChangeNotifier::IPAddressObserver,
// Call this method with a non-null |pac_request| to cancel the PAC request.
void CancelPacRequest(PacRequest* pac_request);
- // Sets the ProxyScriptFetcher dependency. This is needed if the ProxyResolver
- // is of type ProxyResolverWithoutFetch. ProxyService takes ownership of
- // |proxy_script_fetcher|.
- void SetProxyScriptFetcher(ProxyScriptFetcher* proxy_script_fetcher);
+ // Sets the ProxyScriptFetcher and DhcpProxyScriptFetcher dependencies. This
+ // is needed if the ProxyResolver is of type ProxyResolverWithoutFetch.
+ // ProxyService takes ownership of both objects.
+ void SetProxyScriptFetchers(
+ ProxyScriptFetcher* proxy_script_fetcher,
+ DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher);
ProxyScriptFetcher* GetProxyScriptFetcher() const;
// Tells this ProxyService to start using a new ProxyConfigService to
@@ -161,6 +164,10 @@ class ProxyService : public NetworkChangeNotifier::IPAddressObserver,
// |proxy_script_fetcher| specifies the dependency to use for downloading
// any PAC scripts. The resulting ProxyService will take ownership of it.
//
+ // |dhcp_proxy_script_fetcher| specifies the dependency to use for attempting
+ // to retrieve the most appropriate PAC script configured in DHCP. The
+ // resulting ProxyService will take ownership of it.
+ //
// |host_resolver| points to the host resolving dependency the PAC script
// should use for any DNS queries. It must remain valid throughout the
// lifetime of the ProxyService.
@@ -174,6 +181,7 @@ class ProxyService : public NetworkChangeNotifier::IPAddressObserver,
ProxyConfigService* proxy_config_service,
size_t num_pac_threads,
ProxyScriptFetcher* proxy_script_fetcher,
+ DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher,
HostResolver* host_resolver,
NetLog* net_log,
NetworkDelegate* network_delegate);
@@ -319,6 +327,11 @@ class ProxyService : public NetworkChangeNotifier::IPAddressObserver,
// external PAC script fetching.
scoped_ptr<ProxyScriptFetcher> proxy_script_fetcher_;
+ // The fetcher to use when attempting to download the most appropriate PAC
+ // script configured in DHCP, if any. Can be NULL if the ProxyResolver has
+ // no need for DHCP PAC script fetching.
+ scoped_ptr<DhcpProxyScriptFetcher> dhcp_proxy_script_fetcher_;
+
// Callback for when |init_proxy_resolver_| is done.
CompletionCallbackImpl<ProxyService> init_proxy_resolver_callback_;