Bindings generator should generate code for Promise-based APIs
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jun 2015 19:26:47 +0000 (19:26 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jun 2015 19:26:47 +0000 (19:26 +0000)
commit8ad55a081af0ac33711edaaa2c3644ee6551940b
tree586e307bbbf17d5266f66a6f98e450f9546cc261
parent8e02a96366aa382d1096fef9e07e45c97331e1dd
Bindings generator should generate code for Promise-based APIs
https://bugs.webkit.org/show_bug.cgi?id=145833

Reviewed by Darin Adler.

Covered by existing tests.

* Modules/webaudio/AudioContext.idl: Removing custom binding for resume, suspend and close.
* bindings/js/JSAudioContextCustom.cpp: Ditto.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader): Refactoring to use IsReturningPromise.
(GenerateImplementation): Disabling include for return type if it is a promise.
(GenerateParametersCheck): Adding DeferredWrapper() as argument to the DOM method if JS method returns a promise.
(GenerateImplementationFunctionCall): Added support for promise-returning API.
(IsReturningPromise): Checking whether function is returning a promise.
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_test_promise_function):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj testPromiseFunction]):
* bindings/scripts/test/TestObj.idl: Adding promise returning function.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185464 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/webaudio/AudioContext.idl
Source/WebCore/bindings/js/JSAudioContextCustom.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
Source/WebCore/bindings/scripts/test/TestObj.idl