Commit 0b5884d7 authored by Sophie Chang's avatar Sophie Chang Committed by Commit Bot

Check ect threshold for preview for non commit-time previews earlier

This derisks the OptimizationGuideKeyedService refactor if LPR does not
have server load to handle the additional 3G traffic

Bug: 1012023
Change-Id: I9105aef7e9546552eeab8c27f8dc66d0a03428c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1846046Reviewed-by: default avatarMichael Crouse <mcrouse@chromium.org>
Reviewed-by: default avatarRobert Ogden <robertogden@chromium.org>
Commit-Queue: Sophie Chang <sophiechang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703577}
parent 6ae212ab
......@@ -323,15 +323,14 @@ PreviewsEligibilityReason PreviewsDeciderImpl::DeterminePreviewEligibility(
}
passed_reasons->push_back(PreviewsEligibilityReason::DEVICE_OFFLINE);
// If the optimization type does not require optimization hints, determine
// If the optimization type is not a commit-time preview, determine
// the ECT network triggering condition here.
if (!ShouldCheckOptimizationHints(type)) {
if (!IsCommitTimePreview(type)) {
if (effective_connection_type_ >
previews::params::GetECTThresholdForPreview(type)) {
return PreviewsEligibilityReason::NETWORK_NOT_SLOW;
}
passed_reasons->push_back(PreviewsEligibilityReason::NETWORK_NOT_SLOW);
}
if (effective_connection_type_ > params::GetSessionMaxECTThreshold()) {
return PreviewsEligibilityReason::NETWORK_NOT_SLOW_FOR_SESSION;
......@@ -339,6 +338,7 @@ PreviewsEligibilityReason PreviewsDeciderImpl::DeterminePreviewEligibility(
passed_reasons->push_back(
PreviewsEligibilityReason::NETWORK_NOT_SLOW_FOR_SESSION);
}
}
if (is_reload) {
return PreviewsEligibilityReason::RELOAD_DISALLOWED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment