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

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

Issue 2751163002: Report UseCounter metric when observing NotDef glyphs (Closed)
Patch Set: Relax num_glyphs assertion, not feasible on Mac Created 3 years, 7 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.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/Font.cpp b/third_party/WebKit/Source/platform/fonts/Font.cpp
index f3356b823088308a1b749e29c727ae9c86aa8ed8..d9722fa695f34fc21f9fe76583d9d9042620959b 100644
--- a/third_party/WebKit/Source/platform/fonts/Font.cpp
+++ b/third_party/WebKit/Source/platform/fonts/Font.cpp
@@ -411,6 +411,16 @@ bool Font::ComputeCanShapeWordByWord() const {
return !platform_data.HasSpaceInLigaturesOrKerning(features);
};
+void Font::ReportNotDefGlyph() const {
+ FontSelector* fontSelector = font_fallback_list_->GetFontSelector();
+ // We have a few non-DOM usages of Font code, for example in DragImage::Create
+ // and in EmbeddedObjectPainter::paintReplaced. In those cases, we can't
+ // retrieve a font selector as our connection to a Document object to report
+ // UseCounter metrics, and thus we cannot report notdef glyphs.
+ if (fontSelector)
+ fontSelector->ReportNotDefGlyph();
+}
+
void Font::WillUseFontData(const String& text) const {
const FontFamily& family = GetFontDescription().Family();
if (font_fallback_list_ && font_fallback_list_->GetFontSelector() &&
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/Font.h ('k') | third_party/WebKit/Source/platform/fonts/FontSelector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698