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

Side by Side Diff: third_party/WebKit/Source/core/css/RemoteFontFaceSource.h

Issue 2095293002: WebFonts intervention: Add metrics only for miss-cached loading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: check memory cache too Created 4 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 // 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 "wtf/Allocator.h" 10 #include "wtf/Allocator.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 PassRefPtr<SimpleFontData> createLoadingFallbackFontData(const FontDescripti on&); 57 PassRefPtr<SimpleFontData> createLoadingFallbackFontData(const FontDescripti on&);
58 void pruneTable(); 58 void pruneTable();
59 59
60 private: 60 private:
61 class FontLoadHistograms { 61 class FontLoadHistograms {
62 DISALLOW_NEW(); 62 DISALLOW_NEW();
63 public: 63 public:
64 FontLoadHistograms() : m_loadStartTime(0), m_blankPaintTime(0), m_isLong LimitExceeded(false) { } 64 FontLoadHistograms() : m_loadStartTime(0), m_blankPaintTime(0), m_isLong LimitExceeded(false) { }
65 void loadStarted(); 65 void loadStarted();
66 void fallbackFontPainted(DisplayPeriod); 66 void fallbackFontPainted(DisplayPeriod);
67 void fontLoaded(bool isInterventionTriggered); 67 void fontLoaded(bool isInterventionTriggered, bool isLoadedFromCache);
kinuko 2016/06/27 12:06:24 usually prefer enum over bool... but ok this is in
68 void longLimitExceeded(bool isInterventionTriggered); 68 void longLimitExceeded(bool isInterventionTriggered);
69 void recordFallbackTime(const FontResource*); 69 void recordFallbackTime(const FontResource*);
70 void recordRemoteFont(const FontResource*); 70 void recordRemoteFont(const FontResource*);
71 bool hadBlankText() { return m_blankPaintTime; } 71 bool hadBlankText() { return m_blankPaintTime; }
72 private: 72 private:
73 void recordLoadTimeHistogram(const FontResource*, int duration); 73 void recordLoadTimeHistogram(const FontResource*, int duration);
74 void recordInterventionResult(bool triggered); 74 void recordInterventionResult(bool triggered, bool loadedFromCache);
kinuko 2016/06/27 12:06:24 loadedFromCache -> isLoadedFromCache for consisten
Takashi Toyoshima 2016/06/28 05:38:18 Done with triggered -> isTriggered.
75 double m_loadStartTime; 75 double m_loadStartTime;
76 double m_blankPaintTime; 76 double m_blankPaintTime;
77 bool m_isLongLimitExceeded; 77 bool m_isLongLimitExceeded;
78 }; 78 };
79 79
80 void switchToSwapPeriod(); 80 void switchToSwapPeriod();
81 void switchToFailurePeriod(); 81 void switchToFailurePeriod();
82 82
83 Member<FontResource> m_font; 83 Member<FontResource> m_font;
84 Member<CSSFontSelector> m_fontSelector; 84 Member<CSSFontSelector> m_fontSelector;
85 const FontDisplay m_display; 85 const FontDisplay m_display;
86 DisplayPeriod m_period; 86 DisplayPeriod m_period;
87 FontLoadHistograms m_histograms; 87 FontLoadHistograms m_histograms;
88 bool m_isInterventionTriggered; 88 bool m_isInterventionTriggered;
89 bool m_isLoadedFromMemoryCache;
89 }; 90 };
90 91
91 } // namespace blink 92 } // namespace blink
92 93
93 #endif 94 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698