[WebIDL] Add proper parsing for Promises
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Nov 2016 21:16:44 +0000 (21:16 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Nov 2016 21:16:44 +0000 (21:16 +0000)
commitf803839283ac784ca3e327ee4e26d3f361ad16bf
tree3efc07cdf819163a58c1c684600ed09bbdd2322f
parentf836177e379df5d2f488bbb1815d314c35658142
[WebIDL] Add proper parsing for Promises
https://bugs.webkit.org/show_bug.cgi?id=164497

Patch by Sam Weinig <sam@webkit.org> on 2016-11-09
Reviewed by Tim Horton.

* bindings/scripts/IDLParser.pm:
(parseNonAnyType):
(parseStringType):
Require Promise types to declare the type they resolve to.

* bindings/js/JSDOMPromise.h:
Allow DOMPromise to be be parameterized on void. Add an SFINAE guarded
overload of resolve that takes no arguments when in a DOMPromise<void>.

* Modules/applepay/ApplePaySession.idl:
* Modules/fetch/DOMWindowFetch.idl:
* Modules/fetch/FetchBody.idl:
* Modules/fetch/FetchResponse.idl:
* Modules/fetch/WorkerGlobalScopeFetch.idl:
* Modules/mediastream/MediaDevices.idl:
* Modules/mediastream/MediaStreamTrack.idl:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/RTCStatsReport.idl:
* Modules/streams/ReadableStream.idl:
* Modules/streams/ReadableStreamDefaultReader.idl:
* Modules/streams/ReadableStreamSource.idl:
* Modules/streams/WritableStream.idl:
* Modules/webaudio/AudioContext.idl:
* bindings/scripts/test/TestNode.idl:
* bindings/scripts/test/TestObj.idl:
* crypto/SubtleCrypto.idl:
* crypto/WebKitSubtleCrypto.idl:
* css/FontFace.idl:
* css/FontFaceSet.idl:
* dom/CustomElementRegistry.idl:
* html/HTMLMediaElement.idl:
Update IDLs to specify the resolve type of promise types.

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::replaceTrack):
(WebCore::MediaEndpointPeerConnection::replaceTrackTask):
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::applyConstraints):
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
(WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/streams/ReadableStreamSource.h:
(WebCore::ReadableStreamSource::start):
(WebCore::ReadableStreamSource::pull):
(WebCore::ReadableStreamSource::startFinished):
(WebCore::ReadableStreamSource::pullFinished):
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::addReaction):
(WebCore::AudioContext::setState):
(WebCore::AudioContext::suspend):
(WebCore::AudioContext::resume):
(WebCore::AudioContext::close):
* Modules/webaudio/AudioContext.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::rejectPendingPlayPromises):
(WebCore::HTMLMediaElement::resolvePendingPlayPromises):
(WebCore::HTMLMediaElement::play):
* html/HTMLMediaElement.h:
Update implementations to use DOMPromise<void> rather than DOMPromise<nullptr_t>
and use the new resolve() overload.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208474 268f45cc-cd09-0410-ab3c-d52691b4dbfc
36 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/applepay/ApplePaySession.idl
Source/WebCore/Modules/fetch/DOMWindowFetch.idl
Source/WebCore/Modules/fetch/FetchBody.idl
Source/WebCore/Modules/fetch/FetchResponse.idl
Source/WebCore/Modules/fetch/WorkerGlobalScopeFetch.idl
Source/WebCore/Modules/mediastream/MediaDevices.idl
Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.h
Source/WebCore/Modules/mediastream/MediaStreamTrack.idl
Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
Source/WebCore/Modules/mediastream/RTCPeerConnection.idl
Source/WebCore/Modules/mediastream/RTCRtpSender.idl
Source/WebCore/Modules/mediastream/RTCStatsReport.idl
Source/WebCore/Modules/streams/ReadableStream.idl
Source/WebCore/Modules/streams/ReadableStreamDefaultReader.idl
Source/WebCore/Modules/streams/ReadableStreamSource.h
Source/WebCore/Modules/streams/ReadableStreamSource.idl
Source/WebCore/Modules/streams/WritableStream.idl
Source/WebCore/Modules/webaudio/AudioContext.cpp
Source/WebCore/Modules/webaudio/AudioContext.h
Source/WebCore/Modules/webaudio/AudioContext.idl
Source/WebCore/bindings/js/JSDOMPromise.h
Source/WebCore/bindings/scripts/IDLParser.pm
Source/WebCore/bindings/scripts/test/TestNode.idl
Source/WebCore/bindings/scripts/test/TestObj.idl
Source/WebCore/crypto/SubtleCrypto.idl
Source/WebCore/crypto/WebKitSubtleCrypto.idl
Source/WebCore/css/FontFace.idl
Source/WebCore/css/FontFaceSet.idl
Source/WebCore/dom/CustomElementRegistry.idl
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLMediaElement.idl