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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 parent_->OnProxyConfigChanged(new_config); | 181 parent_->OnProxyConfigChanged(new_config); |
182 } | 182 } |
183 | 183 |
184 private: | 184 private: |
185 friend class base::RefCountedThreadSafe<Helper>; | 185 friend class base::RefCountedThreadSafe<Helper>; |
186 ~Helper() {} | 186 ~Helper() {} |
187 | 187 |
188 ProxyConfigServiceMac* parent_; | 188 ProxyConfigServiceMac* parent_; |
189 }; | 189 }; |
190 | 190 |
| 191 void ProxyConfigServiceMac::Forwarder::SetDynamicStoreNotificationKeys( |
| 192 SCDynamicStoreRef store) { |
| 193 proxy_config_service_->SetDynamicStoreNotificationKeys(store); |
| 194 } |
| 195 |
| 196 void ProxyConfigServiceMac::Forwarder::OnNetworkConfigChange( |
| 197 CFArrayRef changed_keys) { |
| 198 proxy_config_service_->OnNetworkConfigChange(changed_keys); |
| 199 } |
| 200 |
191 ProxyConfigServiceMac::ProxyConfigServiceMac( | 201 ProxyConfigServiceMac::ProxyConfigServiceMac( |
192 base::SingleThreadTaskRunner* io_thread_task_runner) | 202 base::SingleThreadTaskRunner* io_thread_task_runner) |
193 : forwarder_(this), | 203 : forwarder_(this), |
194 has_fetched_config_(false), | 204 has_fetched_config_(false), |
195 helper_(new Helper(this)), | 205 helper_(new Helper(this)), |
196 io_thread_task_runner_(io_thread_task_runner) { | 206 io_thread_task_runner_(io_thread_task_runner) { |
197 DCHECK(io_thread_task_runner_); | 207 DCHECK(io_thread_task_runner_); |
198 config_watcher_.reset(new NetworkConfigWatcherMac(&forwarder_)); | 208 config_watcher_.reset(new NetworkConfigWatcherMac(&forwarder_)); |
199 } | 209 } |
200 | 210 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 // Keep track of the last value we have seen. | 276 // Keep track of the last value we have seen. |
267 has_fetched_config_ = true; | 277 has_fetched_config_ = true; |
268 last_config_fetched_ = new_config; | 278 last_config_fetched_ = new_config; |
269 | 279 |
270 // Notify all the observers. | 280 // Notify all the observers. |
271 FOR_EACH_OBSERVER(Observer, observers_, | 281 FOR_EACH_OBSERVER(Observer, observers_, |
272 OnProxyConfigChanged(new_config, CONFIG_VALID)); | 282 OnProxyConfigChanged(new_config, CONFIG_VALID)); |
273 } | 283 } |
274 | 284 |
275 } // namespace net | 285 } // namespace net |
OLD | NEW |