Changeset 84945 in webkit
- Timestamp:
- Apr 26, 2011 1:22:49 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r84944 r84945 1 2011-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 1 20 2011-04-26 Dan Bernstein <mitz@apple.com> 2 21 -
trunk/Source/WebCore/bindings/js/JSDOMBinding.h
r84934 r84945 53 53 typedef int ExceptionCode; 54 54 55 // FIXME: This class should collapse into JSDOMWrapper once all JSDOMWrappers are56 // updated to store a globalObject pointer.57 class JSDOMWrapperWithGlobalPointer : public JSDOMWrapper {58 public:59 JSDOMGlobalObject* globalObject() const60 {61 return static_cast<JSDOMGlobalObject*>(JSDOMWrapper::globalObject());62 }63 64 ScriptExecutionContext* scriptExecutionContext() const65 {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 create80 // 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 86 55 // Base class for all constructor objects in the JSC bindings. 87 class DOMConstructorObject : public JSDOMWrapper WithGlobalPointer{56 class DOMConstructorObject : public JSDOMWrapper { 88 57 public: 89 58 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) … … 93 62 94 63 protected: 95 static const unsigned StructureFlags = JSC::ImplementsHasInstance | JSC::OverridesVisitChildren | JSDOMWrapper WithGlobalPointer::StructureFlags;64 static const unsigned StructureFlags = JSC::ImplementsHasInstance | JSC::OverridesVisitChildren | JSDOMWrapper::StructureFlags; 96 65 DOMConstructorObject(JSC::Structure* structure, JSDOMGlobalObject* globalObject) 97 : JSDOMWrapper WithGlobalPointer(structure, globalObject)66 : JSDOMWrapper(structure, globalObject) 98 67 { 99 68 } -
trunk/Source/WebCore/bindings/js/JSDOMWrapper.h
r84105 r84945 23 23 #define JSDOMWrapper_h 24 24 25 #include "JSDOMGlobalObject.h" 25 26 #include <runtime/JSObjectWithGlobalObject.h> 26 27 27 28 namespace WebCore { 28 29 30 class ScriptExecutionContext; 31 29 32 class JSDOMWrapper : public JSC::JSObjectWithGlobalObject { 33 public: 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 30 50 protected: 31 explicit JSDOMWrapper(JSC:: JSGlobalObject* globalObject, JSC::Structure* structure)51 explicit JSDOMWrapper(JSC::Structure* structure, JSC::JSGlobalObject* globalObject) 32 52 : JSObjectWithGlobalObject(globalObject, structure) 33 53 { 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()); 34 58 } 35 59 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r84789 r84945 201 201 202 202 return $dataNode->extendedAttributes->{"LegacyParent"} if $dataNode->extendedAttributes->{"LegacyParent"}; 203 return "JSDOMWrapper WithGlobalPointer" if (@{$dataNode->parents} eq 0);203 return "JSDOMWrapper" if (@{$dataNode->parents} eq 0); 204 204 return "JS" . $codeGenerator->StripModule($dataNode->parents(0)); 205 205 }
Note: See TracChangeset
for help on using the changeset viewer.