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

Side by Side Diff: net/proxy/proxy_config_service_mac.cc

Issue 540593002: Use scoped_refptr<SingleThreadTaskRunner> when initializing ProxyConfigService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « net/proxy/proxy_config_service_mac.h ('k') | net/proxy/proxy_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/proxy/proxy_config_service_mac.h ('k') | net/proxy/proxy_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698