Commit 0b3c319b authored by Yutaka Hirano's avatar Yutaka Hirano Committed by Commit Bot

Set kLow rather than kVeryLow priority for beacon and friends

Current the following requests have ResourceLoadPriority::kVeryLow.

 - beacon
 - a ping
 - csp report

This CL introduces a flag. When it's enabled those requests will have
ResourceLoadPriority::kLow.

Bug: 1018081
Change-Id: I68d5df324739999aaebfee6a1d7fa9c065c93013
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1880897Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709527}
parent 8015ff7d
......@@ -404,5 +404,11 @@ const base::Feature kSubresourceRedirect{"SubresourceRedirect",
// When 'enabled', all cross-origin iframes will get a compositing layer.
const base::Feature kCompositeCrossOriginIframes{
"CompositeCrossOriginIframes", base::FEATURE_DISABLED_BY_DEFAULT};
// When enabled, beacons (and friends) have ResourceLoadPriority::kLow,
// not ResourceLoadPriority::kVeryLow.
const base::Feature kSetLowPriorityForBeacon{"SetLowPriorityForBeacon",
base::FEATURE_DISABLED_BY_DEFAULT};
} // namespace features
} // namespace blink
......@@ -132,6 +132,8 @@ BLINK_COMMON_EXPORT extern const base::Feature kCompositeCrossOriginIframes;
BLINK_COMMON_EXPORT extern const base::Feature kSubresourceRedirect;
BLINK_COMMON_EXPORT extern const base::Feature kSetLowPriorityForBeacon;
} // namespace features
} // namespace blink
......
......@@ -509,7 +509,11 @@ ResourceLoadPriority ResourceFetcher::ComputeLoadPriority(
mojom::RequestContextType::PING ||
resource_request.GetRequestContext() ==
mojom::RequestContextType::CSP_REPORT) {
priority = ResourceLoadPriority::kVeryLow;
if (base::FeatureList::IsEnabled(features::kSetLowPriorityForBeacon)) {
priority = ResourceLoadPriority::kLow;
} else {
priority = ResourceLoadPriority::kVeryLow;
}
}
priority = AdjustPriorityWithPriorityHint(priority, type, resource_request,
......
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