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

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

Issue 2349593002: Wire WebFonts intervention v2 for ECT of 3G (Closed)
Patch Set: rebased Created 4 years, 3 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
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 0ab617696e54174447b5c11c7827069f084ed6f0..638504edc43eb4d7de3a6f295989eb95929a4d1c 100644
--- a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
+++ b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
@@ -28,9 +28,15 @@ bool isEffectiveConnectionTypeSlowFor(Document* document)
{
WebEffectiveConnectionType type = document->frame()->loader().client()->getEffectiveConnectionType();
- WebEffectiveConnectionType thresholdType = RuntimeEnabledFeatures::webFontsInterventionV2With2GEnabled()
- ? WebEffectiveConnectionType::Type2G
- : WebEffectiveConnectionType::TypeSlow2G;
+ WebEffectiveConnectionType thresholdType = WebEffectiveConnectionType::TypeUnknown;
+ if (RuntimeEnabledFeatures::webFontsInterventionV2With2GEnabled()) {
+ thresholdType = WebEffectiveConnectionType::Type2G;
+ } else if (RuntimeEnabledFeatures::webFontsInterventionV2With3GEnabled()) {
+ thresholdType = WebEffectiveConnectionType::Type3G;
+ } else if (RuntimeEnabledFeatures::webFontsInterventionV2WithSlow2GEnabled()) {
+ thresholdType = WebEffectiveConnectionType::TypeSlow2G;
+ }
+ DCHECK_NE(WebEffectiveConnectionType::TypeUnknown, thresholdType);
return WebEffectiveConnectionType::TypeOffline <= type && type <= thresholdType;
}
@@ -170,7 +176,7 @@ bool RemoteFontFaceSource::shouldTriggerWebFontsIntervention()
if (m_histograms.dataSource() == FontLoadHistograms::FromMemoryCache || m_histograms.dataSource() == FontLoadHistograms::FromDataURL)
return false;
- bool isV2Enabled = RuntimeEnabledFeatures::webFontsInterventionV2With2GEnabled() || RuntimeEnabledFeatures::webFontsInterventionV2WithSlow2GEnabled();
+ bool isV2Enabled = RuntimeEnabledFeatures::webFontsInterventionV2With2GEnabled() || RuntimeEnabledFeatures::webFontsInterventionV2With3GEnabled() || RuntimeEnabledFeatures::webFontsInterventionV2WithSlow2GEnabled();
bool networkIsSlow = isV2Enabled ? isEffectiveConnectionTypeSlowFor(m_fontSelector->document()) : isConnectionTypeSlow();
« no previous file with comments | « content/public/common/content_switches.cc ('k') | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698