Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: net/proxy/proxy_config_service_linux.cc

Issue 6597070: Allow ProxyConfigService to report "no configuration set" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Eric's comments. Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/proxy/proxy_config_service_linux.h ('k') | net/proxy/proxy_config_service_linux_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_config_service_linux.cc
diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc
index 893a8e5d86e1788f0a3f32930d8f0a1be4d68e26..8392d963ca26267fcd505d4dc32566f4997a27de 100644
--- a/net/proxy/proxy_config_service_linux.cc
+++ b/net/proxy/proxy_config_service_linux.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -22,13 +22,13 @@
#include "base/file_util.h"
#include "base/logging.h"
#include "base/message_loop.h"
+#include "base/nix/xdg_util.h"
#include "base/string_number_conversions.h"
#include "base/string_tokenizer.h"
#include "base/string_util.h"
#include "base/task.h"
#include "base/threading/thread_restrictions.h"
#include "base/timer.h"
-#include "base/nix/xdg_util.h"
#include "googleurl/src/url_canon.h"
#include "net/base/net_errors.h"
#include "net/http/http_util.h"
@@ -1166,8 +1166,9 @@ void ProxyConfigServiceLinux::Delegate::RemoveObserver(Observer* observer) {
observers_.RemoveObserver(observer);
}
-bool ProxyConfigServiceLinux::Delegate::GetLatestProxyConfig(
- ProxyConfig* config) {
+ProxyConfigService::ConfigAvailability
+ ProxyConfigServiceLinux::Delegate::GetLatestProxyConfig(
+ ProxyConfig* config) {
// This is called from the IO thread.
DCHECK(!io_loop_ || MessageLoop::current() == io_loop_);
@@ -1176,12 +1177,12 @@ bool ProxyConfigServiceLinux::Delegate::GetLatestProxyConfig(
*config = cached_config_.is_valid() ?
cached_config_ : ProxyConfig::CreateDirect();
- // We return true to indicate that *config was filled in. It is always
+ // We return CONFIG_VALID to indicate that *config was filled in. It is always
// going to be available since we initialized eagerly on the UI thread.
// TODO(eroman): do lazy initialization instead, so we no longer need
// to construct ProxyConfigServiceLinux on the UI thread.
// In which case, we may return false here.
- return true;
+ return CONFIG_VALID;
}
// Depending on the GConfSettingGetter in use, this method will be called
@@ -1215,7 +1216,9 @@ void ProxyConfigServiceLinux::Delegate::SetNewProxyConfig(
DCHECK(MessageLoop::current() == io_loop_);
VLOG(1) << "Proxy configuration changed";
cached_config_ = new_config;
- FOR_EACH_OBSERVER(Observer, observers_, OnProxyConfigChanged(new_config));
+ FOR_EACH_OBSERVER(
+ Observer, observers_,
+ OnProxyConfigChanged(new_config, ProxyConfigService::CONFIG_VALID));
}
void ProxyConfigServiceLinux::Delegate::PostDestroyTask() {
@@ -1269,7 +1272,8 @@ void ProxyConfigServiceLinux::RemoveObserver(Observer* observer) {
delegate_->RemoveObserver(observer);
}
-bool ProxyConfigServiceLinux::GetLatestProxyConfig(ProxyConfig* config) {
+ProxyConfigService::ConfigAvailability
+ ProxyConfigServiceLinux::GetLatestProxyConfig(ProxyConfig* config) {
return delegate_->GetLatestProxyConfig(config);
}
« no previous file with comments | « net/proxy/proxy_config_service_linux.h ('k') | net/proxy/proxy_config_service_linux_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698