Remove the CREATE_DOM_WRAPPER macro
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Sep 2016 03:11:55 +0000 (03:11 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Sep 2016 03:11:55 +0000 (03:11 +0000)
commitedaee09fa001d268a55fe8732b2c7e95a20c52dd
tree05412a62b7ef8061192069e6419c15f0c5e8a943
parent6c04de5ee27fb13a48c649d0ebbc20bfa58ab7e2
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: https://svn.webkit.org/repository/webkit/trunk@205422 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSAnimationTimelineCustom.cpp
Source/WebCore/bindings/js/JSBlobCustom.cpp
Source/WebCore/bindings/js/JSCSSRuleCustom.cpp
Source/WebCore/bindings/js/JSCSSValueCustom.cpp
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bindings/js/JSDOMWrapper.h
Source/WebCore/bindings/js/JSDataCueCustom.cpp
Source/WebCore/bindings/js/JSDocumentCustom.cpp
Source/WebCore/bindings/js/JSDocumentFragmentCustom.cpp
Source/WebCore/bindings/js/JSElementCustom.cpp
Source/WebCore/bindings/js/JSEventCustom.cpp
Source/WebCore/bindings/js/JSFileCustom.cpp
Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
Source/WebCore/bindings/js/JSIDBCursorCustom.cpp
Source/WebCore/bindings/js/JSImageDataCustom.cpp
Source/WebCore/bindings/js/JSNodeCustom.cpp
Source/WebCore/bindings/js/JSNodeListCustom.cpp
Source/WebCore/bindings/js/JSPerformanceEntryCustom.cpp
Source/WebCore/bindings/js/JSSVGPathSegCustom.cpp
Source/WebCore/bindings/js/JSStyleSheetCustom.cpp
Source/WebCore/bindings/js/JSTextCustom.cpp
Source/WebCore/bindings/js/JSTextTrackCueCustom.cpp
Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp
Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.h
Source/WebCore/bindings/js/JSXMLDocumentCustom.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/dom/make_names.pl