Chromium Code Reviews| 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(); |