Chromium Code Reviews| Index: components/proxy_config/pref_proxy_config_tracker_impl.cc |
| diff --git a/components/proxy_config/pref_proxy_config_tracker_impl.cc b/components/proxy_config/pref_proxy_config_tracker_impl.cc |
| index f8077aa9032038126769864d3a64ebc23e3f82f1..dce10933491fe9e3e7265c5021ca3ab9572bc10b 100644 |
| --- a/components/proxy_config/pref_proxy_config_tracker_impl.cc |
| +++ b/components/proxy_config/pref_proxy_config_tracker_impl.cc |
| @@ -24,10 +24,12 @@ |
| //============================= ProxyConfigServiceImpl ======================= |
| ProxyConfigServiceImpl::ProxyConfigServiceImpl( |
| - net::ProxyConfigService* base_service) |
| + net::ProxyConfigService* base_service, |
| + ProxyPrefs::ConfigState initial_config_state, |
| + const net::ProxyConfig& initial_config) |
| : base_service_(base_service), |
| - pref_config_state_(ProxyPrefs::CONFIG_UNSET), |
| - pref_config_read_pending_(true), |
| + pref_config_state_(initial_config_state), |
| + pref_config_(initial_config), |
| registered_observer_(false) { |
| // ProxyConfigServiceImpl is created on the UI thread, but used on the network |
| // thread. |
| @@ -54,9 +56,6 @@ net::ProxyConfigService::ConfigAvailability |
| ProxyConfigServiceImpl::GetLatestProxyConfig(net::ProxyConfig* config) { |
| RegisterObserver(); |
| - if (pref_config_read_pending_) |
| - return net::ProxyConfigService::CONFIG_PENDING; |
| - |
| // Ask the base service if available. |
| net::ProxyConfig system_config; |
| ConfigAvailability system_availability = |
| @@ -79,7 +78,6 @@ void ProxyConfigServiceImpl::UpdateProxyConfig( |
| ProxyPrefs::ConfigState config_state, |
| const net::ProxyConfig& config) { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| - pref_config_read_pending_ = false; |
| pref_config_state_ = config_state; |
| pref_config_ = config; |
| @@ -109,7 +107,7 @@ void ProxyConfigServiceImpl::OnProxyConfigChanged( |
| // Check whether there is a proxy configuration defined by preferences. In |
| // this case that proxy configuration takes precedence and the change event |
| - // from the delegate proxy service can be disregarded. |
| + // from the delegate proxy config service can be disregarded. |
| if (!PrefProxyConfigTrackerImpl::PrefPrecedes(pref_config_state_)) { |
| net::ProxyConfig actual_config; |
| availability = GetLatestProxyConfig(&actual_config); |
| @@ -149,12 +147,11 @@ PrefProxyConfigTrackerImpl::~PrefProxyConfigTrackerImpl() { |
| std::unique_ptr<net::ProxyConfigService> |
| PrefProxyConfigTrackerImpl::CreateTrackingProxyConfigService( |
|
eroman
2017/05/12 21:12:59
The interface for CreateTrackingProxyConfigService
mmenke
2017/05/12 21:29:57
Done (Docs added to PrefProxyConfigTracker)
|
| std::unique_ptr<net::ProxyConfigService> base_service) { |
| - proxy_config_service_impl_ = |
| - new ProxyConfigServiceImpl(base_service.release()); |
| + proxy_config_service_impl_ = new ProxyConfigServiceImpl( |
| + base_service.release(), config_state_, pref_config_); |
| VLOG(1) << this << ": set chrome proxy config service to " |
| << proxy_config_service_impl_; |
| - if (proxy_config_service_impl_ && update_pending_) |
| - OnProxyConfigChanged(config_state_, pref_config_); |
| + update_pending_ = false; |
| return std::unique_ptr<net::ProxyConfigService>(proxy_config_service_impl_); |
| } |