Title: [125688] trunk/Source/WebCore
Revision
125688
Author
[email protected]
Date
2012-08-15 11:44:02 -0700 (Wed, 15 Aug 2012)

Log Message

JSDOMWrapper should ASSERT that it has an associated ScriptExecutionContext
https://bugs.webkit.org/show_bug.cgi?id=94053

Reviewed by Sam Weinig.

Previously we were unable have this ASSERT because DOMWindow needed a
Frame to find Document. Now that we can find the Document without a
Frame, we can include the ASSERT and sanity will rein across the land.

* bindings/js/JSDOMWrapper.h:
(WebCore::JSDOMWrapper::globalObject):
(WebCore::JSDOMWrapper::scriptExecutionContext):
(WebCore::JSDOMWrapper::JSDOMWrapper):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (125687 => 125688)


--- trunk/Source/WebCore/ChangeLog	2012-08-15 18:32:41 UTC (rev 125687)
+++ trunk/Source/WebCore/ChangeLog	2012-08-15 18:44:02 UTC (rev 125688)
@@ -1,3 +1,19 @@
+2012-08-15  Adam Barth  <[email protected]>
+
+        JSDOMWrapper should ASSERT that it has an associated ScriptExecutionContext
+        https://bugs.webkit.org/show_bug.cgi?id=94053
+
+        Reviewed by Sam Weinig.
+
+        Previously we were unable have this ASSERT because DOMWindow needed a
+        Frame to find Document. Now that we can find the Document without a
+        Frame, we can include the ASSERT and sanity will rein across the land.
+
+        * bindings/js/JSDOMWrapper.h:
+        (WebCore::JSDOMWrapper::globalObject):
+        (WebCore::JSDOMWrapper::scriptExecutionContext):
+        (WebCore::JSDOMWrapper::JSDOMWrapper):
+
 2012-08-14  Mark Hahnenberg  <[email protected]>
 
         Change behavior of MasqueradesAsUndefined to better accommodate DFG changes

Modified: trunk/Source/WebCore/bindings/js/JSDOMWrapper.h (125687 => 125688)


--- trunk/Source/WebCore/bindings/js/JSDOMWrapper.h	2012-08-15 18:32:41 UTC (rev 125687)
+++ trunk/Source/WebCore/bindings/js/JSDOMWrapper.h	2012-08-15 18:44:02 UTC (rev 125688)
@@ -31,25 +31,14 @@
 
 class JSDOMWrapper : public JSC::JSNonFinalObject {
 public:
-    JSDOMGlobalObject* globalObject() const
-    {
-        return JSC::jsCast<JSDOMGlobalObject*>(JSC::JSNonFinalObject::globalObject());
-    }
+    JSDOMGlobalObject* globalObject() const { return JSC::jsCast<JSDOMGlobalObject*>(JSC::JSNonFinalObject::globalObject()); }
+    ScriptExecutionContext* scriptExecutionContext() const { return globalObject()->scriptExecutionContext(); }
 
-    ScriptExecutionContext* scriptExecutionContext() const
-    {
-        // FIXME: Should never be 0, but can be due to bug 27640.
-        return globalObject()->scriptExecutionContext();
-    }
-
 protected:
-    explicit JSDOMWrapper(JSC::Structure* structure, JSC::JSGlobalObject* globalObject) 
+    JSDOMWrapper(JSC::Structure* structure, JSC::JSGlobalObject* globalObject) 
         : JSNonFinalObject(globalObject->globalData(), structure)
     {
-        // FIXME: This ASSERT is valid, but fires in fast/dom/gc-6.html when trying to create
-        // new _javascript_ objects on detached windows due to DOMWindow::document()
-        // needing to reach through the frame to get to the Document*.  See bug 27640.
-        // ASSERT(globalObject->scriptExecutionContext());
+        ASSERT(scriptExecutionContext());
     }
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to