Chromium Code Reviews| Index: net/proxy/proxy_config_service_mac.cc |
| diff --git a/net/proxy/proxy_config_service_mac.cc b/net/proxy/proxy_config_service_mac.cc |
| index 2fd6ee00af687e0272de16f65bb4b31c5e5c5a82..52ddbaca869b2c3fcfd152a39a7196ed957ee077 100644 |
| --- a/net/proxy/proxy_config_service_mac.cc |
| +++ b/net/proxy/proxy_config_service_mac.cc |
| @@ -8,6 +8,7 @@ |
| #include <SystemConfiguration/SystemConfiguration.h> |
| #include "base/logging.h" |
| +#include "base/mac/foundation_util.h" |
| #include "base/mac/mac_util.h" |
| #include "base/mac/scoped_cftyperef.h" |
| #include "base/message_loop.h" |
| @@ -28,8 +29,9 @@ const int kPollIntervalSec = 5; |
| bool GetBoolFromDictionary(CFDictionaryRef dict, |
| CFStringRef key, |
| bool default_value) { |
| - CFNumberRef number = (CFNumberRef)base::mac::GetValueFromDictionary( |
| - dict, key, CFNumberGetTypeID()); |
| + CFNumberRef number = |
| + base::mac::CFCastStrict<CFNumberRef>( |
|
Ryan Sleevi
2011/11/11 00:26:42
nit: You can align this to the previous line, and
KushalP
2011/11/11 11:03:19
In the case of GetValueFromDictionary() it should
Ryan Sleevi
2011/11/11 17:23:11
I think you misunderstood. I believe CFArrayGetVal
|
| + base::mac::GetValueFromDictionary(dict, key, CFNumberGetTypeID())); |
| if (!number) |
| return default_value; |
| @@ -60,10 +62,12 @@ void GetCurrentProxyConfig(ProxyConfig* config) { |
| if (GetBoolFromDictionary(config_dict.get(), |
| kSCPropNetProxiesProxyAutoConfigEnable, |
| false)) { |
| - CFStringRef pac_url_ref = (CFStringRef)base::mac::GetValueFromDictionary( |
| - config_dict.get(), |
| - kSCPropNetProxiesProxyAutoConfigURLString, |
| - CFStringGetTypeID()); |
| + CFStringRef pac_url_ref = |
| + base::mac::CFCastStrict<CFStringRef>( |
| + base::mac::GetValueFromDictionary( |
| + config_dict.get(), |
| + kSCPropNetProxiesProxyAutoConfigURLString, |
| + CFStringGetTypeID())); |
| if (pac_url_ref) |
| config->set_pac_url(GURL(base::SysCFStringRefToUTF8(pac_url_ref))); |
| } |
| @@ -130,15 +134,15 @@ void GetCurrentProxyConfig(ProxyConfig* config) { |
| // proxy bypass list |
| CFArrayRef bypass_array_ref = |
| - (CFArrayRef)base::mac::GetValueFromDictionary( |
| + base::mac::CFCastStrict<CFArrayRef>(base::mac::GetValueFromDictionary( |
| config_dict.get(), |
| kSCPropNetProxiesExceptionsList, |
| - CFArrayGetTypeID()); |
| + CFArrayGetTypeID())); |
| if (bypass_array_ref) { |
| CFIndex bypass_array_count = CFArrayGetCount(bypass_array_ref); |
| for (CFIndex i = 0; i < bypass_array_count; ++i) { |
| - CFStringRef bypass_item_ref = |
| - (CFStringRef)CFArrayGetValueAtIndex(bypass_array_ref, i); |
| + CFStringRef bypass_item_ref = base::mac::CFCastStrict<CFStringRef>( |
| + CFArrayGetValueAtIndex(bypass_array_ref, i)); |
| if (CFGetTypeID(bypass_item_ref) != CFStringGetTypeID()) { |
| LOG(WARNING) << "Expected value for item " << i |
| << " in the kSCPropNetProxiesExceptionsList" |