OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef RemoteFontFaceSource_h | 5 #ifndef RemoteFontFaceSource_h |
6 #define RemoteFontFaceSource_h | 6 #define RemoteFontFaceSource_h |
7 | 7 |
8 #include "core/css/CSSFontFaceSource.h" | 8 #include "core/css/CSSFontFaceSource.h" |
9 #include "core/fetch/FontResource.h" | 9 #include "core/fetch/FontResource.h" |
10 #include "core/fetch/ResourcePtr.h" | 10 #include "core/fetch/ResourcePtr.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 DECLARE_VIRTUAL_TRACE(); | 37 DECLARE_VIRTUAL_TRACE(); |
38 | 38 |
39 protected: | 39 protected: |
40 PassRefPtr<SimpleFontData> createFontData(const FontDescription&) override; | 40 PassRefPtr<SimpleFontData> createFontData(const FontDescription&) override; |
41 PassRefPtr<SimpleFontData> createLoadingFallbackFontData(const FontDescripti
on&); | 41 PassRefPtr<SimpleFontData> createLoadingFallbackFontData(const FontDescripti
on&); |
42 void pruneTable(); | 42 void pruneTable(); |
43 | 43 |
44 private: | 44 private: |
45 class FontLoadHistograms { | 45 class FontLoadHistograms { |
46 DISALLOW_ALLOCATION(); | 46 DISALLOW_NEW(); |
47 public: | 47 public: |
48 FontLoadHistograms() : m_loadStartTime(0), m_fallbackPaintTime(0) { } | 48 FontLoadHistograms() : m_loadStartTime(0), m_fallbackPaintTime(0) { } |
49 void loadStarted(); | 49 void loadStarted(); |
50 void fallbackFontPainted(); | 50 void fallbackFontPainted(); |
51 void recordRemoteFont(const FontResource*); | 51 void recordRemoteFont(const FontResource*); |
52 void recordFallbackTime(const FontResource*); | 52 void recordFallbackTime(const FontResource*); |
53 bool hadBlankText() { return m_fallbackPaintTime; } | 53 bool hadBlankText() { return m_fallbackPaintTime; } |
54 private: | 54 private: |
55 const char* histogramName(const FontResource*); | 55 const char* histogramName(const FontResource*); |
56 double m_loadStartTime; | 56 double m_loadStartTime; |
57 double m_fallbackPaintTime; | 57 double m_fallbackPaintTime; |
58 }; | 58 }; |
59 | 59 |
60 ResourcePtr<FontResource> m_font; | 60 ResourcePtr<FontResource> m_font; |
61 RefPtrWillBeMember<FontLoader> m_fontLoader; | 61 RefPtrWillBeMember<FontLoader> m_fontLoader; |
62 FontLoadHistograms m_histograms; | 62 FontLoadHistograms m_histograms; |
63 }; | 63 }; |
64 | 64 |
65 } // namespace blink | 65 } // namespace blink |
66 | 66 |
67 #endif | 67 #endif |
OLD | NEW |