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

Unified Diff: third_party/WebKit/Source/platform/fonts/Font.h

Issue 2416033003: Remove unsafe getFontMetrics methods (Closed)
Patch Set: Address wkroman suggestions Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/fonts/Font.h
diff --git a/third_party/WebKit/Source/platform/fonts/Font.h b/third_party/WebKit/Source/platform/fonts/Font.h
index bff7ab2b0ded9a9ba7b53770ea2e1d11a38d1433..5150494601778ac71b10bfda20354aa38323c3bf 100644
--- a/third_party/WebKit/Source/platform/fonts/Font.h
+++ b/third_party/WebKit/Source/platform/fonts/Font.h
@@ -123,10 +123,6 @@ class PLATFORM_EXPORT Font {
Vector<CharacterRange> individualCharacterRanges(const TextRun&) const;
// Metrics that we query the FontFallbackList for.
- const FontMetrics& getFontMetrics() const {
- RELEASE_ASSERT(primaryFont());
- return primaryFont()->getFontMetrics();
- }
float spaceWidth() const {
return primaryFont()->spaceWidth() + getFontDescription().letterSpacing();
}
@@ -139,6 +135,9 @@ class PLATFORM_EXPORT Font {
int emphasisMarkDescent(const AtomicString&) const;
int emphasisMarkHeight(const AtomicString&) const;
+ // This may fail and return a nullptr in case the last resort font cannot be
+ // loaded. This *should* not happen but in reality it does ever now and then
+ // when, for whatever reason, the last resort font cannot be loaded.
const SimpleFontData* primaryFont() const;
const FontData* fontDataAt(unsigned) const;
« no previous file with comments | « third_party/WebKit/Source/platform/exported/WebFont.cpp ('k') | third_party/WebKit/Source/web/ExternalPopupMenu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698