Changeset 84945 in webkit


Ignore:
Timestamp:
Apr 26, 2011 1:22:49 PM (13 years ago)
Author:
weinig@apple.com
Message:

Remove JSDOMWrapperWithGlobalPointer now that all JSDOMWrappers have global objects
https://bugs.webkit.org/show_bug.cgi?id=59310

Reviewed by Maciej Stachowiak.

  • bindings/js/JSDOMBinding.h:

(WebCore::DOMConstructorObject::DOMConstructorObject):

  • bindings/js/JSDOMWrapper.h:

(WebCore::JSDOMWrapper::globalObject):
(WebCore::JSDOMWrapper::scriptExecutionContext):
(WebCore::JSDOMWrapper::createStructure):
(WebCore::JSDOMWrapper::JSDOMWrapper):
Merge JSDOMWrapperWithGlobalPointer with JSDOMWrapper.

  • bindings/scripts/CodeGeneratorJS.pm:

Make JSDOMWrapper the base class.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r84944 r84945  
     12011-04-26  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        Remove JSDOMWrapperWithGlobalPointer now that all JSDOMWrappers have global objects
     6        https://bugs.webkit.org/show_bug.cgi?id=59310
     7
     8        * bindings/js/JSDOMBinding.h:
     9        (WebCore::DOMConstructorObject::DOMConstructorObject):
     10        * bindings/js/JSDOMWrapper.h:
     11        (WebCore::JSDOMWrapper::globalObject):
     12        (WebCore::JSDOMWrapper::scriptExecutionContext):
     13        (WebCore::JSDOMWrapper::createStructure):
     14        (WebCore::JSDOMWrapper::JSDOMWrapper):
     15        Merge JSDOMWrapperWithGlobalPointer with JSDOMWrapper.
     16
     17        * bindings/scripts/CodeGeneratorJS.pm:
     18        Make JSDOMWrapper the base class.
     19
    1202011-04-26  Dan Bernstein  <mitz@apple.com>
    221
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.h

    r84934 r84945  
    5353    typedef int ExceptionCode;
    5454
    55     // FIXME: This class should collapse into JSDOMWrapper once all JSDOMWrappers are
    56     // updated to store a globalObject pointer.
    57     class JSDOMWrapperWithGlobalPointer : public JSDOMWrapper {
    58     public:
    59         JSDOMGlobalObject* globalObject() const
    60         {
    61             return static_cast<JSDOMGlobalObject*>(JSDOMWrapper::globalObject());
    62         }
    63 
    64         ScriptExecutionContext* scriptExecutionContext() const
    65         {
    66             // FIXME: Should never be 0, but can be due to bug 27640.
    67             return globalObject()->scriptExecutionContext();
    68         }
    69 
    70         static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype)
    71         {
    72             return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
    73         }
    74 
    75     protected:
    76         JSDOMWrapperWithGlobalPointer(JSC::Structure* structure, JSDOMGlobalObject* globalObject)
    77             : JSDOMWrapper(globalObject, structure)
    78         {
    79             // FIXME: This ASSERT is valid, but fires in fast/dom/gc-6.html when trying to create
    80             // new JavaScript objects on detached windows due to DOMWindow::document()
    81             // needing to reach through the frame to get to the Document*.  See bug 27640.
    82             // ASSERT(globalObject->scriptExecutionContext());
    83         }
    84     };
    85 
    8655    // Base class for all constructor objects in the JSC bindings.
    87     class DOMConstructorObject : public JSDOMWrapperWithGlobalPointer {
     56    class DOMConstructorObject : public JSDOMWrapper {
    8857    public:
    8958        static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype)
     
    9362
    9463    protected:
    95         static const unsigned StructureFlags = JSC::ImplementsHasInstance | JSC::OverridesVisitChildren | JSDOMWrapperWithGlobalPointer::StructureFlags;
     64        static const unsigned StructureFlags = JSC::ImplementsHasInstance | JSC::OverridesVisitChildren | JSDOMWrapper::StructureFlags;
    9665        DOMConstructorObject(JSC::Structure* structure, JSDOMGlobalObject* globalObject)
    97             : JSDOMWrapperWithGlobalPointer(structure, globalObject)
     66            : JSDOMWrapper(structure, globalObject)
    9867        {
    9968        }
  • trunk/Source/WebCore/bindings/js/JSDOMWrapper.h

    r84105 r84945  
    2323#define JSDOMWrapper_h
    2424
     25#include "JSDOMGlobalObject.h"
    2526#include <runtime/JSObjectWithGlobalObject.h>
    2627
    2728namespace WebCore {
    2829
     30class ScriptExecutionContext;
     31
    2932class JSDOMWrapper : public JSC::JSObjectWithGlobalObject {
     33public:
     34    JSDOMGlobalObject* globalObject() const
     35    {
     36        return static_cast<JSDOMGlobalObject*>(JSDOMWrapper::globalObject());
     37    }
     38
     39    ScriptExecutionContext* scriptExecutionContext() const
     40    {
     41        // FIXME: Should never be 0, but can be due to bug 27640.
     42        return globalObject()->scriptExecutionContext();
     43    }
     44
     45    static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype)
     46    {
     47        return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
     48    }
     49
    3050protected:
    31     explicit JSDOMWrapper(JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
     51    explicit JSDOMWrapper(JSC::Structure* structure, JSC::JSGlobalObject* globalObject)
    3252        : JSObjectWithGlobalObject(globalObject, structure)
    3353    {
     54        // FIXME: This ASSERT is valid, but fires in fast/dom/gc-6.html when trying to create
     55        // new JavaScript objects on detached windows due to DOMWindow::document()
     56        // needing to reach through the frame to get to the Document*.  See bug 27640.
     57        // ASSERT(globalObject->scriptExecutionContext());
    3458    }
    3559
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r84789 r84945  
    201201
    202202    return $dataNode->extendedAttributes->{"LegacyParent"} if $dataNode->extendedAttributes->{"LegacyParent"};
    203     return "JSDOMWrapperWithGlobalPointer" if (@{$dataNode->parents} eq 0);
     203    return "JSDOMWrapper" if (@{$dataNode->parents} eq 0);
    204204    return "JS" . $codeGenerator->StripModule($dataNode->parents(0));
    205205}
Note: See TracChangeset for help on using the changeset viewer.