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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/FontFallbackList.cpp

Issue 2957513002: Removed calls to RefPtr::Release in return statements with auto move. (Closed)
Patch Set: rebased Created 3 years, 5 months 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 family_index++; 160 family_index++;
161 if (curr_family->Family().length()) { 161 if (curr_family->Family().length()) {
162 RefPtr<FontData> result; 162 RefPtr<FontData> result;
163 if (font_selector_) 163 if (font_selector_)
164 result = font_selector_->GetFontData(font_description, 164 result = font_selector_->GetFontData(font_description,
165 curr_family->Family()); 165 curr_family->Family());
166 if (!result) 166 if (!result)
167 result = FontCache::GetFontCache()->GetFontData(font_description, 167 result = FontCache::GetFontCache()->GetFontData(font_description,
168 curr_family->Family()); 168 curr_family->Family());
169 if (result) 169 if (result)
170 return result.Release(); 170 return result;
171 } 171 }
172 } 172 }
173 family_index = kCAllFamiliesScanned; 173 family_index = kCAllFamiliesScanned;
174 174
175 if (font_selector_) { 175 if (font_selector_) {
176 // Try the user's preferred standard font. 176 // Try the user's preferred standard font.
177 if (RefPtr<FontData> data = font_selector_->GetFontData( 177 if (RefPtr<FontData> data = font_selector_->GetFontData(
178 font_description, FontFamilyNames::webkit_standard)) 178 font_description, FontFamilyNames::webkit_standard))
179 return data.Release(); 179 return data;
180 } 180 }
181 181
182 // Still no result. Hand back our last resort fallback font. 182 // Still no result. Hand back our last resort fallback font.
183 return FontCache::GetFontCache()->GetLastResortFallbackFont(font_description); 183 return FontCache::GetFontCache()->GetLastResortFallbackFont(font_description);
184 } 184 }
185 185
186 FallbackListCompositeKey FontFallbackList::CompositeKey( 186 FallbackListCompositeKey FontFallbackList::CompositeKey(
187 const FontDescription& font_description) const { 187 const FontDescription& font_description) const {
188 FallbackListCompositeKey key(font_description); 188 FallbackListCompositeKey key(font_description);
189 const FontFamily* current_family = &font_description.Family(); 189 const FontFamily* current_family = &font_description.Family();
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 } 243 }
244 244
245 bool FontFallbackList::IsValid() const { 245 bool FontFallbackList::IsValid() const {
246 if (!font_selector_) 246 if (!font_selector_)
247 return font_selector_version_ == 0; 247 return font_selector_version_ == 0;
248 248
249 return font_selector_->Version() == font_selector_version_; 249 return font_selector_->Version() == font_selector_version_;
250 } 250 }
251 251
252 } // namespace blink 252 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698