Commit 3b0e3cff authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[blink] Allow in-order scripts to be streamed

Currently, in-order scripts (i.e. <script> tags that are inserted
dynamically instead of by the parser) never request streaming. Given
recent streaming improvements, we can now afford to stream these
scripts.

As a drive-by, also allow async scripts encountered while the script
runner is suspended to also be streamed, since otherwise they will
never stream.

Bug: 865098
Change-Id: I095deb4ac8ceab86c8db0473357b093822cb3b61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1630159Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664204}
parent e39f05ff
......@@ -47,12 +47,10 @@ ScriptRunner::ScriptRunner(Document* document)
void ScriptRunner::QueueScriptForExecution(PendingScript* pending_script) {
DCHECK(pending_script);
document_->IncrementLoadEventDelayCount();
pending_script->StartStreamingIfPossible();
switch (pending_script->GetSchedulingType()) {
case ScriptSchedulingType::kAsync:
pending_async_scripts_.insert(pending_script);
if (!is_suspended_) {
pending_script->StartStreamingIfPossible();
}
break;
case ScriptSchedulingType::kInOrder:
......
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