Chromium Code Reviews| Index: chrome/browser/net/pref_proxy_config_service.cc |
| diff --git a/chrome/browser/net/pref_proxy_config_service.cc b/chrome/browser/net/pref_proxy_config_service.cc |
| index 5cd62136945832d5832a5929d6f8a5615d6eb6fb..5a9f006a3d824c10c94b174d088195b19ac1822f 100644 |
| --- a/chrome/browser/net/pref_proxy_config_service.cc |
| +++ b/chrome/browser/net/pref_proxy_config_service.cc |
| @@ -38,13 +38,13 @@ void PrefProxyConfigTracker::DetachFromPrefService() { |
| } |
| void PrefProxyConfigTracker::AddObserver( |
| - PrefProxyConfigTracker::ObserverInterface* observer) { |
| + PrefProxyConfigTracker::Observer* observer) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| observers_.AddObserver(observer); |
| } |
| void PrefProxyConfigTracker::RemoveObserver( |
| - PrefProxyConfigTracker::ObserverInterface* observer) { |
| + PrefProxyConfigTracker::Observer* observer) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| observers_.RemoveObserver(observer); |
| } |
| @@ -70,12 +70,11 @@ void PrefProxyConfigTracker::Observe(NotificationType type, |
| void PrefProxyConfigTracker::InstallProxyConfig(const net::ProxyConfig& config, |
| bool valid) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| - if (valid_ != valid || !pref_config_.Equals(config)) { |
| + if (valid && (!valid_ || !pref_config_.Equals(config))) { |
|
eroman
2010/12/02 19:31:22
I don't think this is right, since it looks like w
eroman
2010/12/02 19:32:40
Oops my pseudo-code wasn't right either :-)
Let me
battre (please use the other)
2010/12/03 08:57:23
Done.
|
| valid_ = valid; |
| if (valid_) |
| pref_config_ = config; |
| - FOR_EACH_OBSERVER(ObserverInterface, observers_, |
| - OnPrefProxyConfigChanged()); |
| + FOR_EACH_OBSERVER(Observer, observers_, OnPrefProxyConfigChanged()); |
| } |
| } |
| @@ -169,9 +168,11 @@ void PrefProxyConfigService::RemoveObserver( |
| bool PrefProxyConfigService::GetLatestProxyConfig(net::ProxyConfig* config) { |
| RegisterObservers(); |
| - const net::ProxyConfig pref_config; |
| - if (pref_config_tracker_->GetProxyConfig(config)) |
| + net::ProxyConfig pref_config; |
| + if (pref_config_tracker_->GetProxyConfig(&pref_config)) { |
| + *config = pref_config; |
| return true; |
| + } |
| return base_service_->GetLatestProxyConfig(config); |
| } |