diff options
-rw-r--r-- | chrome/browser/net/connection_tester.cc | 4 | ||||
-rw-r--r-- | chrome/browser/net/proxy_service_factory.cc | 4 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 8 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 2 | ||||
-rw-r--r-- | net/proxy/dhcp_proxy_script_fetcher_factory.cc | 4 | ||||
-rw-r--r-- | net/proxy/dhcp_proxy_script_fetcher_factory.h | 2 | ||||
-rw-r--r-- | net/proxy/dhcp_proxy_script_fetcher_factory_unittest.cc | 6 |
7 files changed, 16 insertions, 14 deletions
diff --git a/chrome/browser/net/connection_tester.cc b/chrome/browser/net/connection_tester.cc index 2cf1e42..4ca5b42 100644 --- a/chrome/browser/net/connection_tester.cc +++ b/chrome/browser/net/connection_tester.cc @@ -187,8 +187,8 @@ class ExperimentURLRequestContext : public net::URLRequestContext { net::DhcpProxyScriptFetcherFactory dhcp_factory; if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableDhcpWpad)) { - dhcp_factory.set_enabled(true); + switches::kDisableDhcpWpad)) { + dhcp_factory.set_enabled(false); } proxy_service->reset(net::ProxyService::CreateUsingV8ProxyResolver( diff --git a/chrome/browser/net/proxy_service_factory.cc b/chrome/browser/net/proxy_service_factory.cc index cf97923..898596eb 100644 --- a/chrome/browser/net/proxy_service_factory.cc +++ b/chrome/browser/net/proxy_service_factory.cc @@ -86,8 +86,8 @@ net::ProxyService* ProxyServiceFactory::CreateProxyService( net::ProxyService* proxy_service; if (use_v8) { net::DhcpProxyScriptFetcherFactory dhcp_factory; - if (command_line.HasSwitch(switches::kEnableDhcpWpad)) { - dhcp_factory.set_enabled(true); + if (command_line.HasSwitch(switches::kDisableDhcpWpad)) { + dhcp_factory.set_enabled(false); } proxy_service = net::ProxyService::CreateUsingV8ProxyResolver( diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 702b9a9..18206a4 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -202,6 +202,9 @@ const char kDisableConnectBackupJobs[] = "disable-connect-backup-jobs"; // Disables the custom JumpList on Windows 7. const char kDisableCustomJumpList[] = "disable-custom-jumplist"; +// Disables retrieval of PAC URLs from DHCP as per the WPAD standard. +const char kDisableDhcpWpad[] = "disable-dhcp-wpad"; + // Disable extensions. const char kDisableExtensions[] = "disable-extensions"; @@ -377,11 +380,6 @@ const char kEnableConnectBackupJobs[] = "enable-connect-backup-jobs"; // Enables web developers to create apps for Chrome without using crx packages. const char kEnableCrxlessWebApps[] = "enable-crxless-web-apps"; -// Enables retrieval of PAC URLs from DHCP as per the WPAD standard. Note -// that this feature is not supported on all platforms, and using the flag -// is a no-op on such platforms. -const char kEnableDhcpWpad[] = "enable-dhcp-wpad"; - // Enable DNS side checking of certificates. Still experimental, should only // be used by developers at the current time. const char kEnableDNSCertProvenanceChecking[] = diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index df33000..22dabc3 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -68,6 +68,7 @@ extern const char kDisableBackgroundNetworking[]; extern const char kDisableClientSidePhishingDetection[]; extern const char kDisableConnectBackupJobs[]; extern const char kDisableCustomJumpList[]; +extern const char kDisableDhcpWpad[]; extern const char kDisableExtensionsFileAccessCheck[]; extern const char kDisableExtensions[]; extern const char kDisableFlashSandbox[]; @@ -115,7 +116,6 @@ extern const char kEnableCompactNavigation[]; extern const char kEnableCompositeToTexture[]; extern const char kEnableConnectBackupJobs[]; extern const char kEnableCrxlessWebApps[]; -extern const char kEnableDhcpWpad[]; extern const char kEnableDNSCertProvenanceChecking[]; extern const char kEnableExperimentalExtensionApis[]; extern const char kEnableExtensionTimelineApi[]; diff --git a/net/proxy/dhcp_proxy_script_fetcher_factory.cc b/net/proxy/dhcp_proxy_script_fetcher_factory.cc index faedf86..01ede05 100644 --- a/net/proxy/dhcp_proxy_script_fetcher_factory.cc +++ b/net/proxy/dhcp_proxy_script_fetcher_factory.cc @@ -15,9 +15,7 @@ namespace net { DhcpProxyScriptFetcherFactory::DhcpProxyScriptFetcherFactory() : feature_enabled_(false) { - // TODO(joi): Change this default, and the comment on |set_enabled()|, - // when the time is right. - set_enabled(false); + set_enabled(true); } DhcpProxyScriptFetcher* DhcpProxyScriptFetcherFactory::Create( diff --git a/net/proxy/dhcp_proxy_script_fetcher_factory.h b/net/proxy/dhcp_proxy_script_fetcher_factory.h index 02f1dcd..273f321 100644 --- a/net/proxy/dhcp_proxy_script_fetcher_factory.h +++ b/net/proxy/dhcp_proxy_script_fetcher_factory.h @@ -47,7 +47,7 @@ class NET_API DhcpProxyScriptFetcherFactory { // Attempts to enable/disable the DHCP WPAD feature. Does nothing // if |IsSupported()| returns false. // - // The current default is |enabled() == false|. + // The default is |enabled() == true|. void set_enabled(bool enabled); // Returns true if the DHCP WPAD feature is enabled. Always returns diff --git a/net/proxy/dhcp_proxy_script_fetcher_factory_unittest.cc b/net/proxy/dhcp_proxy_script_fetcher_factory_unittest.cc index 902a41b..97730bc 100644 --- a/net/proxy/dhcp_proxy_script_fetcher_factory_unittest.cc +++ b/net/proxy/dhcp_proxy_script_fetcher_factory_unittest.cc @@ -9,8 +9,10 @@ namespace net { namespace { + TEST(DhcpProxyScriptFetcherFactoryTest, DoNothingWhenDisabled) { DhcpProxyScriptFetcherFactory factory; + factory.set_enabled(false); scoped_ptr<DhcpProxyScriptFetcher> fetcher(factory.Create(NULL)); EXPECT_EQ("", fetcher->GetFetcherName()); } @@ -36,7 +38,11 @@ TEST(DhcpProxyScriptFetcherFactoryTest, IsSupported) { TEST(DhcpProxyScriptFetcherFactoryTest, SetEnabled) { DhcpProxyScriptFetcherFactory factory; +#if defined(OS_WIN) + EXPECT_TRUE(factory.enabled()); +#else EXPECT_FALSE(factory.enabled()); +#endif // defined(OS_WIN) factory.set_enabled(false); EXPECT_FALSE(factory.enabled()); |