void ScriptRunner::notifyScriptLoadError(ScriptLoader* scriptLoader, ExecutionType executionType) { switch (executionType) { case ASYNC_EXECUTION: { // RELEASE_ASSERT makes us crash in a controlled way in error cases // where the ScriptLoader is associated with the wrong ScriptRunner // (otherwise we'd cause a use-after-free in ~ScriptRunner when it tries // to detach). bool foundLoader = m_pendingAsyncScripts.contains(scriptLoader); #if !ENABLE(OILPAN) // If the ScriptRunner has been disposed of, no pending scripts remain. foundLoader = foundLoader || m_isDisposed; #endif RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(foundLoader); m_pendingAsyncScripts.remove(scriptLoader); break; } case IN_ORDER_EXECUTION: bool foundLoader = removePendingInOrderScript(scriptLoader); #if !ENABLE(OILPAN) foundLoader = foundLoader || m_isDisposed; #endif RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(foundLoader); break; } m_document->decrementLoadEventDelayCount(); }
void ScriptRunner::movePendingScript(ScriptRunner* newRunner, ScriptLoader* scriptLoader) { if (m_pendingAsyncScripts.contains(scriptLoader)) { newRunner->queueScriptForExecution(scriptLoader, ASYNC_EXECUTION); m_pendingAsyncScripts.remove(scriptLoader); m_document->decrementLoadEventDelayCount(); return; } if (removePendingInOrderScript(scriptLoader)) { newRunner->queueScriptForExecution(scriptLoader, IN_ORDER_EXECUTION); m_document->decrementLoadEventDelayCount(); } }
void ScriptRunner::notifyScriptLoadError(ScriptLoader* scriptLoader, ExecutionType executionType) { switch (executionType) { case ASYNC_EXECUTION: { // RELEASE_ASSERT makes us crash in a controlled way in error cases // 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)); m_pendingAsyncScripts.remove(scriptLoader); break; } case IN_ORDER_EXECUTION: RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(removePendingInOrderScript(scriptLoader)); break; } m_document->decrementLoadEventDelayCount(); }
void ScriptRunner::notifyScriptLoadError(ScriptLoader* scriptLoader, AsyncExecutionType executionType) { switch (executionType) { case Async: { // SECURITY_CHECK makes us crash in a controlled way in error cases // where the ScriptLoader is associated with the wrong ScriptRunner // (otherwise we'd cause a use-after-free in ~ScriptRunner when it tries // to detach). SECURITY_CHECK(m_pendingAsyncScripts.contains(scriptLoader)); m_pendingAsyncScripts.remove(scriptLoader); break; } case InOrder: SECURITY_CHECK(removePendingInOrderScript(scriptLoader)); scheduleReadyInOrderScripts(); break; case None: NOTREACHED(); break; } m_document->decrementLoadEventDelayCount(); }