Commit b7158476 authored by jochen@chromium.org's avatar jochen@chromium.org

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):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106636 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent eb51612e
2012-02-03 Jochen Eisinger <jochen@chromium.org>
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):
2012-02-03 Shinya Kawanaka <shinyak@google.com>
Stop calling Element::ensureShadowRoot in Internals.
......@@ -27,6 +27,7 @@
#include "config.h"
#include "DOMTimer.h"
#include "Document.h"
#include "InspectorInstrumentation.h"
#include "ScheduledAction.h"
#include "ScriptExecutionContext.h"
......@@ -70,6 +71,9 @@ DOMTimer::DOMTimer(ScriptExecutionContext* context, PassOwnPtr<ScheduledAction>
, m_originalInterval(interval)
, m_shouldForwardUserGesture(shouldForwardUserGesture(interval, m_nestingLevel))
{
// FIXME: remove once we found out the root cause for http://webkit.org/b/77370
if (scriptExecutionContext()->isDocument() && !static_cast<Document*>(scriptExecutionContext())->frame())
CRASH();
scriptExecutionContext()->addTimeout(m_timeoutId, this);
double intervalMilliseconds = intervalClampedToMinimum(interval, context->minimumTimerInterval());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment