void ScriptExecutionContext::stopActiveDOMObjects() { // No protection against m_activeDOMObjects changing during iteration: stop() shouldn't execute arbitrary JS. HashMap<ActiveDOMObject*, void*>::iterator activeObjectsEnd = m_activeDOMObjects.end(); for (HashMap<ActiveDOMObject*, void*>::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) { ASSERT(iter->first->scriptExecutionContext() == this); iter->first->stop(); } // Also close MessagePorts. If they were ActiveDOMObjects (they could be) then they could be stopped instead. closeMessagePorts(); }
void ScriptExecutionContext::stopActiveDOMObjects() { m_activeDOMObjectsAreStopped = true; // No protection against m_activeDOMObjects changing during iteration: stop() shouldn't execute arbitrary JS. m_iteratingActiveDOMObjects = true; HashMap<ActiveDOMObject*, void*>::iterator activeObjectsEnd = m_activeDOMObjects.end(); for (HashMap<ActiveDOMObject*, void*>::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) { ASSERT(iter->key->scriptExecutionContext() == this); ASSERT(iter->key->suspendIfNeededCalled()); iter->key->stop(); } m_iteratingActiveDOMObjects = false; // Also close MessagePorts. If they were ActiveDOMObjects (they could be) then they could be stopped instead. closeMessagePorts(); }