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

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

Issue 1263743002: Upon load failure, remove sync script from execution queue. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: correctly remove in-order script loader from queue Created 5 years, 4 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 | « LayoutTests/http/tests/misc/script-sync-slow-scripts-onerror-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ScriptRunner.cpp
diff --git a/Source/core/dom/ScriptRunner.cpp b/Source/core/dom/ScriptRunner.cpp
index bf1d254109b5e31a144b5a34c76757f11e28ef42..5342e3732b5137b156de61f9e7d525e8b8258e73 100644
--- a/Source/core/dom/ScriptRunner.cpp
+++ b/Source/core/dom/ScriptRunner.cpp
@@ -132,14 +132,23 @@ void ScriptRunner::notifyScriptLoadError(ScriptLoader* scriptLoader, ExecutionTy
// to detach).
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(m_pendingAsyncScripts.contains(scriptLoader));
m_pendingAsyncScripts.remove(scriptLoader);
- scriptLoader->detach();
- m_document->decrementLoadEventDelayCount();
break;
case IN_ORDER_EXECUTION:
- RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(!m_scriptsToExecuteInOrder.isEmpty());
+ WillBeHeapDeque<RawPtrWillBeMember<ScriptLoader>>::iterator it = m_scriptsToExecuteInOrder.begin();
+ while (it != m_scriptsToExecuteInOrder.end()) {
+ if (*it == scriptLoader) {
+ m_scriptsToExecuteInOrder.remove(it);
+ break;
+ }
+ ++it;
+ }
+ // Verifies same condition as above, but for in-order script loads.
+ RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(it != m_scriptsToExecuteInOrder.end());
break;
}
+ scriptLoader->detach();
+ m_document->decrementLoadEventDelayCount();
}
void ScriptRunner::movePendingAsyncScript(Document& oldDocument, Document& newDocument, ScriptLoader* scriptLoader)
« no previous file with comments | « LayoutTests/http/tests/misc/script-sync-slow-scripts-onerror-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698