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

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

Issue 2390583002: [WIP] WebFonts cache-aware timeout adaption (Closed)
Patch Set: RemoteFontFaceSource cache-aware behavior, fix 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 26 matching lines...) Expand all
37 bool isLoading() const override; 37 bool isLoading() const override;
38 bool isLoaded() const override; 38 bool isLoaded() const override;
39 bool isValid() const override; 39 bool isValid() const override;
40 DisplayPeriod getDisplayPeriod() const { return m_period; } 40 DisplayPeriod getDisplayPeriod() const { return m_period; }
41 41
42 void beginLoadIfNeeded() override; 42 void beginLoadIfNeeded() override;
43 43
44 void notifyFinished(Resource*) override; 44 void notifyFinished(Resource*) override;
45 void fontLoadShortLimitExceeded(FontResource*) override; 45 void fontLoadShortLimitExceeded(FontResource*) override;
46 void fontLoadLongLimitExceeded(FontResource*) override; 46 void fontLoadLongLimitExceeded(FontResource*) override;
47
48 void willReloadAfterDiskCacheMiss(const FontResource*) override;
49
47 String debugName() const override { return "RemoteFontFaceSource"; } 50 String debugName() const override { return "RemoteFontFaceSource"; }
48 51
49 bool isBlank() override { return m_period == BlockPeriod; } 52 bool isBlank() override { return m_period == BlockPeriod; }
50 53
51 // For UMA reporting 54 // For UMA reporting
52 bool hadBlankText() override { return m_histograms.hadBlankText(); } 55 bool hadBlankText() override { return m_histograms.hadBlankText(); }
53 void paintRequested() { m_histograms.fallbackFontPainted(m_period); } 56 void paintRequested() { m_histograms.fallbackFontPainted(m_period); }
54 57
55 DECLARE_VIRTUAL_TRACE(); 58 DECLARE_VIRTUAL_TRACE();
56 59
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 private: 97 private:
95 void recordLoadTimeHistogram(const FontResource*, int duration); 98 void recordLoadTimeHistogram(const FontResource*, int duration);
96 void recordInterventionResult(bool isTriggered); 99 void recordInterventionResult(bool isTriggered);
97 CacheHitMetrics dataSourceMetricsValue(); 100 CacheHitMetrics dataSourceMetricsValue();
98 double m_loadStartTime; 101 double m_loadStartTime;
99 double m_blankPaintTime; 102 double m_blankPaintTime;
100 bool m_isLongLimitExceeded; 103 bool m_isLongLimitExceeded;
101 DataSource m_dataSource; 104 DataSource m_dataSource;
102 }; 105 };
103 106
107 void didBecomeVisibleFallback();
104 void switchToSwapPeriod(); 108 void switchToSwapPeriod();
105 void switchToFailurePeriod(); 109 void switchToFailurePeriod();
106 bool shouldTriggerWebFontsIntervention(); 110 bool shouldTriggerWebFontsIntervention();
111 bool shouldUseInvisibleFallback() const;
107 112
108 Member<FontResource> m_font; 113 Member<FontResource> m_font;
109 Member<CSSFontSelector> m_fontSelector; 114 Member<CSSFontSelector> m_fontSelector;
110 const FontDisplay m_display; 115 const FontDisplay m_display;
111 DisplayPeriod m_period; 116 DisplayPeriod m_period;
112 FontLoadHistograms m_histograms; 117 FontLoadHistograms m_histograms;
113 bool m_isInterventionTriggered; 118 bool m_isInterventionTriggered;
114 }; 119 };
115 120
116 } // namespace blink 121 } // namespace blink
117 122
118 #endif 123 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698