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 9dddabdc5796785e9f83b3120304a81cc51e71e9..805da6230b70fd7a48de5457f3c8ad17492aa409 100644 |
--- a/third_party/WebKit/Source/core/dom/ScriptRunner.cpp |
+++ b/third_party/WebKit/Source/core/dom/ScriptRunner.cpp |
@@ -204,12 +204,16 @@ void ScriptRunner::notifyScriptLoadError(ScriptLoader* scriptLoader, ExecutionTy |
// where the ScriptLoader is associated with the wrong ScriptRunner |
// (otherwise we'd cause a use-after-free in ~ScriptRunner when it tries |
// to detach). |
- RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(m_pendingAsyncScripts.contains(scriptLoader)); |
+ bool foundLoader = m_pendingAsyncScripts.contains(scriptLoader); |
+ foundLoader = foundLoader || (scriptLoader->isDetached() && m_pendingAsyncScripts.isEmpty()); |
haraken
2016/01/27 08:46:46
I understand the part of 'scriptLoader->isDetached
sof
2016/01/27 09:10:11
It is an indication of the ScriptRunner being in a
haraken
2016/01/27 09:13:07
Thanks, maybe worth adding a comment.
|
+ RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(foundLoader); |
haraken
2016/01/27 08:46:46
Nit: I'd write RELEASE_ASSERT_WITH_SECURITY_IMPLIC
sof
2016/01/27 09:10:11
Sorry about the slight confusion - the previous li
|
m_pendingAsyncScripts.remove(scriptLoader); |
break; |
} |
case IN_ORDER_EXECUTION: |
- RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(removePendingInOrderScript(scriptLoader)); |
+ bool foundLoader = removePendingInOrderScript(scriptLoader); |
+ foundLoader = foundLoader || (scriptLoader->isDetached() && m_pendingInOrderScripts.isEmpty()); |
+ RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(foundLoader); |
break; |
} |
scriptLoader->detach(); |