Commit 3879246c authored by Tarun Bansal's avatar Tarun Bansal Committed by Commit Bot

Add feature to control lower JS priority when DeferAllScript enabled

Add feature to not lower JavaScript priority when
DeferAllScript intervention is enabled.

Change-Id: I6a2fdc364398c39ae171a1e23b61e2819d4e68b6
Bug: 978490
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1779167Reviewed-by: default avatarDoug Arnett <dougarnett@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693199}
parent 81f26e77
......@@ -429,5 +429,11 @@ const base::Feature kIgnoreCrossOriginWindowWhenNamedAccessOnWindow{
"IgnoreCrossOriginWindowWhenNamedAccessOnWindow",
base::FEATURE_DISABLED_BY_DEFAULT};
// When enabled, loading priority of JavaScript requests is lowered when they
// are force deferred by the intervention.
const base::Feature kLowerJavaScriptPriorityWhenForceDeferred{
"LowerJavaScriptPriorityWhenForceDeferred",
base::FEATURE_ENABLED_BY_DEFAULT};
} // namespace features
} // namespace blink
......@@ -134,6 +134,9 @@ BLINK_COMMON_EXPORT extern const base::Feature
BLINK_COMMON_EXPORT extern const base::Feature
kIgnoreCrossOriginWindowWhenNamedAccessOnWindow;
BLINK_COMMON_EXPORT extern const base::Feature
kLowerJavaScriptPriorityWhenForceDeferred;
} // namespace features
} // namespace blink
......
......@@ -32,8 +32,10 @@
#include <utility>
#include "base/auto_reset.h"
#include "base/feature_list.h"
#include "base/time/time.h"
#include "services/network/public/cpp/request_mode.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/loader/request_destination.h"
#include "third_party/blink/public/common/mime_util/mime_util.h"
#include "third_party/blink/public/mojom/devtools/console_message.mojom-blink.h"
......@@ -254,6 +256,11 @@ ResourceLoadPriority AdjustPriorityWithDeferScriptIntervention(
const ResourceRequest& resource_request,
FetchParameters::DeferOption defer_option,
bool is_link_preload) {
if (!base::FeatureList::IsEnabled(
blink::features::kLowerJavaScriptPriorityWhenForceDeferred)) {
return priority_so_far;
}
WebURLRequest::PreviewsState context_previews_state =
fetch_context.previews_state();
......
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