Title: [106636] trunk/Source/WebCore
Revision
106636
Author
[email protected]
Date
2012-02-03 00:19:06 -0800 (Fri, 03 Feb 2012)

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (106635 => 106636)


--- trunk/Source/WebCore/ChangeLog	2012-02-03 08:16:33 UTC (rev 106635)
+++ trunk/Source/WebCore/ChangeLog	2012-02-03 08:19:06 UTC (rev 106636)
@@ -1,3 +1,19 @@
+2012-02-03  Jochen Eisinger  <[email protected]>
+
+        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  <[email protected]>
 
         Stop calling Element::ensureShadowRoot in Internals.

Modified: trunk/Source/WebCore/page/DOMTimer.cpp (106635 => 106636)


--- trunk/Source/WebCore/page/DOMTimer.cpp	2012-02-03 08:16:33 UTC (rev 106635)
+++ trunk/Source/WebCore/page/DOMTimer.cpp	2012-02-03 08:19:06 UTC (rev 106636)
@@ -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 @@
     , 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());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to