Commit 84e5597b authored by Matt Falkenhagen's avatar Matt Falkenhagen Committed by Commit Bot

blink: Minor cleanups in core/script.

Change-Id: I348e13cf443af481479000d0b15874bb9a8f2dc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2425931
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: default avatarHiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811193}
parent 5a8f5adf
...@@ -976,10 +976,10 @@ void ScriptLoader::PendingScriptFinished(PendingScript* pending_script) { ...@@ -976,10 +976,10 @@ void ScriptLoader::PendingScriptFinished(PendingScript* pending_script) {
ScriptSchedulingType::kInOrder); ScriptSchedulingType::kInOrder);
// Historically we clear |resource_keep_alive_| when the scheduling type is // Historically we clear |resource_keep_alive_| when the scheduling type is
// kAsync or kInOrder (crbug.com/778799). But if the script resource was // kAsync or kInOrder (crbug.com/778799). But if the script resource was
// served via signed exchange, the script may not be in the HTTPCache, // served via signed exchange, the script may not be in the HTTPCache, and
// therefore will need to be refetched over network if it's evicted from the // therefore will need to be refetched over network if it's evicted from the
// memory cache not be in the HTTPCache. So we keep |resource_keep_alive_| to // memory cache. So we keep |resource_keep_alive_| to keep the resource in the
// keep the resource in the memory cache. // memory cache.
if (resource_keep_alive_ && if (resource_keep_alive_ &&
!resource_keep_alive_->GetResponse().IsSignedExchangeInnerResponse() && !resource_keep_alive_->GetResponse().IsSignedExchangeInnerResponse() &&
!base::FeatureList::IsEnabled( !base::FeatureList::IsEnabled(
......
...@@ -9,14 +9,14 @@ namespace blink { ...@@ -9,14 +9,14 @@ namespace blink {
// Type of <script>'s scheduling. // Type of <script>'s scheduling.
// //
// In the spec, this is determined which clause of Step 25 of // <specdef href="https://html.spec.whatwg.org/C/#prepare-a-script">
// https://html.spec.whatwg.org/C/#prepare-a-script // This is determined by which clause of <spec step="28">Then, follow the first
// is taken. // of the following options that describes the situation:</spec> is taken.
// //
// The enum values are used in histograms and thus do not change existing // The enum values are used in histograms and thus do not change existing
// enum values when modifying. // enum values when modifying.
enum class ScriptSchedulingType { enum class ScriptSchedulingType {
// Because the sheduling type is determined slightly after PendingScript // Because the scheduling type is determined slightly after PendingScript
// creation, it is set to kNotSet before ScriptLoader::TakePendingScript() // creation, it is set to kNotSet before ScriptLoader::TakePendingScript()
// is called. kNotSet should not be observed. // is called. kNotSet should not be observed.
kNotSet, kNotSet,
...@@ -66,14 +66,16 @@ enum class ScriptSchedulingType { ...@@ -66,14 +66,16 @@ enum class ScriptSchedulingType {
// Force deferred scripts controlled by HTMLParserScriptRunner. // Force deferred scripts controlled by HTMLParserScriptRunner.
// These are otherwise parser-blocking scripts that are being forced to // These are otherwise parser-blocking scripts that are being forced to
// execute after parsing completes (due to a ForceDeferScriptIntervention). // execute after parsing completes (due to ForceDeferScriptIntervention).
// //
// Spec: not yet spec'ed. https://crbug.com/976061 // Spec: not yet spec'ed. https://crbug.com/976061
kForceDefer kForceDefer
// When adding a new value, update kLastScriptSchedulingType.
}; };
static const int kLastScriptSchedulingType = static const int kLastScriptSchedulingType =
static_cast<int>(ScriptSchedulingType::kImmediate); static_cast<int>(ScriptSchedulingType::kForceDefer);
} // namespace blink } // namespace blink
......
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