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

Unified Diff: third_party/WebKit/Source/core/dom/ScriptRunner.cpp

Issue 1798253002: Stop scheduling in-order script execution upon hitting failed script. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix msvc compilation Created 4 years, 9 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/ScriptRunner.h ('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/dom/ScriptRunner.cpp
diff --git a/third_party/WebKit/Source/core/dom/ScriptRunner.cpp b/third_party/WebKit/Source/core/dom/ScriptRunner.cpp
index 740874b3b9e30555b82dff1bdc2958bb9b79dd70..e920985525b8a40556916dd69c65a948a99cc55d 100644
--- a/third_party/WebKit/Source/core/dom/ScriptRunner.cpp
+++ b/third_party/WebKit/Source/core/dom/ScriptRunner.cpp
@@ -129,6 +129,18 @@ void ScriptRunner::resume()
}
}
+void ScriptRunner::scheduleReadyInOrderScripts()
+{
+ while (!m_pendingInOrderScripts.isEmpty() && m_pendingInOrderScripts.first()->isReady()) {
+ // A ScriptLoader that failed is responsible for cancelling itself
+ // notifyScriptLoadError(); it continues this draining of ready scripts.
+ if (m_pendingInOrderScripts.first()->errorOccurred())
+ break;
+ m_inOrderScriptsToExecuteSoon.append(m_pendingInOrderScripts.takeFirst());
+ postTask(BLINK_FROM_HERE);
+ }
+}
+
void ScriptRunner::notifyScriptReady(ScriptLoader* scriptLoader, ExecutionType executionType)
{
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(scriptLoader);
@@ -151,10 +163,7 @@ void ScriptRunner::notifyScriptReady(ScriptLoader* scriptLoader, ExecutionType e
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(m_numberOfInOrderScriptsWithPendingNotification > 0);
m_numberOfInOrderScriptsWithPendingNotification--;
- while (!m_pendingInOrderScripts.isEmpty() && m_pendingInOrderScripts.first()->isReady()) {
- m_inOrderScriptsToExecuteSoon.append(m_pendingInOrderScripts.takeFirst());
- postTask(BLINK_FROM_HERE);
- }
+ scheduleReadyInOrderScripts();
break;
}
@@ -196,6 +205,7 @@ void ScriptRunner::notifyScriptLoadError(ScriptLoader* scriptLoader, ExecutionTy
foundLoader = foundLoader || m_isDisposed;
#endif
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(foundLoader);
+ scheduleReadyInOrderScripts();
break;
}
m_document->decrementLoadEventDelayCount();
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptRunner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698