OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are met: | 5 * modification, are permitted provided that the following conditions are met: |
6 * | 6 * |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 22 matching lines...) Expand all Loading... | |
33 #include "core/css/FontFaceCache.h" | 33 #include "core/css/FontFaceCache.h" |
34 #include "core/css/FontFaceSetLoadEvent.h" | 34 #include "core/css/FontFaceSetLoadEvent.h" |
35 #include "core/css/StylePropertySet.h" | 35 #include "core/css/StylePropertySet.h" |
36 #include "core/css/parser/CSSParser.h" | 36 #include "core/css/parser/CSSParser.h" |
37 #include "core/css/resolver/StyleResolver.h" | 37 #include "core/css/resolver/StyleResolver.h" |
38 #include "core/dom/Document.h" | 38 #include "core/dom/Document.h" |
39 #include "core/dom/StyleEngine.h" | 39 #include "core/dom/StyleEngine.h" |
40 #include "core/frame/FrameView.h" | 40 #include "core/frame/FrameView.h" |
41 #include "core/frame/LocalFrame.h" | 41 #include "core/frame/LocalFrame.h" |
42 #include "core/style/StyleInheritedData.h" | 42 #include "core/style/StyleInheritedData.h" |
43 #include "platform/Histogram.h" | |
43 #include "public/platform/Platform.h" | 44 #include "public/platform/Platform.h" |
44 | 45 |
45 namespace blink { | 46 namespace blink { |
46 | 47 |
47 static const int defaultFontSize = 10; | 48 static const int defaultFontSize = 10; |
48 static const char defaultFontFamily[] = "sans-serif"; | 49 static const char defaultFontFamily[] = "sans-serif"; |
49 | 50 |
50 class LoadFontPromiseResolver final : public FontFace::LoadFontCallback { | 51 class LoadFontPromiseResolver final : public FontFace::LoadFontCallback { |
51 public: | 52 public: |
52 static PassRefPtrWillBeRawPtr<LoadFontPromiseResolver> create(FontFaceArray faces, ScriptState* scriptState) | 53 static PassRefPtrWillBeRawPtr<LoadFontPromiseResolver> create(FontFaceArray faces, ScriptState* scriptState) |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
472 if (fontFace->hadBlankText()) | 473 if (fontFace->hadBlankText()) |
473 m_status = HadBlankText; | 474 m_status = HadBlankText; |
474 else if (m_status == NoWebFonts) | 475 else if (m_status == NoWebFonts) |
475 m_status = DidNotHaveBlankText; | 476 m_status = DidNotHaveBlankText; |
476 } | 477 } |
477 | 478 |
478 void FontFaceSet::FontLoadHistogram::record() | 479 void FontFaceSet::FontLoadHistogram::record() |
479 { | 480 { |
480 if (!m_recorded) { | 481 if (!m_recorded) { |
481 m_recorded = true; | 482 m_recorded = true; |
482 Platform::current()->histogramCustomCounts("WebFont.WebFontsInPage", m_c ount, 1, 100, 50); | 483 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, webFontsInPageHist ogram, new CustomCountHistogram("WebFont.WebFontsInPage", 1, 100, 50)); |
esprehn
2016/02/04 23:25:23
FontFaceSet is main thread only today, someday it
| |
484 webFontsInPageHistogram.count(m_count); | |
483 } | 485 } |
484 if (m_status == HadBlankText || m_status == DidNotHaveBlankText) { | 486 if (m_status == HadBlankText || m_status == DidNotHaveBlankText) { |
485 Platform::current()->histogramEnumeration("WebFont.HadBlankText", m_stat us == HadBlankText ? 1 : 0, 2); | 487 Platform::current()->histogramEnumeration("WebFont.HadBlankText", m_stat us == HadBlankText ? 1 : 0, 2); |
486 m_status = Reported; | 488 m_status = Reported; |
487 } | 489 } |
488 } | 490 } |
489 | 491 |
490 static const char* supplementName() | 492 static const char* supplementName() |
491 { | 493 { |
492 return "FontFaceSet"; | 494 return "FontFaceSet"; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
543 visitor->trace(m_failedFonts); | 545 visitor->trace(m_failedFonts); |
544 visitor->trace(m_nonCSSConnectedFaces); | 546 visitor->trace(m_nonCSSConnectedFaces); |
545 visitor->trace(m_asyncRunner); | 547 visitor->trace(m_asyncRunner); |
546 HeapSupplement<Document>::trace(visitor); | 548 HeapSupplement<Document>::trace(visitor); |
547 #endif | 549 #endif |
548 EventTargetWithInlineData::trace(visitor); | 550 EventTargetWithInlineData::trace(visitor); |
549 ActiveDOMObject::trace(visitor); | 551 ActiveDOMObject::trace(visitor); |
550 } | 552 } |
551 | 553 |
552 } // namespace blink | 554 } // namespace blink |
OLD | NEW |