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

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

Issue 2349593002: Wire WebFonts intervention v2 for ECT of 3G (Closed)
Patch Set: 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 bc8679008f97652d10bf4a54c174a0103c228c7f..78e012c18eccee3ca5a155faa6736d9768e15eec 100644
--- a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
+++ b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
@@ -28,9 +28,14 @@ bool isEffectiveConnectionTypeSlowFor(Document* document)
{
WebEffectiveConnectionType type = document->frame()->loader().client()->getEffectiveConnectionType();
- WebEffectiveConnectionType thresholdType = RuntimeEnabledFeatures::webFontsInterventionV2With2GEnabled()
- ? WebEffectiveConnectionType::Type2G
- : WebEffectiveConnectionType::TypeSlow2G;
+ WebEffectiveConnectionType thresholdType = WebEffectiveConnectionType::TypeSlow2G;
+ if (RuntimeEnabledFeatures::webFontsInterventionV2With2GEnabled()) {
+ thresholdType = WebEffectiveConnectionType::Type2G;
+ } else if (RuntimeEnabledFeatures::webFontsInterventionV2With3GEnabled()) {
+ thresholdType = WebEffectiveConnectionType::Type3G;
+ } else {
+ NOTREACHED();
Takashi Toyoshima 2016/09/16 05:57:16 This line seems to be reached when slow-2g is spec
tbansal1 2016/09/16 06:45:27 Done.
+ }
return WebEffectiveConnectionType::TypeOffline <= type && type <= thresholdType;
}
@@ -170,7 +175,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::webFontsInterventionV2With3GEnabled() || RuntimeEnabledFeatures::webFontsInterventionV2With2GEnabled() || RuntimeEnabledFeatures::webFontsInterventionV2WithSlow2GEnabled();
bool networkIsSlow = isV2Enabled ? isEffectiveConnectionTypeSlowFor(m_fontSelector->document()) : isConnectionTypeSlow();

Powered by Google App Engine
This is Rietveld 408576698