Ignore:
Timestamp:
May 23, 2010, 7:15:02 PM (15 years ago)
Author:
[email protected]
Message:

Fix for https://bugs.webkit.org/show_bug.cgi?id=39575
Make JS DOMObject inherit from JSObjectWithGlobalObject instead of JSObject

Reviewed by Oliver Hunt.

JavaScriptCore:

Expose the global object stored in JSObjectWithGlobalObject.

(JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject):
(JSC::JSObjectWithGlobalObject::globalObject):

  • runtime/JSObjectWithGlobalObject.h:

WebCore:

  • Changes JSDOMWindowShell to inherit from JSObject instead of DOMObject since it doesn't ever go into any DOMObject tables. In a separate change, we may want to make this inherit from JSObjectWithGlobalObject since JSDOMWindowShell does store a global object pointer.
  • Change DOMObject to inherit from JSObjectWithGlobalObject instead of JSObject. In this change I am keeping around DOMObjectWithGlobalPointer, which now just uses the capabilities of JSObjectWithGlobalObject instead of implementing them itself. DOMObjectWithGlobalPointer will go away in a subsequent patch.
  • bindings/js/JSDOMBinding.h:

(WebCore::DOMObjectWithGlobalPointer::globalObject):
(WebCore::DOMObjectWithGlobalPointer::DOMObjectWithGlobalPointer):

  • bindings/js/JSDOMWindowShell.h:
  • bindings/js/JSDOMWrapper.h:

(WebCore::DOMObject::DOMObject):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSObjectWithGlobalObject.h

    r59941 r60057  
    4040    }
    4141
     42    JSGlobalObject* globalObject() const;
     43
    4244protected:
    4345    JSObjectWithGlobalObject(JSGlobalObject*, NonNullPassRefPtr<Structure>);
     
    4951    }
    5052    static const unsigned AnonymousSlotCount = JSObject::AnonymousSlotCount + 1;
     53    static const unsigned GlobalObjectSlot = 0;
    5154};
    5255
    53 }
     56} // namespace JSC
    5457
    5558#endif // JSObjectWithGlobalObject_h
Note: See TracChangeset for help on using the changeset viewer.