diff options
author | sigbjornf <sigbjornf@opera.com> | 2015-11-08 13:56:51 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-08 21:57:43 +0000 |
commit | 45c6d8417161633e0172e01f0f86678fd35e4d5c (patch) | |
tree | 47d5a5a9e8008161e122fca7ef3fee62c1570128 | |
parent | 6a05781d7334b28a75b3321301a8927b5cd7dc36 (diff) | |
download | chromium_src-45c6d8417161633e0172e01f0f86678fd35e4d5c.zip chromium_src-45c6d8417161633e0172e01f0f86678fd35e4d5c.tar.gz chromium_src-45c6d8417161633e0172e01f0f86678fd35e4d5c.tar.bz2 |
ScriptRunner::notifyScriptLoadError(): fix broken sanity check.
Asserting for the presence of 'scriptLoader' in the pending script loader
Deque cannot use the iterator to do so if the Deque is mutated at the
same time; last loader will be confused with end(). Do better.
Regression introduced by r357778.
R=haraken
BUG=552871
Review URL: https://codereview.chromium.org/1413363012
Cr-Commit-Position: refs/heads/master@{#358556}
-rw-r--r-- | third_party/WebKit/Source/core/dom/ScriptRunner.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/third_party/WebKit/Source/core/dom/ScriptRunner.cpp b/third_party/WebKit/Source/core/dom/ScriptRunner.cpp index fb555bb..1629e39 100644 --- a/third_party/WebKit/Source/core/dom/ScriptRunner.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptRunner.cpp @@ -206,14 +206,15 @@ void ScriptRunner::notifyScriptLoadError(ScriptLoader* scriptLoader, ExecutionTy RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(m_numberOfInOrderScriptsWithPendingNotification > 0); m_numberOfInOrderScriptsWithPendingNotification--; - auto it = m_pendingInOrderScripts.begin(); - for (; it != m_pendingInOrderScripts.end(); ++it) { + bool foundPendingScript = false; + for (auto it = m_pendingInOrderScripts.begin(); it != m_pendingInOrderScripts.end(); ++it) { if (*it == scriptLoader) { m_pendingInOrderScripts.remove(it); + foundPendingScript = true; break; } } - RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(it != m_pendingInOrderScripts.end()); + RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(foundPendingScript); break; } scriptLoader->detach(); |