Remove the CREATE_DOM_WRAPPER macro
https://bugs.webkit.org/show_bug.cgi?id=161580
Reviewed by Dan Bernstein.
The CREATE_DOM_WRAPPER has irritated me for too long! Replace it
with direct calls to createWrapper<ImplementationType>, which has
been upgraded to not require specifying both the implementation type
and the wrapper type by way of the new JSDOMWrapperConverterTraits
struct which provides mapping from ImplementationType -> JSWrapper.
createWrapper<ImplementationType> has also been upgraded to have a
specialization for when the object being passed in needs to be casted.
* bindings/js/JSAnimationTimelineCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSBlobCustom.cpp:
(WebCore::toJSNewlyCreated):
(WebCore::constructJSBlob):
* bindings/js/JSCSSRuleCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSDataCueCustom.cpp:
(WebCore::constructJSDataCue):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::createNewDocumentWrapper):
* bindings/js/JSDocumentFragmentCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSElementCustom.cpp:
(WebCore::createNewElementWrapper):
* bindings/js/JSEventCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSFileCustom.cpp:
(WebCore::constructJSFile):
* bindings/js/JSHTMLCollectionCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSIDBCursorCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSImageDataCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSNodeCustom.cpp:
(WebCore::createWrapperInline):
* bindings/js/JSNodeListCustom.cpp:
(WebCore::createWrapper):
* bindings/js/JSPerformanceEntryCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSSVGPathSegCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSStyleSheetCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSTextCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSTextTrackCueCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSXMLDocumentCustom.cpp:
(WebCore::toJSNewlyCreated):
* dom/make_names.pl:
(printWrapperFunctions):
(printWrapperFactoryCppFile):
Replace CREATE_DOM_WRAPPER with direct calls to createWrapper.
* bindings/js/JSWorkerGlobalScopeBase.h:
Add #include of JSDOMWrapper.h to allow generated subclasses to use
JSDOMWrapperConverterTraits.
* bindings/js/JSDOMBinding.h:
(WebCore::castDOMObjectForWrapperCreation): Deleted.
Remove CREATE_DOM_WRAPPER and castDOMObjectForWrapperCreation and
specialize createWrapper.
* bindings/js/JSDOMWrapper.h:
Forward declare JSDOMWrapperConverterTraits.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
Add specialization of JSDOMWrapperConverterTraits for each header.
(GenerateImplementation):
(GenerateConstructorDefinition):
Replace CREATE_DOM_WRAPPER with direct calls to createWrapper.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@205422 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/bindings/js/JSSVGPathSegCustom.cpp b/Source/WebCore/bindings/js/JSSVGPathSegCustom.cpp
index 7616c32..b474718 100644
--- a/Source/WebCore/bindings/js/JSSVGPathSegCustom.cpp
+++ b/Source/WebCore/bindings/js/JSSVGPathSegCustom.cpp
@@ -63,46 +63,46 @@
{
switch (object->pathSegType()) {
case SVGPathSeg::PATHSEG_CLOSEPATH:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegClosePath, WTFMove(object));
+ return createWrapper<SVGPathSegClosePath>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_MOVETO_ABS:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegMovetoAbs, WTFMove(object));
+ return createWrapper<SVGPathSegMovetoAbs>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_MOVETO_REL:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegMovetoRel, WTFMove(object));
+ return createWrapper<SVGPathSegMovetoRel>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_LINETO_ABS:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoAbs, WTFMove(object));
+ return createWrapper<SVGPathSegLinetoAbs>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_LINETO_REL:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoRel, WTFMove(object));
+ return createWrapper<SVGPathSegLinetoRel>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_CURVETO_CUBIC_ABS:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoCubicAbs, WTFMove(object));
+ return createWrapper<SVGPathSegCurvetoCubicAbs>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_CURVETO_CUBIC_REL:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoCubicRel, WTFMove(object));
+ return createWrapper<SVGPathSegCurvetoCubicRel>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_ABS:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoQuadraticAbs, WTFMove(object));
+ return createWrapper<SVGPathSegCurvetoQuadraticAbs>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_REL:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoQuadraticRel, WTFMove(object));
+ return createWrapper<SVGPathSegCurvetoQuadraticRel>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_ARC_ABS:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegArcAbs, WTFMove(object));
+ return createWrapper<SVGPathSegArcAbs>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_ARC_REL:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegArcRel, WTFMove(object));
+ return createWrapper<SVGPathSegArcRel>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_ABS:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoHorizontalAbs, WTFMove(object));
+ return createWrapper<SVGPathSegLinetoHorizontalAbs>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_REL:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoHorizontalRel, WTFMove(object));
+ return createWrapper<SVGPathSegLinetoHorizontalRel>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_LINETO_VERTICAL_ABS:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoVerticalAbs, WTFMove(object));
+ return createWrapper<SVGPathSegLinetoVerticalAbs>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_LINETO_VERTICAL_REL:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoVerticalRel, WTFMove(object));
+ return createWrapper<SVGPathSegLinetoVerticalRel>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoCubicSmoothAbs, WTFMove(object));
+ return createWrapper<SVGPathSegCurvetoCubicSmoothAbs>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoCubicSmoothRel, WTFMove(object));
+ return createWrapper<SVGPathSegCurvetoCubicSmoothRel>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoQuadraticSmoothAbs, WTFMove(object));
+ return createWrapper<SVGPathSegCurvetoQuadraticSmoothAbs>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoQuadraticSmoothRel, WTFMove(object));
+ return createWrapper<SVGPathSegCurvetoQuadraticSmoothRel>(globalObject, WTFMove(object));
case SVGPathSeg::PATHSEG_UNKNOWN:
default:
- return CREATE_DOM_WRAPPER(globalObject, SVGPathSeg, WTFMove(object));
+ return createWrapper<SVGPathSeg>(globalObject, WTFMove(object));
}
}