Changeset 150741 in webkit


Ignore:
Timestamp:
May 27, 2013 2:13:11 AM (11 years ago)
Author:
allan.jensen@digia.com
Message:

Active DOM objects stopped twice
https://bugs.webkit.org/show_bug.cgi?id=116524

Reviewed by Alexey Proskuryakov.

Only iterate over all active DOM object to stop them once.

To ensure later created active DOM objects are stopped,
suspendActiveDOMObjectIfNeeded now also stops active DOM objects
if needed. This also fixes an existing bug when active DOM
objects were created after stopActiveDOMObjects had been called.

Two existing tests creates new active DOM objects after stopActiveDOMObjects
has been called:

fast/dom/xmlhttprequest-constructor-in-detached-document.html
fast/dom/Window/timer-null-script-execution-context.html

  • dom/ScriptExecutionContext.cpp:

(WebCore::ScriptExecutionContext::stopActiveDOMObjects):
(WebCore::ScriptExecutionContext::suspendActiveDOMObjectIfNeeded):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r150738 r150741  
     12013-05-27  Allan Sandfeld Jensen  <allan.jensen@digia.com>
     2
     3        Active DOM objects stopped twice
     4        https://bugs.webkit.org/show_bug.cgi?id=116524
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        Only iterate over all active DOM object to stop them once.
     9
     10        To ensure later created active DOM objects are stopped,
     11        suspendActiveDOMObjectIfNeeded now also stops active DOM objects
     12        if needed. This also fixes an existing bug when active DOM
     13        objects were created after stopActiveDOMObjects had been called.
     14
     15        Two existing tests creates new active DOM objects after stopActiveDOMObjects
     16        has been called:
     17            fast/dom/xmlhttprequest-constructor-in-detached-document.html
     18            fast/dom/Window/timer-null-script-execution-context.html
     19
     20        * dom/ScriptExecutionContext.cpp:
     21        (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
     22        (WebCore::ScriptExecutionContext::suspendActiveDOMObjectIfNeeded):
     23
    1242013-05-27  Charles Wei  <charles.wei@torchmobile.com.cn>
    225
  • trunk/Source/WebCore/dom/ScriptExecutionContext.cpp

    r150560 r150741  
    213213void ScriptExecutionContext::stopActiveDOMObjects()
    214214{
     215    if (m_activeDOMObjectsAreStopped)
     216        return;
    215217    m_activeDOMObjectsAreStopped = true;
    216218    // No protection against m_activeDOMObjects changing during iteration: stop() shouldn't execute arbitrary JS.
     
    234236    if (m_activeDOMObjectsAreSuspended)
    235237        object->suspend(m_reasonForSuspendingActiveDOMObjects);
     238    if (m_activeDOMObjectsAreStopped)
     239        object->stop();
    236240}
    237241
Note: See TracChangeset for help on using the changeset viewer.