Move webkitGetUserMedia to JS Builtin
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 13:43:56 +0000 (13:43 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 13:43:56 +0000 (13:43 +0000)
commit5319e0e7e46e65f84f5544b049a468f4c1121598
tree28917bf0c947ea57dfaf4f682188fefd5037c64c
parent679f727e8711bfe19b3aecf66835e54064343c9a
Move webkitGetUserMedia to JS Builtin
https://bugs.webkit.org/show_bug.cgi?id=149499

Reviewed by Darin Adler.

Source/WebCore:

Implemented webkitGetUserMedia as a JSBuiltin wrapper around navigator.mediaDevices.getUserMedia.

Removed cpp based version.

The js builting implementation checks for argument but does not raise exception when the request is not supported.
The error callback is called instead, in an asynchronous fashion.
The js builtin implementation does not check first that it is called on navigator, contrary to the cpp implementation.
This is done afterwards when calling navigator.MediaDevices.@getUserMedia.

Covered by existing and modified tests.

* CMakeLists.txt: Adding NavigatorUserMedia.js as built-in JS file.
* DerivedSources.make: Ditto.
* Modules/mediastream/NavigatorUserMedia.idl: Making webkitGetUserMedia JSBuiltin
* Modules/mediastream/NavigatorUserMedia.js:
(webkitGetUserMedia):
* Modules/mediastream/NavigatorUserMediaErrorCallback.h: Removed.
* Modules/mediastream/NavigatorUserMediaErrorCallback.idl: Removed.
* Modules/mediastream/NavigatorUserMediaSuccessCallback.h: Removed.
* Modules/mediastream/NavigatorUserMediaSuccessCallback.idl: Removed.
* Modules/mediastream/UserMediaRequest.cpp:
* Modules/mediastream/UserMediaRequest.h:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::finishCreation): Style modifications.
* bindings/js/JSNavigatorCustom.cpp: Removed.
* bindings/js/WebCoreJSBuiltins.cpp: Adding support for NavigatorUserMedia.js built-in JS file.
* bindings/js/WebCoreJSBuiltins.h: Ditto.
(WebCore::JSBuiltinFunctions::JSBuiltinFunctions):
(WebCore::JSBuiltinFunctions::navigatorUserMediaBuiltins):

LayoutTests:

* fast/mediastream/argument-types-expected.txt:
* fast/mediastream/getusermedia-expected.txt:
* fast/mediastream/getusermedia.html:
* fast/mediastream/script-tests/argument-types.js:
* http/tests/media/media-stream/disconnected-frame-already-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191949 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/mediastream/argument-types-expected.txt
LayoutTests/fast/mediastream/getusermedia-expected.txt
LayoutTests/fast/mediastream/getusermedia.html
LayoutTests/fast/mediastream/script-tests/argument-types.js
LayoutTests/http/tests/media/media-stream/disconnected-frame-already-expected.txt
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/mediastream/NavigatorUserMedia.idl
Source/WebCore/Modules/mediastream/NavigatorUserMedia.js [new file with mode: 0644]
Source/WebCore/Modules/mediastream/NavigatorUserMediaErrorCallback.h [deleted file]
Source/WebCore/Modules/mediastream/NavigatorUserMediaErrorCallback.idl [deleted file]
Source/WebCore/Modules/mediastream/NavigatorUserMediaSuccessCallback.h [deleted file]
Source/WebCore/Modules/mediastream/NavigatorUserMediaSuccessCallback.idl [deleted file]
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/Modules/mediastream/UserMediaRequest.h
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bindings/js/JSNavigatorCustom.cpp [deleted file]
Source/WebCore/bindings/js/WebCoreJSBuiltins.cpp
Source/WebCore/bindings/js/WebCoreJSBuiltins.h