diff options
-rw-r--r-- | chrome/browser/net/preconnect.cc | 2 | ||||
-rw-r--r-- | net/proxy/init_proxy_resolver.cc | 2 | ||||
-rw-r--r-- | net/proxy/proxy_config.cc | 7 | ||||
-rw-r--r-- | net/proxy/proxy_config.h | 15 | ||||
-rw-r--r-- | net/proxy/proxy_service.cc | 6 |
5 files changed, 16 insertions, 16 deletions
diff --git a/chrome/browser/net/preconnect.cc b/chrome/browser/net/preconnect.cc index c3c01eb..739f225 100644 --- a/chrome/browser/net/preconnect.cc +++ b/chrome/browser/net/preconnect.cc @@ -86,7 +86,7 @@ void Preconnect::Connect(const GURL& url) { if (!proxy_service->fetched_config().is_valid()) { HistogramPreconnectStatus(PROXY_UNINITIALIZED); } else { - if (proxy_service->fetched_config().MayRequirePACResolver()) { + if (proxy_service->fetched_config().HasAutomaticSettings()) { HistogramPreconnectStatus(PROXY_PAC_RESOLVER); return; } diff --git a/net/proxy/init_proxy_resolver.cc b/net/proxy/init_proxy_resolver.cc index 1046173..368fcf0 100644 --- a/net/proxy/init_proxy_resolver.cc +++ b/net/proxy/init_proxy_resolver.cc @@ -46,7 +46,7 @@ int InitProxyResolver::Init(const ProxyConfig& config, CompletionCallback* callback) { DCHECK_EQ(STATE_NONE, next_state_); DCHECK(callback); - DCHECK(config.MayRequirePACResolver()); + DCHECK(config.HasAutomaticSettings()); net_log_.BeginEvent(NetLog::TYPE_INIT_PROXY_RESOLVER, NULL); diff --git a/net/proxy/proxy_config.cc b/net/proxy/proxy_config.cc index 477bb85..1337ec9e 100644 --- a/net/proxy/proxy_config.cc +++ b/net/proxy/proxy_config.cc @@ -161,10 +161,15 @@ bool ProxyConfig::Equals(const ProxyConfig& other) const { proxy_rules_.Equals(other.proxy_rules()); } -bool ProxyConfig::MayRequirePACResolver() const { +bool ProxyConfig::HasAutomaticSettings() const { return auto_detect_ || has_pac_url(); } +void ProxyConfig::ClearAutomaticSettings() { + auto_detect_ = false; + pac_url_ = GURL(); +} + Value* ProxyConfig::ToValue() const { DictionaryValue* dict = new DictionaryValue(); diff --git a/net/proxy/proxy_config.h b/net/proxy/proxy_config.h index 3d4190b..56a58ba 100644 --- a/net/proxy/proxy_config.h +++ b/net/proxy/proxy_config.h @@ -118,16 +118,11 @@ class ProxyConfig { // Returns true if the given config is equivalent to this config. bool Equals(const ProxyConfig& other) const; - // Returns true if this config could possibly require the proxy service to - // use a PAC resolver. - // TODO(eroman): rename to HasAutomaticSettings() for consistency with - // ClearAutomaticSettings(). - bool MayRequirePACResolver() const; - - void ClearAutomaticSettings() { - auto_detect_ = false; - pac_url_ = GURL(); - } + // Returns true if this config contains any "automatic" settings. See the + // class description for what that means. + bool HasAutomaticSettings() const; + + void ClearAutomaticSettings(); // Creates a Value dump of this configuration. The caller is responsible for // deleting the returned value. diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc index 9eedabb..ae180a0 100644 --- a/net/proxy/proxy_service.cc +++ b/net/proxy/proxy_service.cc @@ -505,7 +505,7 @@ int ProxyService::TryToCompleteSynchronously(const GURL& url, DCHECK_NE(config_.id(), ProxyConfig::INVALID_ID); - if (config_.MayRequirePACResolver()) + if (config_.HasAutomaticSettings()) return ERR_IO_PENDING; // Must submit the request to the proxy resolver. // Use the manual proxy settings. @@ -583,7 +583,7 @@ void ProxyService::ApplyProxyConfigIfAvailable() { void ProxyService::OnInitProxyResolverComplete(int result) { DCHECK_EQ(STATE_WAITING_FOR_INIT_PROXY_RESOLVER, current_state_); DCHECK(init_proxy_resolver_.get()); - DCHECK(fetched_config_.MayRequirePACResolver()); + DCHECK(fetched_config_.HasAutomaticSettings()); init_proxy_resolver_.reset(); if (result != OK) { @@ -785,7 +785,7 @@ void ProxyService::OnProxyConfigChanged(const ProxyConfig& config) { params); } - if (!fetched_config_.MayRequirePACResolver()) { + if (!fetched_config_.HasAutomaticSettings()) { config_ = fetched_config_; SetReady(); return; |