{
}
+void ScriptRunner::addPendingAsyncScript(ScriptLoader* scriptLoader, const PendingScript& pendingScript)
+{
+ m_document->incrementLoadEventDelayCount();
+ m_pendingAsyncScripts.add(scriptLoader, pendingScript);
+}
+
void ScriptRunner::queueScriptForExecution(ScriptLoader* scriptLoader, ResourcePtr<ScriptResource> resource, ExecutionType executionType)
{
ASSERT(scriptLoader);
ASSERT(element);
ASSERT(element->inDocument());
- m_document->incrementLoadEventDelayCount();
-
switch (executionType) {
case ASYNC_EXECUTION:
- m_pendingAsyncScripts.add(scriptLoader, PendingScript(element, resource.get()));
+ addPendingAsyncScript(scriptLoader, PendingScript(element, resource.get()));
break;
case IN_ORDER_EXECUTION:
+ m_document->incrementLoadEventDelayCount();
m_scriptsToExecuteInOrder.append(PendingScript(element, resource.get()));
break;
}
}
}
+void ScriptRunner::movePendingAsyncScript(ScriptRunner* newRunner, ScriptLoader* scriptLoader)
+{
+ if (m_pendingAsyncScripts.contains(scriptLoader)) {
+ newRunner->addPendingAsyncScript(scriptLoader, m_pendingAsyncScripts.take(scriptLoader));
+ m_document->decrementLoadEventDelayCount();
+ }
+}
+
void ScriptRunner::timerFired(Timer<ScriptRunner>* timer)
{
ASSERT_UNUSED(timer, timer == &m_timer);