Index: net/proxy/proxy_resolver_mac.cc |
diff --git a/net/proxy/proxy_resolver_mac.cc b/net/proxy/proxy_resolver_mac.cc |
index 6c5946c9987255f00e9d19295f844ffc4f0cf8a1..7917a3e734d3623142c640c10c935365b90c0292 100644 |
--- a/net/proxy/proxy_resolver_mac.cc |
+++ b/net/proxy/proxy_resolver_mac.cc |
@@ -130,8 +130,8 @@ int ProxyResolverMac::GetProxyForURL(const GURL& query_url, |
CFRelease(result); |
return ERR_FAILED; |
} |
- DCHECK(CFGetTypeID(result) == CFArrayGetTypeID()); |
- base::mac::ScopedCFTypeRef<CFArrayRef> proxy_array_ref((CFArrayRef)result); |
+ base::mac::ScopedCFTypeRef<CFArrayRef> proxy_array_ref( |
+ base::mac::CFCastStrict<CFArrayRef>(result)); |
Mark Mentovai
2011/11/11 17:31:50
The old code has this as a DCHECK, but you’ve used
|
// This string will be an ordered list of <proxy-uri> entries, separated by |
// semi-colons. It is the format that ProxyInfo::UseNamedProxy() expects. |
@@ -141,9 +141,8 @@ int ProxyResolverMac::GetProxyForURL(const GURL& query_url, |
CFIndex proxy_array_count = CFArrayGetCount(proxy_array_ref.get()); |
for (CFIndex i = 0; i < proxy_array_count; ++i) { |
- CFDictionaryRef proxy_dictionary = |
- (CFDictionaryRef)CFArrayGetValueAtIndex(proxy_array_ref.get(), i); |
- DCHECK(CFGetTypeID(proxy_dictionary) == CFDictionaryGetTypeID()); |
+ CFDictionaryRef proxy_dictionary = base::mac::CFCastStrict<CFDictionaryRef>( |
+ CFArrayGetValueAtIndex(proxy_array_ref.get(), i)); |
Mark Mentovai
2011/11/11 17:31:50
Same.
|
// The dictionary may have the following keys: |
// - kCFProxyTypeKey : The type of the proxy |
@@ -159,10 +158,10 @@ int ProxyResolverMac::GetProxyForURL(const GURL& query_url, |
// - kCFProxyAutoConfigurationURLKey : If the PAC file specifies another |
// PAC file, I'm going home. |
- CFStringRef proxy_type = |
- (CFStringRef)base::mac::GetValueFromDictionary(proxy_dictionary, |
- kCFProxyTypeKey, |
- CFStringGetTypeID()); |
+ CFStringRef proxy_type = base::mac::CFCastStrict<CFStringRef>( |
Mark Mentovai
2011/11/11 17:31:50
And in this case, the old code didn’t even have a
|
+ base::mac::GetValueFromDictionary(proxy_dictionary, |
+ kCFProxyTypeKey, |
+ CFStringGetTypeID())); |
ProxyServer proxy_server = ProxyServer::FromDictionary( |
GetProxyServerScheme(proxy_type), |
proxy_dictionary, |