OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/proxy/proxy_config_service_mac.h" | 5 #include "net/proxy/proxy_config_service_mac.h" |
6 | 6 |
7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
8 #include <SystemConfiguration/SystemConfiguration.h> | 8 #include <SystemConfiguration/SystemConfiguration.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 SCDynamicStoreRef store) { | 191 SCDynamicStoreRef store) { |
192 proxy_config_service_->SetDynamicStoreNotificationKeys(store); | 192 proxy_config_service_->SetDynamicStoreNotificationKeys(store); |
193 } | 193 } |
194 | 194 |
195 void ProxyConfigServiceMac::Forwarder::OnNetworkConfigChange( | 195 void ProxyConfigServiceMac::Forwarder::OnNetworkConfigChange( |
196 CFArrayRef changed_keys) { | 196 CFArrayRef changed_keys) { |
197 proxy_config_service_->OnNetworkConfigChange(changed_keys); | 197 proxy_config_service_->OnNetworkConfigChange(changed_keys); |
198 } | 198 } |
199 | 199 |
200 ProxyConfigServiceMac::ProxyConfigServiceMac( | 200 ProxyConfigServiceMac::ProxyConfigServiceMac( |
201 base::SingleThreadTaskRunner* io_thread_task_runner) | 201 const scoped_refptr<base::SingleThreadTaskRunner>& io_thread_task_runner) |
202 : forwarder_(this), | 202 : forwarder_(this), |
203 has_fetched_config_(false), | 203 has_fetched_config_(false), |
204 helper_(new Helper(this)), | 204 helper_(new Helper(this)), |
205 io_thread_task_runner_(io_thread_task_runner) { | 205 io_thread_task_runner_(io_thread_task_runner) { |
206 DCHECK(io_thread_task_runner_.get()); | 206 DCHECK(io_thread_task_runner_.get()); |
207 config_watcher_.reset(new NetworkConfigWatcherMac(&forwarder_)); | 207 config_watcher_.reset(new NetworkConfigWatcherMac(&forwarder_)); |
208 } | 208 } |
209 | 209 |
210 ProxyConfigServiceMac::~ProxyConfigServiceMac() { | 210 ProxyConfigServiceMac::~ProxyConfigServiceMac() { |
211 DCHECK(io_thread_task_runner_->BelongsToCurrentThread()); | 211 DCHECK(io_thread_task_runner_->BelongsToCurrentThread()); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 // Keep track of the last value we have seen. | 275 // Keep track of the last value we have seen. |
276 has_fetched_config_ = true; | 276 has_fetched_config_ = true; |
277 last_config_fetched_ = new_config; | 277 last_config_fetched_ = new_config; |
278 | 278 |
279 // Notify all the observers. | 279 // Notify all the observers. |
280 FOR_EACH_OBSERVER(Observer, observers_, | 280 FOR_EACH_OBSERVER(Observer, observers_, |
281 OnProxyConfigChanged(new_config, CONFIG_VALID)); | 281 OnProxyConfigChanged(new_config, CONFIG_VALID)); |
282 } | 282 } |
283 | 283 |
284 } // namespace net | 284 } // namespace net |
OLD | NEW |