Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp

Issue 2800683005: Introduce PendingScript::startStreamingIfPossible() (Closed)
Patch Set: Rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptLoader.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp b/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
index 552799c02c09e3fd9aa4fe7cf57efc5b01220820..fd9dc6b0af93b06af321a14edadf65b9338a2079 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
@@ -554,16 +554,8 @@ void HTMLParserScriptRunner::requestParsingBlockingScript(Element* element) {
// Callers will attempt to run the m_parserBlockingScript if possible before
// returning control to the parser.
if (!parserBlockingScript()->isReady()) {
- if (m_document->frame()) {
- ScriptState* scriptState = toScriptStateForMainWorld(m_document->frame());
- if (scriptState) {
- ScriptStreamer::startStreaming(
- m_parserBlockingScript, ScriptStreamer::ParsingBlocking,
- m_document->frame()->settings(), scriptState,
- TaskRunnerHelper::get(TaskType::Networking, m_document));
- }
- }
-
+ m_parserBlockingScript->startStreamingIfPossible(
+ m_document, ScriptStreamer::ParsingBlocking);
m_parserBlockingScript->watchForLoad(this);
}
}
@@ -574,14 +566,9 @@ void HTMLParserScriptRunner::requestDeferredScript(Element* element) {
if (!pendingScript)
return;
- if (m_document->frame() && !pendingScript->isReady()) {
- ScriptState* scriptState = toScriptStateForMainWorld(m_document->frame());
- if (scriptState) {
- ScriptStreamer::startStreaming(
- pendingScript, ScriptStreamer::Deferred,
- m_document->frame()->settings(), scriptState,
- TaskRunnerHelper::get(TaskType::Networking, m_document));
- }
+ if (!pendingScript->isReady()) {
+ pendingScript->startStreamingIfPossible(m_document,
+ ScriptStreamer::Deferred);
}
DCHECK(pendingScript->resource());
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698