Index: ui/gfx/render_text_mac.mm |
diff --git a/ui/gfx/render_text_mac.mm b/ui/gfx/render_text_mac.mm |
index 5a4e5b115b99aa6f1033438e549d602e954e9a76..c5438395a4f93907720e4fa87701b61a92cf7749 100644 |
--- a/ui/gfx/render_text_mac.mm |
+++ b/ui/gfx/render_text_mac.mm |
@@ -369,7 +369,7 @@ void RenderTextMac::ComputeRuns() { |
const CFRange empty_cf_range = CFRangeMake(0, 0); |
for (CFIndex i = 0; i < ct_runs_count; ++i) { |
CTRunRef ct_run = |
- base::mac::CFCast<CTRunRef>(CFArrayGetValueAtIndex(ct_runs, i)); |
+ base::mac::CFCastStrict<CTRunRef>(CFArrayGetValueAtIndex(ct_runs, i)); |
const size_t glyph_count = CTRunGetGlyphCount(ct_run); |
const double run_width = |
CTRunGetTypographicBounds(ct_run, empty_cf_range, NULL, NULL, NULL); |
@@ -411,19 +411,18 @@ void RenderTextMac::ComputeRuns() { |
// TODO(asvitkine): Style boundaries are not necessarily per-run. Handle |
// this better. Also, support strike and diagonal_strike. |
CFDictionaryRef attributes = CTRunGetAttributes(ct_run); |
- CTFontRef ct_font = base::mac::GetValueFromDictionary<CTFontRef>( |
- attributes, kCTFontAttributeName); |
+ CTFontRef ct_font = base::mac::CFCastStrict<CTFontRef>( |
+ CFDictionaryGetValue(attributes, kCTFontAttributeName)); |
run->ct_font.reset(ct_font, base::scoped_policy::RETAIN); |
run->typeface.reset(SkCreateTypefaceFromCTFont(ct_font)); |
- const CGColorRef foreground = base::mac::GetValueFromDictionary<CGColorRef>( |
- attributes, kCTForegroundColorAttributeName); |
+ const CGColorRef foreground = base::mac::CFCastStrict<CGColorRef>( |
+ CFDictionaryGetValue(attributes, kCTForegroundColorAttributeName)); |
if (foreground) |
run->foreground = skia::CGColorRefToSkColor(foreground); |
- const CFNumberRef underline = |
- base::mac::GetValueFromDictionary<CFNumberRef>( |
- attributes, kCTUnderlineStyleAttributeName); |
+ const CFNumberRef underline = base::mac::CFCastStrict<CFNumberRef>( |
+ CFDictionaryGetValue(attributes, kCTUnderlineStyleAttributeName)); |
CTUnderlineStyle value = kCTUnderlineStyleNone; |
if (underline && CFNumberGetValue(underline, kCFNumberSInt32Type, &value)) |
run->underline = (value == kCTUnderlineStyleSingle); |