| 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_ios.h" | 5 #include "net/proxy/proxy_config_service_ios.h" |
| 6 | 6 |
| 7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
| 8 #include <CFNetwork/CFProxySupport.h> | 8 #include <CFNetwork/CFProxySupport.h> |
| 9 | 9 |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 return default_value; | 30 return default_value; |
| 31 | 31 |
| 32 int int_value; | 32 int int_value; |
| 33 if (CFNumberGetValue(number, kCFNumberIntType, &int_value)) | 33 if (CFNumberGetValue(number, kCFNumberIntType, &int_value)) |
| 34 return int_value; | 34 return int_value; |
| 35 else | 35 else |
| 36 return default_value; | 36 return default_value; |
| 37 } | 37 } |
| 38 | 38 |
| 39 void GetCurrentProxyConfig(ProxyConfig* config) { | 39 void GetCurrentProxyConfig(ProxyConfig* config) { |
| 40 base::mac::ScopedCFTypeRef<CFDictionaryRef> config_dict( | 40 base::ScopedCFTypeRef<CFDictionaryRef> config_dict( |
| 41 CFNetworkCopySystemProxySettings()); | 41 CFNetworkCopySystemProxySettings()); |
| 42 DCHECK(config_dict); | 42 DCHECK(config_dict); |
| 43 | 43 |
| 44 // Auto-detect is not supported. | 44 // Auto-detect is not supported. |
| 45 // The kCFNetworkProxiesProxyAutoDiscoveryEnable key is not available on iOS. | 45 // The kCFNetworkProxiesProxyAutoDiscoveryEnable key is not available on iOS. |
| 46 | 46 |
| 47 // PAC file | 47 // PAC file |
| 48 | 48 |
| 49 if (GetBoolFromDictionary(config_dict.get(), | 49 if (GetBoolFromDictionary(config_dict.get(), |
| 50 kCFNetworkProxiesProxyAutoConfigEnable, | 50 kCFNetworkProxiesProxyAutoConfigEnable, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 ProxyConfigServiceIOS::ProxyConfigServiceIOS() | 101 ProxyConfigServiceIOS::ProxyConfigServiceIOS() |
| 102 : PollingProxyConfigService(base::TimeDelta::FromSeconds(kPollIntervalSec), | 102 : PollingProxyConfigService(base::TimeDelta::FromSeconds(kPollIntervalSec), |
| 103 GetCurrentProxyConfig) { | 103 GetCurrentProxyConfig) { |
| 104 } | 104 } |
| 105 | 105 |
| 106 ProxyConfigServiceIOS::~ProxyConfigServiceIOS() { | 106 ProxyConfigServiceIOS::~ProxyConfigServiceIOS() { |
| 107 } | 107 } |
| 108 | 108 |
| 109 } // namespace net | 109 } // namespace net |
| OLD | NEW |