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

Unified Diff: net/proxy/proxy_server_mac.cc

Issue 8528013: Convert plain C-style casts to use CFCastStrict and GetValueFromDictionary template (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Line alignment + Switching strict cases to normal. Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« net/proxy/proxy_resolver_mac.cc ('K') | « net/proxy/proxy_resolver_mac.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_server_mac.cc
diff --git a/net/proxy/proxy_server_mac.cc b/net/proxy/proxy_server_mac.cc
index 4df37a47b0b1a1b43e10056c1a78b58585fa6781..12925ceefaa6f16f85a260ab3a2a6557a033f073 100644
--- a/net/proxy/proxy_server_mac.cc
+++ b/net/proxy/proxy_server_mac.cc
@@ -24,9 +24,8 @@ ProxyServer ProxyServer::FromDictionary(Scheme scheme,
return ProxyServer(scheme, HostPortPair());
}
- CFStringRef host_ref =
- (CFStringRef)base::mac::GetValueFromDictionary(dict, host_key,
- CFStringGetTypeID());
+ CFStringRef host_ref = base::mac::CFCast<CFStringRef>(
+ base::mac::GetValueFromDictionary(dict, host_key, CFStringGetTypeID()));
Mark Mentovai 2011/11/11 17:31:50 Yeah, I really think we need a better API for GetV
if (!host_ref) {
LOG(WARNING) << "Could not find expected key "
<< base::SysCFStringRefToUTF8(host_key)
@@ -35,9 +34,8 @@ ProxyServer ProxyServer::FromDictionary(Scheme scheme,
}
std::string host = base::SysCFStringRefToUTF8(host_ref);
- CFNumberRef port_ref =
- (CFNumberRef)base::mac::GetValueFromDictionary(dict, port_key,
- CFNumberGetTypeID());
+ CFNumberRef port_ref = base::mac::CFCast<CFNumberRef>(
+ base::mac::GetValueFromDictionary(dict, port_key, CFNumberGetTypeID()));
int port;
if (port_ref) {
CFNumberGetValue(port_ref, kCFNumberIntType, &port);
« net/proxy/proxy_resolver_mac.cc ('K') | « net/proxy/proxy_resolver_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698