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

Unified Diff: third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp

Issue 2769183003: Lower the webfont loading priority only if the user is in V2 field trial (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
diff --git a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
index 2052be4281eb6fdfd907cd8468251f17e01831ad..78d545f51c498efb2c62114a1e4d01913ae42127 100644
--- a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
+++ b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
@@ -49,6 +49,12 @@ bool isConnectionTypeSlow() {
return networkStateNotifier().connectionType() == WebConnectionTypeCellular2G;
}
+bool isInterventionV2Enabled() {
+ return RuntimeEnabledFeatures::webFontsInterventionV2With2GEnabled() ||
+ RuntimeEnabledFeatures::webFontsInterventionV2With3GEnabled() ||
+ RuntimeEnabledFeatures::webFontsInterventionV2WithSlow2GEnabled();
+}
+
} // namespace
RemoteFontFaceSource::RemoteFontFaceSource(FontResource* font,
@@ -188,20 +194,16 @@ bool RemoteFontFaceSource::shouldTriggerWebFontsIntervention() {
m_histograms.dataSource() == FontLoadHistograms::FromDataURL)
return false;
- bool isV2Enabled =
- RuntimeEnabledFeatures::webFontsInterventionV2With2GEnabled() ||
- RuntimeEnabledFeatures::webFontsInterventionV2With3GEnabled() ||
- RuntimeEnabledFeatures::webFontsInterventionV2WithSlow2GEnabled();
-
bool networkIsSlow =
- isV2Enabled ? isEffectiveConnectionTypeSlowFor(m_fontSelector->document())
- : isConnectionTypeSlow();
+ isInterventionV2Enabled()
+ ? isEffectiveConnectionTypeSlowFor(m_fontSelector->document())
+ : isConnectionTypeSlow();
return networkIsSlow && m_display == FontDisplayAuto;
}
bool RemoteFontFaceSource::isLowPriorityLoadingAllowedForRemoteFont() const {
- return m_isInterventionTriggered;
+ return m_isInterventionTriggered && isInterventionV2Enabled();
}
PassRefPtr<SimpleFontData> RemoteFontFaceSource::createFontData(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698