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

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

Issue 3855001: Move scoped_cftyperef from base to base/mac, use the new namespace, and name ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « net/base/x509_certificate_mac.cc ('k') | net/proxy/proxy_resolver_mac.cc » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/logging.h" 10 #include "base/logging.h"
11 #include "base/mac_util.h" 11 #include "base/mac_util.h"
12 #include "base/scoped_cftyperef.h" 12 #include "base/mac/scoped_cftyperef.h"
13 #include "base/sys_string_conversions.h" 13 #include "base/sys_string_conversions.h"
14 #include "net/base/net_errors.h" 14 #include "net/base/net_errors.h"
15 #include "net/proxy/proxy_config.h" 15 #include "net/proxy/proxy_config.h"
16 #include "net/proxy/proxy_info.h" 16 #include "net/proxy/proxy_info.h"
17 #include "net/proxy/proxy_server.h" 17 #include "net/proxy/proxy_server.h"
18 18
19 namespace net { 19 namespace net {
20 20
21 namespace { 21 namespace {
22 22
(...skipping 10 matching lines...) Expand all
33 return default_value; 33 return default_value;
34 34
35 int int_value; 35 int int_value;
36 if (CFNumberGetValue(number, kCFNumberIntType, &int_value)) 36 if (CFNumberGetValue(number, kCFNumberIntType, &int_value))
37 return int_value; 37 return int_value;
38 else 38 else
39 return default_value; 39 return default_value;
40 } 40 }
41 41
42 void GetCurrentProxyConfig(ProxyConfig* config) { 42 void GetCurrentProxyConfig(ProxyConfig* config) {
43 scoped_cftyperef<CFDictionaryRef> config_dict( 43 base::mac::ScopedCFTypeRef<CFDictionaryRef> config_dict(
44 SCDynamicStoreCopyProxies(NULL)); 44 SCDynamicStoreCopyProxies(NULL));
45 DCHECK(config_dict); 45 DCHECK(config_dict);
46 46
47 // auto-detect 47 // auto-detect
48 48
49 // There appears to be no UI for this configuration option, and we're not sure 49 // There appears to be no UI for this configuration option, and we're not sure
50 // if Apple's proxy code even takes it into account. But the constant is in 50 // if Apple's proxy code even takes it into account. But the constant is in
51 // the header file so we'll use it. 51 // the header file so we'll use it.
52 config->set_auto_detect( 52 config->set_auto_detect(
53 GetBoolFromDictionary(config_dict.get(), 53 GetBoolFromDictionary(config_dict.get(),
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 259
260 // Keep track of the last value we have seen. 260 // Keep track of the last value we have seen.
261 has_fetched_config_ = true; 261 has_fetched_config_ = true;
262 last_config_fetched_ = new_config; 262 last_config_fetched_ = new_config;
263 263
264 // Notify all the observers. 264 // Notify all the observers.
265 FOR_EACH_OBSERVER(Observer, observers_, OnProxyConfigChanged(new_config)); 265 FOR_EACH_OBSERVER(Observer, observers_, OnProxyConfigChanged(new_config));
266 } 266 }
267 267
268 } // namespace net 268 } // namespace net
OLDNEW
« no previous file with comments | « net/base/x509_certificate_mac.cc ('k') | net/proxy/proxy_resolver_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698