Changeset 106636 in webkit


Ignore:
Timestamp:
Feb 3, 2012 12:19:06 AM (12 years ago)
Author:
jochen@chromium.org
Message:

Crash when trying to add a timer to a detached document.
https://bugs.webkit.org/show_bug.cgi?id=77692

Reviewed by Alexey Proskuryakov.

In http://webkit.org/b/77370, a timer is fired on a detached document.
Since a document clears all timers when it is detached, and it
shouldn't be possible to add a timer to a detached document, we crash
if this should happen anyway. This will hopefully result in an easier
to debug crash dump.

  • page/DOMTimer.cpp:

(WebCore::DOMTimer::DOMTimer):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106635 r106636  
     12012-02-03  Jochen Eisinger  <jochen@chromium.org>
     2
     3        Crash when trying to add a timer to a detached document.
     4        https://bugs.webkit.org/show_bug.cgi?id=77692
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        In http://webkit.org/b/77370, a timer is fired on a detached document.
     9        Since a document clears all timers when it is detached, and it
     10        shouldn't be possible to add a timer to a detached document, we crash
     11        if this should happen anyway. This will hopefully result in an easier
     12        to debug crash dump.
     13
     14        * page/DOMTimer.cpp:
     15        (WebCore::DOMTimer::DOMTimer):
     16
    1172012-02-03  Shinya Kawanaka  <shinyak@google.com>
    218
  • trunk/Source/WebCore/page/DOMTimer.cpp

    r81057 r106636  
    2828#include "DOMTimer.h"
    2929
     30#include "Document.h"
    3031#include "InspectorInstrumentation.h"
    3132#include "ScheduledAction.h"
     
    7172    , m_shouldForwardUserGesture(shouldForwardUserGesture(interval, m_nestingLevel))
    7273{
     74    // FIXME: remove once we found out the root cause for http://webkit.org/b/77370
     75    if (scriptExecutionContext()->isDocument() && !static_cast<Document*>(scriptExecutionContext())->frame())
     76        CRASH();
    7377    scriptExecutionContext()->addTimeout(m_timeoutId, this);
    7478
Note: See TracChangeset for help on using the changeset viewer.