summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-31 04:48:48 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-31 04:48:48 +0000
commitc80549f2dac0ca5a810488df65727011eb42271c (patch)
tree9d0b4190c8376ad0aa8b477f0558d6c5808c1b62 /net
parentf88de5bcdc2e370e1d25cdff6f40cb5adaccb255 (diff)
downloadchromium_src-c80549f2dac0ca5a810488df65727011eb42271c.zip
chromium_src-c80549f2dac0ca5a810488df65727011eb42271c.tar.gz
chromium_src-c80549f2dac0ca5a810488df65727011eb42271c.tar.bz2
Refactor: Address a TODO about renaming a function.
Review URL: http://codereview.chromium.org/3216008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57959 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/proxy/init_proxy_resolver.cc2
-rw-r--r--net/proxy/proxy_config.cc7
-rw-r--r--net/proxy/proxy_config.h15
-rw-r--r--net/proxy/proxy_service.cc6
4 files changed, 15 insertions, 15 deletions
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;