Changeset 84699 in webkit
- Timestamp:
- Apr 22, 2011 4:04:12 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r84695 r84699 1 2011-04-22 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 We have an autogenerator, so use it 6 https://bugs.webkit.org/show_bug.cgi?id=59247 7 8 * bindings/js/JSCSSRuleCustom.cpp: 9 * bindings/js/JSCSSRuleListCustom.cpp: 10 * bindings/js/JSCSSStyleDeclarationCustom.cpp: 11 * bindings/js/JSCSSValueCustom.cpp: 12 * bindings/js/JSCanvasRenderingContextCustom.cpp: 13 * bindings/js/JSDOMImplementationCustom.cpp: 14 * bindings/js/JSDOMStringMapCustom.cpp: 15 * bindings/js/JSHTMLCollectionCustom.cpp: 16 * bindings/js/JSNamedNodeMapCustom.cpp: 17 * bindings/js/JSNodeCustom.h: 18 * bindings/js/JSNodeListCustom.cpp: 19 * bindings/js/JSStyleSheetCustom.cpp: 20 * bindings/js/JSStyleSheetListCustom.cpp: Removed repetitive hand-written code. 21 22 * bindings/scripts/CodeGeneratorJS.pm: Augmented autogenerator to do the job. 23 24 * css/CSSRule.idl: 25 * css/CSSRuleList.idl: 26 * css/CSSStyleDeclaration.idl: 27 * css/CSSValue.idl: 28 * css/MediaList.idl: 29 * css/StyleSheet.idl: 30 * css/StyleSheetList.idl: 31 * dom/DOMImplementation.idl: 32 * dom/DOMStringMap.idl: 33 * dom/NamedNodeMap.idl: 34 * dom/Node.idl: 35 * dom/NodeList.idl: 36 * html/DOMTokenList.idl: 37 * html/HTMLCollection.idl: 38 * html/canvas/CanvasRenderingContext.idl: Updated attributes to plug into 39 the autogenerator. 40 1 41 2011-04-22 Beth Dakin <bdakin@apple.com> 2 42 -
trunk/Source/WebCore/bindings/js/JSCSSRuleCustom.cpp
r84556 r84699 49 49 namespace WebCore { 50 50 51 class JSCSSRuleOwner : public JSC::WeakHandleOwner {52 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::MarkStack&);53 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);54 };55 56 51 bool JSCSSRuleOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack) 57 52 { … … 60 55 return false; 61 56 return markStack.containsOpaqueRoot(root(jsCSSRule->impl())); 62 }63 64 void JSCSSRuleOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)65 {66 JSCSSRule* jsCSSRule = static_cast<JSCSSRule*>(handle.get().asCell());67 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);68 uncacheWrapper(world, jsCSSRule->impl(), jsCSSRule);69 }70 71 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, CSSRule*)72 {73 DEFINE_STATIC_LOCAL(JSCSSRuleOwner, jsCSSRuleOwner, ());74 return &jsCSSRuleOwner;75 }76 77 inline void* wrapperContext(DOMWrapperWorld* world, CSSRule*)78 {79 return world;80 57 } 81 58 -
trunk/Source/WebCore/bindings/js/JSCSSRuleListCustom.cpp
r84527 r84699 36 36 namespace WebCore { 37 37 38 class JSCSSRuleListOwner : public JSC::WeakHandleOwner {39 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::MarkStack&);40 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);41 };42 43 38 bool JSCSSRuleListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack) 44 39 { … … 53 48 } 54 49 55 void JSCSSRuleListOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)56 {57 JSCSSRuleList* jsCSSRuleList = static_cast<JSCSSRuleList*>(handle.get().asCell());58 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);59 uncacheWrapper(world, jsCSSRuleList->impl(), jsCSSRuleList);60 50 } 61 62 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, CSSRuleList*)63 {64 DEFINE_STATIC_LOCAL(JSCSSRuleListOwner, jsCSSRuleListOwner, ());65 return &jsCSSRuleListOwner;66 }67 68 inline void* wrapperContext(DOMWrapperWorld* world, CSSRuleList*)69 {70 return world;71 }72 73 JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, CSSRuleList* impl)74 {75 return wrap<JSCSSRuleList>(exec, globalObject, impl);76 }77 78 } -
trunk/Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
r84556 r84699 45 45 namespace WebCore { 46 46 47 class JSCSSStyleDeclarationOwner : public JSC::WeakHandleOwner {48 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::MarkStack&);49 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);50 };51 52 47 bool JSCSSStyleDeclarationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack) 53 48 { 54 49 JSCSSStyleDeclaration* jsCSSStyleDeclaration = static_cast<JSCSSStyleDeclaration*>(handle.get().asCell()); 55 50 return markStack.containsOpaqueRoot(root(jsCSSStyleDeclaration->impl())); 56 }57 58 void JSCSSStyleDeclarationOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)59 {60 JSCSSStyleDeclaration* jsCSSStyleDeclaration = static_cast<JSCSSStyleDeclaration*>(handle.get().asCell());61 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);62 uncacheWrapper(world, jsCSSStyleDeclaration->impl(), jsCSSStyleDeclaration);63 }64 65 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, CSSStyleDeclaration*)66 {67 DEFINE_STATIC_LOCAL(JSCSSStyleDeclarationOwner, jsCSSStyleDeclarationOwner, ());68 return &jsCSSStyleDeclarationOwner;69 }70 71 inline void* wrapperContext(DOMWrapperWorld* world, CSSStyleDeclaration*)72 {73 return world;74 51 } 75 52 … … 225 202 } 226 203 227 JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, CSSStyleDeclaration* impl)228 {229 return wrap<JSCSSStyleDeclaration>(exec, globalObject, impl);230 }231 232 204 } // namespace WebCore -
trunk/Source/WebCore/bindings/js/JSCSSValueCustom.cpp
r84527 r84699 53 53 } 54 54 55 class JSCSSValueOwner : public JSC::WeakHandleOwner {56 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::MarkStack&);57 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);58 };59 60 55 bool JSCSSValueOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack) 61 56 { … … 75 70 uncacheWrapper(world, jsCSSValue->impl(), jsCSSValue); 76 71 cssValueRoots().remove(jsCSSValue->impl()); 77 }78 79 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, CSSValue*)80 {81 DEFINE_STATIC_LOCAL(JSCSSValueOwner, jsCSSValueOwner, ());82 return &jsCSSValueOwner;83 }84 85 inline void* wrapperContext(DOMWrapperWorld* world, CSSValue*)86 {87 return world;88 72 } 89 73 -
trunk/Source/WebCore/bindings/js/JSCanvasRenderingContextCustom.cpp
r84584 r84699 40 40 namespace WebCore { 41 41 42 class JSCanvasRenderingContextOwner : public JSC::WeakHandleOwner {43 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::MarkStack&);44 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);45 };46 47 42 bool JSCanvasRenderingContextOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack) 48 43 { … … 51 46 return false; 52 47 return markStack.containsOpaqueRoot(root(jsCanvasRenderingContext->impl()->canvas())); 53 }54 55 void JSCanvasRenderingContextOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)56 {57 JSCanvasRenderingContext* jsCanvasRenderingContext = static_cast<JSCanvasRenderingContext*>(handle.get().asCell());58 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);59 uncacheWrapper(world, jsCanvasRenderingContext->impl(), jsCanvasRenderingContext);60 }61 62 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, CanvasRenderingContext*)63 {64 DEFINE_STATIC_LOCAL(JSCanvasRenderingContextOwner, jsCanvasRenderingContextOwner, ());65 return &jsCanvasRenderingContextOwner;66 }67 68 inline void* wrapperContext(DOMWrapperWorld* world, CanvasRenderingContext*)69 {70 return world;71 48 } 72 49 -
trunk/Source/WebCore/bindings/js/JSDOMImplementationCustom.cpp
r84665 r84699 30 30 namespace WebCore { 31 31 32 class JSDOMImplementationOwner : public JSC::WeakHandleOwner {33 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);34 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);35 };36 37 32 bool JSDOMImplementationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 38 33 { … … 43 38 } 44 39 45 void JSDOMImplementationOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)46 {47 JSDOMImplementation* jsDOMImplementation = static_cast<JSDOMImplementation*>(handle.get().asCell());48 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);49 uncacheWrapper(world, jsDOMImplementation->impl(), jsDOMImplementation);50 40 } 51 52 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, DOMImplementation*)53 {54 DEFINE_STATIC_LOCAL(JSDOMImplementationOwner, jsDOMImplementationOwner, ());55 return &jsDOMImplementationOwner;56 }57 58 inline void* wrapperContext(DOMWrapperWorld* world, DOMImplementation*)59 {60 return world;61 }62 63 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DOMImplementation* impl)64 {65 return wrap<JSDOMImplementation>(exec, globalObject, impl);66 }67 68 } -
trunk/Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp
r84665 r84699 36 36 namespace WebCore { 37 37 38 class JSDOMStringMapOwner : public JSC::WeakHandleOwner {39 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);40 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);41 };42 43 38 bool JSDOMStringMapOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 44 39 { … … 47 42 return false; 48 43 return visitor.containsOpaqueRoot(root(jsDOMStringMap->impl()->element())); 49 }50 51 void JSDOMStringMapOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)52 {53 JSDOMStringMap* jsDOMStringMap = static_cast<JSDOMStringMap*>(handle.get().asCell());54 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);55 uncacheWrapper(world, jsDOMStringMap->impl(), jsDOMStringMap);56 }57 58 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, DOMStringMap*)59 {60 DEFINE_STATIC_LOCAL(JSDOMStringMapOwner, jsDOMStringMapOwner, ());61 return &jsDOMStringMapOwner;62 }63 64 inline void* wrapperContext(DOMWrapperWorld* world, DOMStringMap*)65 {66 return world;67 44 } 68 45 … … 133 110 } 134 111 135 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DOMStringMap* impl)136 {137 return wrap<JSDOMStringMap>(exec, globalObject, impl);138 }139 140 112 } // namespace WebCore -
trunk/Source/WebCore/bindings/js/JSDOMTokenListCustom.cpp
r84665 r84699 35 35 namespace WebCore { 36 36 37 class JSDOMTokenListOwner : public JSC::WeakHandleOwner {38 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);39 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);40 };41 42 37 bool JSDOMTokenListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 43 38 { … … 51 46 } 52 47 53 void JSDOMTokenListOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)54 {55 JSDOMTokenList* jsDOMTokenList = static_cast<JSDOMTokenList*>(handle.get().asCell());56 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);57 uncacheWrapper(world, jsDOMTokenList->impl(), jsDOMTokenList);58 }59 60 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, DOMTokenList*)61 {62 DEFINE_STATIC_LOCAL(JSDOMTokenListOwner, jsDOMTokenListOwner, ());63 return &jsDOMTokenListOwner;64 }65 66 inline void* wrapperContext(DOMWrapperWorld* world, DOMTokenList*)67 {68 return world;69 }70 71 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DOMTokenList* impl)72 {73 return wrap<JSDOMTokenList>(exec, globalObject, impl);74 }75 76 48 } // namespace WebCore -
trunk/Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
r84584 r84699 38 38 namespace WebCore { 39 39 40 class JSHTMLCollectionOwner : public JSC::WeakHandleOwner {41 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::MarkStack&);42 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);43 };44 45 40 bool JSHTMLCollectionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack) 46 41 { … … 49 44 return false; 50 45 return markStack.containsOpaqueRoot(root(jsHTMLCollection->impl()->base())); 51 }52 53 void JSHTMLCollectionOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)54 {55 JSHTMLCollection* jsHTMLCollection = static_cast<JSHTMLCollection*>(handle.get().asCell());56 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);57 uncacheWrapper(world, jsHTMLCollection->impl(), jsHTMLCollection);58 }59 60 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, HTMLCollection*)61 {62 DEFINE_STATIC_LOCAL(JSHTMLCollectionOwner, jsHTMLCollectionOwner, ());63 return &jsHTMLCollectionOwner;64 }65 66 inline void* wrapperContext(DOMWrapperWorld* world, HTMLCollection*)67 {68 return world;69 46 } 70 47 -
trunk/Source/WebCore/bindings/js/JSMediaListCustom.cpp
r84527 r84699 34 34 namespace WebCore { 35 35 36 class JSMediaListOwner : public JSC::WeakHandleOwner {37 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::MarkStack&);38 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);39 };40 41 36 bool JSMediaListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack) 42 37 { … … 47 42 } 48 43 49 void JSMediaListOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)50 {51 JSMediaList* jsMediaList = static_cast<JSMediaList*>(handle.get().asCell());52 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);53 uncacheWrapper(world, jsMediaList->impl(), jsMediaList);54 }55 56 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, MediaList*)57 {58 DEFINE_STATIC_LOCAL(JSMediaListOwner, jsMediaListOwner, ());59 return &jsMediaListOwner;60 }61 62 inline void* wrapperContext(DOMWrapperWorld* world, MediaList*)63 {64 return world;65 }66 67 JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, MediaList* rule)68 {69 return wrap<JSMediaList>(exec, globalObject, rule);70 }71 72 44 } // namespace WebCore -
trunk/Source/WebCore/bindings/js/JSNamedNodeMapCustom.cpp
r84641 r84699 36 36 namespace WebCore { 37 37 38 class JSNamedNodeMapOwner : public JSC::WeakHandleOwner {39 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);40 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);41 };42 43 38 bool JSNamedNodeMapOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 44 39 { … … 50 45 return false; 51 46 return visitor.containsOpaqueRoot(root(element)); 52 }53 54 void JSNamedNodeMapOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)55 {56 JSNamedNodeMap* jsNamedNodeMap = static_cast<JSNamedNodeMap*>(handle.get().asCell());57 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);58 uncacheWrapper(world, jsNamedNodeMap->impl(), jsNamedNodeMap);59 }60 61 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, NamedNodeMap*)62 {63 DEFINE_STATIC_LOCAL(JSNamedNodeMapOwner, jsNamedNodeMapOwner, ());64 return &jsNamedNodeMapOwner;65 }66 67 inline void* wrapperContext(DOMWrapperWorld* world, NamedNodeMap*)68 {69 return world;70 47 } 71 48 … … 95 72 } 96 73 97 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, NamedNodeMap* impl)98 {99 return wrap<JSNamedNodeMap>(exec, globalObject, impl);100 }101 102 74 } // namespace WebCore -
trunk/Source/WebCore/bindings/js/JSNodeCustom.h
r84556 r84699 34 34 35 35 class CSSValue; 36 37 class JSNodeOwner : public JSC::WeakHandleOwner {38 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);39 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);40 };41 42 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, Node*)43 {44 DEFINE_STATIC_LOCAL(JSNodeOwner, jsNodeOwner, ());45 return &jsNodeOwner;46 }47 48 inline void* wrapperContext(DOMWrapperWorld* world, Node*)49 {50 return world;51 }52 36 53 37 inline JSDOMWrapper* getInlineCachedWrapper(DOMWrapperWorld* world, Node* node) -
trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp
r84641 r84699 37 37 namespace WebCore { 38 38 39 class JSNodeListOwner : public JSC::WeakHandleOwner {40 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);41 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);42 };43 44 39 bool JSNodeListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 45 40 { … … 50 45 return false; 51 46 return visitor.containsOpaqueRoot(root(static_cast<DynamicNodeList*>(jsNodeList->impl())->rootNode())); 52 }53 54 void JSNodeListOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)55 {56 JSNodeList* jsNodeList = static_cast<JSNodeList*>(handle.get().asCell());57 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);58 uncacheWrapper(world, jsNodeList->impl(), jsNodeList);59 }60 61 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, NodeList*)62 {63 DEFINE_STATIC_LOCAL(JSNodeListOwner, jsNodeListOwner, ());64 return &jsNodeListOwner;65 }66 67 inline void* wrapperContext(DOMWrapperWorld* world, NodeList*)68 {69 return world;70 }71 72 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, NodeList* impl)73 {74 return wrap<JSNodeList>(exec, globalObject, impl);75 47 } 76 48 -
trunk/Source/WebCore/bindings/js/JSStyleSheetCustom.cpp
r84556 r84699 36 36 namespace WebCore { 37 37 38 class JSStyleSheetOwner : public JSC::WeakHandleOwner {39 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::MarkStack&);40 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);41 };42 43 38 bool JSStyleSheetOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack) 44 39 { … … 47 42 return false; 48 43 return markStack.containsOpaqueRoot(root(jsStyleSheet->impl())); 49 }50 51 void JSStyleSheetOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)52 {53 JSStyleSheet* jsStyleSheet = static_cast<JSStyleSheet*>(handle.get().asCell());54 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);55 uncacheWrapper(world, jsStyleSheet->impl(), jsStyleSheet);56 }57 58 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, StyleSheet*)59 {60 DEFINE_STATIC_LOCAL(JSStyleSheetOwner, jsStyleSheetOwner, ());61 return &jsStyleSheetOwner;62 }63 64 inline void* wrapperContext(DOMWrapperWorld* world, StyleSheet*)65 {66 return world;67 44 } 68 45 -
trunk/Source/WebCore/bindings/js/JSStyleSheetListCustom.cpp
r84641 r84699 36 36 namespace WebCore { 37 37 38 class JSStyleSheetListOwner : public JSC::WeakHandleOwner {39 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::MarkStack&);40 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);41 };42 43 38 bool JSStyleSheetListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack) 44 39 { … … 50 45 return false; 51 46 return markStack.containsOpaqueRoot(document); 52 }53 54 void JSStyleSheetListOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)55 {56 JSStyleSheetList* jsStyleSheetList = static_cast<JSStyleSheetList*>(handle.get().asCell());57 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);58 uncacheWrapper(world, jsStyleSheetList->impl(), jsStyleSheetList);59 }60 61 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, StyleSheetList*)62 {63 DEFINE_STATIC_LOCAL(JSStyleSheetListOwner, jsStyleSheetListOwner, ());64 return &jsStyleSheetListOwner;65 }66 67 inline void* wrapperContext(DOMWrapperWorld* world, StyleSheetList*)68 {69 return world;70 47 } 71 48 … … 83 60 } 84 61 85 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, StyleSheetList* impl)86 {87 return wrap<JSStyleSheetList>(exec, globalObject, impl);88 }89 90 62 } // namespace WebCore -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r84641 r84699 915 915 } 916 916 917 if ($dataNode->extendedAttributes->{"CustomIsReachable"} || $dataNode->extendedAttributes->{"CustomFinalize"}) { 918 push(@headerContent, "class JS${implType}Owner : public JSC::WeakHandleOwner {\n"); 919 push(@headerContent, " virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);\n"); 920 push(@headerContent, " virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);\n"); 921 push(@headerContent, "};\n"); 922 push(@headerContent, "\n"); 923 push(@headerContent, "inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, $implType*)\n"); 924 push(@headerContent, "{\n"); 925 push(@headerContent, " DEFINE_STATIC_LOCAL(JS${implType}Owner, js${implType}Owner, ());\n"); 926 push(@headerContent, " return &js${implType}Owner;\n"); 927 push(@headerContent, "}\n"); 928 push(@headerContent, "\n"); 929 push(@headerContent, "inline void* wrapperContext(DOMWrapperWorld* world, $implType*)\n"); 930 push(@headerContent, "{\n"); 931 push(@headerContent, " return world;\n"); 932 push(@headerContent, "}\n"); 933 push(@headerContent, "\n"); 934 } 935 917 936 if (!$hasParent || $dataNode->extendedAttributes->{"GenerateToJS"} || $dataNode->extendedAttributes->{"CustomToJS"}) { 918 if ($svgPropertyType) { 919 push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*);\n"); 920 } else { 921 push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*);\n"); 922 } 937 push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*);\n"); 923 938 } 924 939 if (!$hasParent || $dataNode->extendedAttributes->{"GenerateNativeConverter"}) { … … 2112 2127 } 2113 2128 2129 if ($dataNode->extendedAttributes->{"CustomIsReachable"} && !$dataNode->extendedAttributes->{"CustomFinalize"}) { 2130 push(@implContent, "void JS${implType}Owner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)\n"); 2131 push(@implContent, "{\n"); 2132 push(@implContent, " JS${implType}* js${implType} = static_cast<JS${implType}*>(handle.get().asCell());\n"); 2133 push(@implContent, " DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);\n"); 2134 push(@implContent, " uncacheWrapper(world, js${implType}->impl(), js${implType});\n"); 2135 push(@implContent, "}\n"); 2136 } 2137 2114 2138 if ((!$hasParent or $dataNode->extendedAttributes->{"GenerateToJS"}) and !$dataNode->extendedAttributes->{"CustomToJS"}) { 2115 if ($svgPropertyType) { 2116 push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType* impl)\n"); 2117 } else { 2118 push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType* impl)\n"); 2119 } 2139 push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType* impl)\n"); 2120 2140 push(@implContent, "{\n"); 2121 2141 if ($svgPropertyType) { -
trunk/Source/WebCore/css/CSSRule.idl
r72819 r84699 24 24 interface [ 25 25 CustomMarkFunction, 26 CustomIsReachable, 26 27 CustomToJS, 27 28 Polymorphic -
trunk/Source/WebCore/css/CSSRuleList.idl
r84527 r84699 28 28 // Introduced in DOM Level 2: 29 29 interface [ 30 Custom ToJS,30 CustomIsReachable, 31 31 HasIndexGetter 32 32 ] CSSRuleList { -
trunk/Source/WebCore/css/CSSStyleDeclaration.idl
r84527 r84699 24 24 interface [ 25 25 CustomMarkFunction, 26 Custom ToJS,26 CustomIsReachable, 27 27 DelegatingPutFunction, 28 28 HasNameGetter, -
trunk/Source/WebCore/css/CSSValue.idl
r52921 r84699 23 23 interface [ 24 24 CustomToJS, 25 CustomIsReachable, 26 CustomFinalize, 25 27 Polymorphic 26 28 ] CSSValue { -
trunk/Source/WebCore/css/MediaList.idl
r84527 r84699 28 28 // Introduced in DOM Level 2: 29 29 interface [ 30 Custom ToJS,30 CustomIsReachable, 31 31 HasIndexGetter 32 32 ] MediaList { -
trunk/Source/WebCore/css/StyleSheet.idl
r60784 r84699 24 24 interface [ 25 25 CustomMarkFunction, 26 CustomIsReachable, 26 27 CustomToJS, 27 28 Polymorphic -
trunk/Source/WebCore/css/StyleSheetList.idl
r84527 r84699 23 23 // Introduced in DOM Level 2: 24 24 interface [ 25 Custom ToJS,25 CustomIsReachable, 26 26 HasIndexGetter, 27 27 HasNameGetter -
trunk/Source/WebCore/dom/DOMImplementation.idl
r84665 r84699 22 22 23 23 interface [ 24 Custom ToJS24 CustomIsReachable 25 25 ] DOMImplementation { 26 26 -
trunk/Source/WebCore/dom/DOMStringMap.idl
r84665 r84699 27 27 28 28 interface [ 29 Custom ToJS,29 CustomIsReachable, 30 30 HasNameGetter, 31 31 CustomDeleteProperty, -
trunk/Source/WebCore/dom/NamedNodeMap.idl
r84194 r84699 22 22 23 23 interface [ 24 Custom ToJS,24 CustomIsReachable, 25 25 CustomMarkFunction, 26 26 HasIndexGetter, -
trunk/Source/WebCore/dom/Node.idl
r65226 r84699 25 25 CustomMarkFunction, 26 26 CustomPushEventHandlerScope, 27 CustomIsReachable, 28 CustomFinalize, 27 29 CustomToJS, 28 30 EventTarget, -
trunk/Source/WebCore/dom/NodeList.idl
r84309 r84699 22 22 23 23 interface [ 24 Custom ToJS,24 CustomIsReachable, 25 25 HasIndexGetter, 26 26 HasNameGetter, -
trunk/Source/WebCore/html/DOMTokenList.idl
r84665 r84699 26 26 27 27 interface [ 28 Custom ToJS,28 CustomIsReachable, 29 29 GenerateConstructor, 30 30 HasIndexGetter -
trunk/Source/WebCore/html/HTMLCollection.idl
r52921 r84699 26 26 CustomCall, 27 27 CustomToJS, 28 CustomIsReachable, 28 29 Polymorphic 29 30 ] HTMLCollection { -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext.idl
r84584 r84699 28 28 interface [ 29 29 CustomMarkFunction, 30 CustomIsReachable, 30 31 CustomToJS, 31 32 InterfaceUUID=98fb48ae-7216-489c-862b-8e1217fc4443,
Note: See TracChangeset
for help on using the changeset viewer.