summaryrefslogtreecommitdiffstats
path: root/net/proxy/polling_proxy_config_service.cc
diff options
context:
space:
mode:
authormnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-11 10:07:52 +0000
committermnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-11 10:07:52 +0000
commit3a29593d5ef0a3d243a2417eca5510d2abfd8c13 (patch)
tree604e27797785e9acb4c0dc42535cc836f939783c /net/proxy/polling_proxy_config_service.cc
parent24ac1426ea00b295174c9fbbf3b7b81396b74399 (diff)
downloadchromium_src-3a29593d5ef0a3d243a2417eca5510d2abfd8c13.zip
chromium_src-3a29593d5ef0a3d243a2417eca5510d2abfd8c13.tar.gz
chromium_src-3a29593d5ef0a3d243a2417eca5510d2abfd8c13.tar.bz2
Allow ProxyConfigService to report "no configuration set"
Introduce a ConfigAvailability enum such that ProxyConfigService is able to return configuration status at a finer granularity level. This allows to fall back to default values (potentially configured through policy) if the system service doesn't have configuration. BUG=none TEST=unit tests, recommended proxy policy works on CrOS. Review URL: http://codereview.chromium.org/6597070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81085 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/polling_proxy_config_service.cc')
-rw-r--r--net/proxy/polling_proxy_config_service.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/proxy/polling_proxy_config_service.cc b/net/proxy/polling_proxy_config_service.cc
index d80b4f2..b347bc5 100644
--- a/net/proxy/polling_proxy_config_service.cc
+++ b/net/proxy/polling_proxy_config_service.cc
@@ -121,7 +121,9 @@ class PollingProxyConfigService::Core
// If the configuration has changed, notify the observers.
has_config_ = true;
last_config_ = config;
- FOR_EACH_OBSERVER(Observer, observers_, OnProxyConfigChanged(config));
+ FOR_EACH_OBSERVER(Observer, observers_,
+ OnProxyConfigChanged(config,
+ ProxyConfigService::CONFIG_VALID));
}
if (poll_task_queued_)
@@ -162,8 +164,9 @@ void PollingProxyConfigService::RemoveObserver(Observer* observer) {
core_->RemoveObserver(observer);
}
-bool PollingProxyConfigService::GetLatestProxyConfig(ProxyConfig* config) {
- return core_->GetLatestProxyConfig(config);
+ProxyConfigService::ConfigAvailability
+ PollingProxyConfigService::GetLatestProxyConfig(ProxyConfig* config) {
+ return core_->GetLatestProxyConfig(config) ? CONFIG_VALID : CONFIG_PENDING;
}
void PollingProxyConfigService::OnLazyPoll() {