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

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

Issue 2359493004: FontLoadHistograms: classify as memory cache hit if FontResource loading not triggered (Closed)
Patch Set: use isLoadStartedCalled() in longLimitExceeded() 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 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 FontLoadHistograms(DataSource dataSource) : m_loadStartTime(0), m_blankP aintTime(0), m_isLongLimitExceeded(false), m_dataSource(dataSource) { } 68 FontLoadHistograms(DataSource dataSource) : m_loadStartTime(0), m_blankP aintTime(0), m_isLongLimitExceeded(false), m_dataSource(dataSource) { }
69 void loadStarted(); 69 void loadStarted();
70 void fallbackFontPainted(DisplayPeriod); 70 void fallbackFontPainted(DisplayPeriod);
71 void fontLoaded(bool isInterventionTriggered); 71 void fontLoaded(bool isInterventionTriggered);
72 void longLimitExceeded(bool isInterventionTriggered); 72 void longLimitExceeded(bool isInterventionTriggered);
73 void recordFallbackTime(const FontResource*); 73 void recordFallbackTime(const FontResource*);
74 void recordRemoteFont(const FontResource*); 74 void recordRemoteFont(const FontResource*);
75 bool hadBlankText() { return m_blankPaintTime; } 75 bool hadBlankText() { return m_blankPaintTime; }
76 DataSource dataSource() { return m_dataSource; } 76 DataSource dataSource() { return m_dataSource; }
77 void maySetDataSource(DataSource dataSource) { m_dataSource = (m_dataSou rce != FromUnknown) ? m_dataSource : dataSource; } 77 void maySetDataSource(DataSource dataSource) { m_dataSource = (m_dataSou rce != FromUnknown) ? m_dataSource : dataSource; }
78 bool isLoadStartedCalled() const { return m_loadStartTime != 0; }
78 private: 79 private:
79 void recordLoadTimeHistogram(const FontResource*, int duration); 80 void recordLoadTimeHistogram(const FontResource*, int duration);
80 void recordInterventionResult(bool isTriggered); 81 void recordInterventionResult(bool isTriggered);
81 CacheHitMetrics dataSourceMetricsValue(); 82 CacheHitMetrics dataSourceMetricsValue();
82 double m_loadStartTime; 83 double m_loadStartTime;
83 double m_blankPaintTime; 84 double m_blankPaintTime;
84 bool m_isLongLimitExceeded; 85 bool m_isLongLimitExceeded;
85 DataSource m_dataSource; 86 DataSource m_dataSource;
86 }; 87 };
87 88
88 void switchToSwapPeriod(); 89 void switchToSwapPeriod();
89 void switchToFailurePeriod(); 90 void switchToFailurePeriod();
90 bool shouldTriggerWebFontsIntervention(); 91 bool shouldTriggerWebFontsIntervention();
91 92
92 Member<FontResource> m_font; 93 Member<FontResource> m_font;
93 Member<CSSFontSelector> m_fontSelector; 94 Member<CSSFontSelector> m_fontSelector;
94 const FontDisplay m_display; 95 const FontDisplay m_display;
95 DisplayPeriod m_period; 96 DisplayPeriod m_period;
96 FontLoadHistograms m_histograms; 97 FontLoadHistograms m_histograms;
97 bool m_isInterventionTriggered; 98 bool m_isInterventionTriggered;
98 }; 99 };
99 100
100 } // namespace blink 101 } // namespace blink
101 102
102 #endif 103 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698