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)
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

index 6f244e10433352ee45e365b0a1f810426265516d..edec0ad1e728df2d3dcbce8cfb9f044f8f0d833c 100644 (file)
@@ -1,3 +1,16 @@
+2015-11-03  Youenn Fablet  <youenn.fablet@crf.canon.fr>
+
+        Move webkitGetUserMedia to JS Builtin
+        https://bugs.webkit.org/show_bug.cgi?id=149499
+
+        Reviewed by Darin Adler.
+
+        * 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:
+
 2015-11-02  Keith Rollin  <krollin@apple.com>
 
         input[type=number] does not increment/decrement integers with trailing decimal characters
index 4224d40202299f00212e2721f21e433fcd5e2924..5cbc4858827629bcf484e6f6412f59fe1034c1cf 100644 (file)
@@ -30,7 +30,7 @@ PASS navigator.webkitGetUserMedia({video: true}, true) threw exception TypeError
 PASS navigator.webkitGetUserMedia({video: true}, 42) threw exception TypeError: Not enough arguments.
 PASS navigator.webkitGetUserMedia({video: true}, Infinity) threw exception TypeError: Not enough arguments.
 PASS navigator.webkitGetUserMedia({video: true}, -Infinity) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({ }, emptyFunction, emptyFunction) threw exception Error: NotSupportedError: DOM Exception 9.
+PASS navigator.webkitGetUserMedia({ }, emptyFunction, emptyFunction) did not throw exception.
 PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, emptyFunction) did not throw exception.
 PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
 PASS navigator.webkitGetUserMedia({audio:true, video:true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
index dca5fb961cf6eb5f445ab450aa0b3e52d410708a..d6cfeb490cc02160fddd3a23f8303f2ae5c7da06 100644 (file)
@@ -3,9 +3,10 @@ Tests webkitGetUserMedia.
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS navigator.webkitGetUserMedia({audio:false, video:false}, error, error); threw exception Error: NotSupportedError: DOM Exception 9.
+PASS navigator.webkitGetUserMedia({audio:false, video:false}, error, expectedError); did not throw exception.
 PASS navigator.webkitGetUserMedia({audio:false, video:false}, error, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
 PASS navigator.webkitGetUserMedia({audio:true}, gotStream1, error); did not throw exception.
+PASS Error callback called.
 PASS Stream generated.
 PASS stream.getAudioTracks().length is 1
 PASS stream.getVideoTracks().length is 0
index 13fae130672bd1544eb7ba6c2ee1b1d847a49d51..e33839f1e4739fbb9726f13007748b158d4d0928 100644 (file)
                 finishJSTest();
             }
 
+            function expectedError() {
+                testPassed('Error callback called.');
+            }
+
             function gotStreamInError(s) {
                 testFailed('Stream generated.');
                 finishJSTest();
@@ -87,7 +91,7 @@
                 shouldNotThrow("navigator.webkitGetUserMedia({video:true}, gotStream2, error);")
             }
 
-            shouldThrow("navigator.webkitGetUserMedia({audio:false, video:false}, error, error);")
+            shouldNotThrow("navigator.webkitGetUserMedia({audio:false, video:false}, error, expectedError);")
             shouldThrow("navigator.webkitGetUserMedia({audio:false, video:false}, error, null);")
 
             setUserMediaPermission(true);
index 11adf893677d1bb2a784e964d927cda4baa37793..ff08b400694847158ad561cc5f338f4d26b46205 100644 (file)
@@ -54,7 +54,7 @@ test('navigator.webkitGetUserMedia({video: true}, Infinity)', true);
 test('navigator.webkitGetUserMedia({video: true}, -Infinity)', true);
 
 // 3 Arguments.
-test('navigator.webkitGetUserMedia({ }, emptyFunction, emptyFunction)', true, notSupportedError);
+test('navigator.webkitGetUserMedia({ }, emptyFunction, emptyFunction)', false);
 test('navigator.webkitGetUserMedia({video: true}, emptyFunction, emptyFunction)', false);
 test('navigator.webkitGetUserMedia({video: true}, emptyFunction, undefined)', true, errorCallbackError);
 test('navigator.webkitGetUserMedia({audio:true, video:true}, emptyFunction, undefined)', true, errorCallbackError);
index e505db9b2c7eb63933f9ef105b30d925d096d571..2ac3147772eae1633438fdafad530a5f5258bb4d 100644 (file)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 24: NotSupportedError: DOM Exception 9: The implementation did not support the requested type of object or operation.
+CONSOLE MESSAGE: line 24: TypeError: The implementation did not support the requested type of object or operation.
 Tests that when a getUserMedia request is made after its frame has been disconnected, no callbacks are made and no crash occurs.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
index 2d931bd410578300c0cc7867e1ab4fb40ad1685b..b52dace264fd5babc5f9970e28d3b9ae2edda16f 100644 (file)
@@ -241,8 +241,6 @@ set(WebCore_NON_SVG_IDL_FILES
     Modules/mediastream/NavigatorMediaDevices.idl
     Modules/mediastream/NavigatorUserMedia.idl
     Modules/mediastream/NavigatorUserMediaError.idl
-    Modules/mediastream/NavigatorUserMediaErrorCallback.idl
-    Modules/mediastream/NavigatorUserMediaSuccessCallback.idl
     Modules/mediastream/RTCConfiguration.idl
     Modules/mediastream/RTCDTMFSender.idl
     Modules/mediastream/RTCDTMFToneChangeEvent.idl
@@ -1201,7 +1199,6 @@ set(WebCore_SOURCES
     bindings/js/JSMutationCallback.cpp
     bindings/js/JSMutationObserverCustom.cpp
     bindings/js/JSNamedNodeMapCustom.cpp
-    bindings/js/JSNavigatorCustom.cpp
     bindings/js/JSNodeCustom.cpp
     bindings/js/JSNodeFilterCustom.cpp
     bindings/js/JSNodeIteratorCustom.cpp
@@ -3588,6 +3585,7 @@ GENERATE_BINDINGS(WebCoreTestSupport_SOURCES
 
 set(WebCore_BUILTINS_SOURCES
     ${WEBCORE_DIR}/Modules/mediastream/MediaDevices.js
+    ${WEBCORE_DIR}/Modules/mediastream/NavigatorUserMedia.js
     ${WEBCORE_DIR}/Modules/streams/ByteLengthQueuingStrategy.js
     ${WEBCORE_DIR}/Modules/streams/CountQueuingStrategy.js
     ${WEBCORE_DIR}/Modules/streams/ReadableStream.js
index 69e09ca845dedfde4b8ebe013029072036e29ded..13694e7fd395f1c0446074ad95e2018e5e415bf6 100644 (file)
@@ -1,3 +1,41 @@
+2015-11-03  Youenn Fablet  <youenn.fablet@crf.canon.fr>
+
+        Move webkitGetUserMedia to JS Builtin
+        https://bugs.webkit.org/show_bug.cgi?id=149499
+
+        Reviewed by Darin Adler.
+
+        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):
+
 2015-11-03  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GStreamer] Use GstBus sync message handler and schedule tasks to the main thread with RunLoop::dispatch
index dfda2f27ffb97607ab0ac306e6746b9849e81955..52425f8650593b26b511d03626a56d5cad2dfec5 100644 (file)
@@ -137,8 +137,6 @@ NON_SVG_BINDING_IDLS = \
     $(WebCore)/Modules/mediastream/NavigatorMediaDevices.idl \
     $(WebCore)/Modules/mediastream/NavigatorUserMedia.idl \
     $(WebCore)/Modules/mediastream/NavigatorUserMediaError.idl \
-    $(WebCore)/Modules/mediastream/NavigatorUserMediaErrorCallback.idl \
-    $(WebCore)/Modules/mediastream/NavigatorUserMediaSuccessCallback.idl \
     $(WebCore)/Modules/mediastream/RTCConfiguration.idl \
     $(WebCore)/Modules/mediastream/RTCDTMFSender.idl \
     $(WebCore)/Modules/mediastream/RTCDTMFToneChangeEvent.idl \
@@ -1257,6 +1255,7 @@ WebReplayInputs.h : $(INPUT_GENERATOR_SPECIFICATIONS) $(INPUT_GENERATOR_SCRIPTS)
 
 WebCore_BUILTINS_SOURCES = \
     $(WebCore)/Modules/mediastream/MediaDevices.js \
+    $(WebCore)/Modules/mediastream/NavigatorUserMedia.js \
     $(WebCore)/Modules/streams/ByteLengthQueuingStrategy.js \
     $(WebCore)/Modules/streams/CountQueuingStrategy.js \
     $(WebCore)/Modules/streams/ReadableStream.js \
index 4c65cb7ae12c43aa4b394ff3d3ef4c9f9165f865..3aa493f0f959bad229be1c94a8f11ba5294517a0 100644 (file)
@@ -20,8 +20,6 @@
 [
     Conditional=MEDIA_STREAM,
 ] partial interface Navigator {
-    [Custom, RaisesException] void webkitGetUserMedia(Dictionary options,
-                                                 NavigatorUserMediaSuccessCallback successCallback,
-                                                 optional NavigatorUserMediaErrorCallback errorCallback);
+    [JSBuiltin] void webkitGetUserMedia(Dictionary object, any successCallback, any errorCallback);
 };
 
diff --git a/Source/WebCore/Modules/mediastream/NavigatorUserMedia.js b/Source/WebCore/Modules/mediastream/NavigatorUserMedia.js
new file mode 100644 (file)
index 0000000..9579ac6
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2015 Canon Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+function webkitGetUserMedia(options, successCallback, errorCallback)
+{
+    "use strict";
+
+    // FIXME: We should raise a DOM unsupported exception if there is no navigator and properly detect whether method is not called on a Navigator object.
+    if (!(this.mediaDevices && this.mediaDevices.@getUserMediaFromJS))
+        throw new @TypeError("The implementation did not support the requested type of object or operation.");
+
+    if (arguments.length < 3)
+        throw new @TypeError("Not enough arguments");
+
+    if (options !== Object(options))
+        throw new @TypeError("Argument 1 (options) to Navigator.webkitGetUserMedia must be an object");
+
+    if (typeof successCallback !== "function")
+        throw new @TypeError("Argument 2 ('successCallback') to Navigator.webkitGetUserMedia must be a function");
+    if (typeof errorCallback !== "function")
+        throw new @TypeError("Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function");
+
+    this.mediaDevices.@getUserMediaFromJS(options).then(successCallback, errorCallback);
+}
diff --git a/Source/WebCore/Modules/mediastream/NavigatorUserMediaErrorCallback.h b/Source/WebCore/Modules/mediastream/NavigatorUserMediaErrorCallback.h
deleted file mode 100644 (file)
index dd3c8b3..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef NavigatorUserMediaErrorCallback_h
-#define NavigatorUserMediaErrorCallback_h
-
-#if ENABLE(MEDIA_STREAM)
-
-#include "NavigatorUserMediaError.h"
-#include <wtf/RefCounted.h>
-
-namespace WebCore {
-
-class NavigatorUserMediaErrorCallback : public RefCounted<NavigatorUserMediaErrorCallback> {
-public:
-    virtual ~NavigatorUserMediaErrorCallback() { }
-    virtual bool handleEvent(NavigatorUserMediaError*) = 0;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM)
-
-#endif // NavigatorUserMediaErrorCallback_h
diff --git a/Source/WebCore/Modules/mediastream/NavigatorUserMediaErrorCallback.idl b/Source/WebCore/Modules/mediastream/NavigatorUserMediaErrorCallback.idl
deleted file mode 100644 (file)
index f0ac7dd..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    Conditional=MEDIA_STREAM,
-    Callback=FunctionOnly,
-] callback interface NavigatorUserMediaErrorCallback {
-    boolean handleEvent(NavigatorUserMediaError error);
-};
-
diff --git a/Source/WebCore/Modules/mediastream/NavigatorUserMediaSuccessCallback.h b/Source/WebCore/Modules/mediastream/NavigatorUserMediaSuccessCallback.h
deleted file mode 100644 (file)
index 9f456ea..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef NavigatorUserMediaSuccessCallback_h
-#define NavigatorUserMediaSuccessCallback_h
-
-#if ENABLE(MEDIA_STREAM)
-
-#include <wtf/RefCounted.h>
-
-namespace WebCore {
-
-class MediaStream;
-
-class NavigatorUserMediaSuccessCallback : public RefCounted<NavigatorUserMediaSuccessCallback> {
-public:
-    virtual ~NavigatorUserMediaSuccessCallback() { }
-    virtual bool handleEvent(MediaStream*) = 0;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM)
-
-#endif // NavigatorUserMediaSuccessCallback_h
diff --git a/Source/WebCore/Modules/mediastream/NavigatorUserMediaSuccessCallback.idl b/Source/WebCore/Modules/mediastream/NavigatorUserMediaSuccessCallback.idl
deleted file mode 100644 (file)
index 2d190cf..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    Conditional=MEDIA_STREAM,
-    Callback=FunctionOnly,
-] callback interface NavigatorUserMediaSuccessCallback {
-    boolean handleEvent(MediaStream stream);
-};
-
index c3f3380fabbfbe15c3162f3b73d746beaa677fa3..d3fc3bfaa7e29a8a31d77139cacb79cda43e8717 100644 (file)
@@ -47,8 +47,6 @@
 #include "MediaConstraintsImpl.h"
 #include "MediaStream.h"
 #include "MediaStreamPrivate.h"
-#include "NavigatorUserMediaErrorCallback.h"
-#include "NavigatorUserMediaSuccessCallback.h"
 #include "RealtimeMediaSourceCenter.h"
 #include "SecurityOrigin.h"
 #include "UserMediaController.h"
index dd20113cac55d714e3dc253514ab403e72638216..ecea59a6ca6ce7b341cdc07471aaf249e2be5167 100644 (file)
@@ -49,8 +49,6 @@ class Document;
 class Frame;
 class MediaConstraints;
 class MediaStreamPrivate;
-class NavigatorUserMediaErrorCallback;
-class NavigatorUserMediaSuccessCallback;
 class UserMediaController;
 class SecurityOrigin;
 
index 95b1babab8657936d6e657eacb7bf8b783fa1e93..45b44642aed430adb4f1be8220e1cbd5eeaa3712 100644 (file)
                073794E219EE2D1B00E5A045 /* MediaConstraintsMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 073794E019EE2D1B00E5A045 /* MediaConstraintsMock.h */; };
                073794E519EE2FF200E5A045 /* JSRTCConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073794E319EE2FF200E5A045 /* JSRTCConfiguration.cpp */; };
                073794E619EE2FF200E5A045 /* JSRTCConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 073794E419EE2FF200E5A045 /* JSRTCConfiguration.h */; };
-               073794E819EE335C00E5A045 /* JSNavigatorCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073794E719EE335C00E5A045 /* JSNavigatorCustom.cpp */; };
                073794EB19EE341E00E5A045 /* JSRTCIceServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073794E919EE341E00E5A045 /* JSRTCIceServer.cpp */; };
                073794EC19EE341E00E5A045 /* JSRTCIceServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 073794EA19EE341E00E5A045 /* JSRTCIceServer.h */; };
                073794F119EE37BB00E5A045 /* RTCPeerConnectionHandlerMock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073794EF19EE37BB00E5A045 /* RTCPeerConnectionHandlerMock.cpp */; };
                073BE34117D17E01002BD431 /* JSNavigatorUserMedia.h in Headers */ = {isa = PBXBuildFile; fileRef = 073BE33F17D17E01002BD431 /* JSNavigatorUserMedia.h */; settings = {ATTRIBUTES = (Private, ); }; };
                073BE34817D17E7A002BD431 /* JSNavigatorUserMediaError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073BE34217D17E7A002BD431 /* JSNavigatorUserMediaError.cpp */; };
                073BE34917D17E7A002BD431 /* JSNavigatorUserMediaError.h in Headers */ = {isa = PBXBuildFile; fileRef = 073BE34317D17E7A002BD431 /* JSNavigatorUserMediaError.h */; };
-               073BE34A17D17E7A002BD431 /* JSNavigatorUserMediaErrorCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073BE34417D17E7A002BD431 /* JSNavigatorUserMediaErrorCallback.cpp */; };
-               073BE34B17D17E7A002BD431 /* JSNavigatorUserMediaErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 073BE34517D17E7A002BD431 /* JSNavigatorUserMediaErrorCallback.h */; };
-               073BE34C17D17E7A002BD431 /* JSNavigatorUserMediaSuccessCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073BE34617D17E7A002BD431 /* JSNavigatorUserMediaSuccessCallback.cpp */; };
-               073BE34D17D17E7A002BD431 /* JSNavigatorUserMediaSuccessCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 073BE34717D17E7A002BD431 /* JSNavigatorUserMediaSuccessCallback.h */; };
                073BE34E17D180B2002BD431 /* RTCSessionDescriptionDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221BAB17CF0AD400848E51 /* RTCSessionDescriptionDescriptor.cpp */; };
                073BE34F17D18183002BD431 /* RTCIceCandidateDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221BA617CF0AD400848E51 /* RTCIceCandidateDescriptor.cpp */; };
                073BE35017D181A6002BD431 /* RTCPeerConnectionHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221BA817CF0AD400848E51 /* RTCPeerConnectionHandler.cpp */; };
                078E091817D14D1C00420AA1 /* MediaStreamTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B5517CEC32700848E51 /* MediaStreamTrack.h */; };
                078E091917D14D1C00420AA1 /* MediaStreamTrackEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B5817CEC32700848E51 /* MediaStreamTrackEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
                078E091B17D14D1C00420AA1 /* NavigatorUserMediaError.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B5D17CEC32700848E51 /* NavigatorUserMediaError.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               078E091C17D14D1C00420AA1 /* NavigatorUserMediaErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B5F17CEC32700848E51 /* NavigatorUserMediaErrorCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               078E091D17D14D1C00420AA1 /* NavigatorUserMediaSuccessCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B6117CEC32700848E51 /* NavigatorUserMediaSuccessCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
                078E091E17D14D1C00420AA1 /* RTCDataChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B6417CEC32700848E51 /* RTCDataChannel.h */; settings = {ATTRIBUTES = (Private, ); }; };
                078E091F17D14D1C00420AA1 /* RTCDataChannelEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B6717CEC32700848E51 /* RTCDataChannelEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
                078E092017D14D1C00420AA1 /* RTCDTMFSender.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B6A17CEC32700848E51 /* RTCDTMFSender.h */; settings = {ATTRIBUTES = (Private, ); }; };
                07221B5C17CEC32700848E51 /* NavigatorUserMedia.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorUserMedia.idl; sourceTree = "<group>"; };
                07221B5D17CEC32700848E51 /* NavigatorUserMediaError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigatorUserMediaError.h; sourceTree = "<group>"; };
                07221B5E17CEC32700848E51 /* NavigatorUserMediaError.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorUserMediaError.idl; sourceTree = "<group>"; };
-               07221B5F17CEC32700848E51 /* NavigatorUserMediaErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigatorUserMediaErrorCallback.h; sourceTree = "<group>"; };
-               07221B6017CEC32700848E51 /* NavigatorUserMediaErrorCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorUserMediaErrorCallback.idl; sourceTree = "<group>"; };
-               07221B6117CEC32700848E51 /* NavigatorUserMediaSuccessCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigatorUserMediaSuccessCallback.h; sourceTree = "<group>"; };
-               07221B6217CEC32700848E51 /* NavigatorUserMediaSuccessCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorUserMediaSuccessCallback.idl; sourceTree = "<group>"; };
                07221B6317CEC32700848E51 /* RTCDataChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCDataChannel.cpp; sourceTree = "<group>"; };
                07221B6417CEC32700848E51 /* RTCDataChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCDataChannel.h; sourceTree = "<group>"; };
                07221B6517CEC32700848E51 /* RTCDataChannel.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCDataChannel.idl; sourceTree = "<group>"; };
                073794E019EE2D1B00E5A045 /* MediaConstraintsMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaConstraintsMock.h; sourceTree = "<group>"; };
                073794E319EE2FF200E5A045 /* JSRTCConfiguration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCConfiguration.cpp; sourceTree = "<group>"; };
                073794E419EE2FF200E5A045 /* JSRTCConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCConfiguration.h; sourceTree = "<group>"; };
-               073794E719EE335C00E5A045 /* JSNavigatorCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNavigatorCustom.cpp; sourceTree = "<group>"; };
                073794E919EE341E00E5A045 /* JSRTCIceServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCIceServer.cpp; sourceTree = "<group>"; };
                073794EA19EE341E00E5A045 /* JSRTCIceServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCIceServer.h; sourceTree = "<group>"; };
                073794ED19EE364200E5A045 /* DOMURLMediaStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMURLMediaStream.cpp; sourceTree = "<group>"; };
                073BE33F17D17E01002BD431 /* JSNavigatorUserMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNavigatorUserMedia.h; sourceTree = "<group>"; };
                073BE34217D17E7A002BD431 /* JSNavigatorUserMediaError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNavigatorUserMediaError.cpp; sourceTree = "<group>"; };
                073BE34317D17E7A002BD431 /* JSNavigatorUserMediaError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNavigatorUserMediaError.h; sourceTree = "<group>"; };
-               073BE34417D17E7A002BD431 /* JSNavigatorUserMediaErrorCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNavigatorUserMediaErrorCallback.cpp; sourceTree = "<group>"; };
-               073BE34517D17E7A002BD431 /* JSNavigatorUserMediaErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNavigatorUserMediaErrorCallback.h; sourceTree = "<group>"; };
-               073BE34617D17E7A002BD431 /* JSNavigatorUserMediaSuccessCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNavigatorUserMediaSuccessCallback.cpp; sourceTree = "<group>"; };
-               073BE34717D17E7A002BD431 /* JSNavigatorUserMediaSuccessCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNavigatorUserMediaSuccessCallback.h; sourceTree = "<group>"; };
                074E82B818A69F0E007EF54C /* PlatformTimeRanges.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformTimeRanges.cpp; sourceTree = "<group>"; };
                074E82B918A69F0E007EF54C /* PlatformTimeRanges.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformTimeRanges.h; sourceTree = "<group>"; };
                0753860014489E9800B78452 /* CachedTextTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedTextTrack.cpp; sourceTree = "<group>"; };
                419BE7531BC7F3DB00E1C85B /* WebCoreJSBuiltinInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreJSBuiltinInternals.h; sourceTree = "<group>"; };
                419BE7541BC7F3DB00E1C85B /* WebCoreJSBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreJSBuiltins.cpp; sourceTree = "<group>"; };
                419BE7551BC7F3DB00E1C85B /* WebCoreJSBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreJSBuiltins.h; sourceTree = "<group>"; };
+               419BE75A1BCBD3ED00E1C85B /* NavigatorUserMedia.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = NavigatorUserMedia.js; sourceTree = "<group>"; };
                419FAFAD1ABABCD5005B828B /* ReadableStreamReader.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStreamReader.idl; sourceTree = "<group>"; };
                41A023ED1A39DB7900F722CF /* ReadableStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStream.idl; sourceTree = "<group>"; };
                41A023ED1A39DB7900F722DF /* WritableStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WritableStream.idl; sourceTree = "<group>"; };
                                5EA725CB1ACABCB500EAD17B /* NavigatorMediaDevices.h */,
                                5EA725CC1ACABCB500EAD17B /* NavigatorMediaDevices.idl */,
                                07221B5C17CEC32700848E51 /* NavigatorUserMedia.idl */,
+                               419BE75A1BCBD3ED00E1C85B /* NavigatorUserMedia.js */,
                                070327F717EA4AAF00CE1318 /* NavigatorUserMediaError.cpp */,
                                07221B5D17CEC32700848E51 /* NavigatorUserMediaError.h */,
                                07221B5E17CEC32700848E51 /* NavigatorUserMediaError.idl */,
-                               07221B5F17CEC32700848E51 /* NavigatorUserMediaErrorCallback.h */,
-                               07221B6017CEC32700848E51 /* NavigatorUserMediaErrorCallback.idl */,
-                               07221B6117CEC32700848E51 /* NavigatorUserMediaSuccessCallback.h */,
-                               07221B6217CEC32700848E51 /* NavigatorUserMediaSuccessCallback.idl */,
                                07AB996518DA3C010018771E /* RTCConfiguration.h */,
                                07AB996618DA3C010018771E /* RTCConfiguration.idl */,
                                07221B6317CEC32700848E51 /* RTCDataChannel.cpp */,
                                073BE33F17D17E01002BD431 /* JSNavigatorUserMedia.h */,
                                073BE34217D17E7A002BD431 /* JSNavigatorUserMediaError.cpp */,
                                073BE34317D17E7A002BD431 /* JSNavigatorUserMediaError.h */,
-                               073BE34417D17E7A002BD431 /* JSNavigatorUserMediaErrorCallback.cpp */,
-                               073BE34517D17E7A002BD431 /* JSNavigatorUserMediaErrorCallback.h */,
-                               073BE34617D17E7A002BD431 /* JSNavigatorUserMediaSuccessCallback.cpp */,
-                               073BE34717D17E7A002BD431 /* JSNavigatorUserMediaSuccessCallback.h */,
                                073794E319EE2FF200E5A045 /* JSRTCConfiguration.cpp */,
                                073794E419EE2FF200E5A045 /* JSRTCConfiguration.h */,
                                07969D9117D14151007FF842 /* JSRTCDataChannel.cpp */,
                                A1E5B31D1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp */,
                                C6F0917E143A2BB900685849 /* JSMutationObserverCustom.cpp */,
                                BCD9C25F0C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp */,
-                               073794E719EE335C00E5A045 /* JSNavigatorCustom.cpp */,
                                BCD9C2600C17AA67005C90A2 /* JSNodeCustom.cpp */,
                                BC9439C2116CF4940048C750 /* JSNodeCustom.h */,
                                1A750DD30A90E729000FF215 /* JSNodeIteratorCustom.cpp */,
                                A9D247F80D757E3400FDF959 /* JSNavigator.h in Headers */,
                                073BE34117D17E01002BD431 /* JSNavigatorUserMedia.h in Headers */,
                                073BE34917D17E7A002BD431 /* JSNavigatorUserMediaError.h in Headers */,
-                               073BE34B17D17E7A002BD431 /* JSNavigatorUserMediaErrorCallback.h in Headers */,
-                               073BE34D17D17E7A002BD431 /* JSNavigatorUserMediaSuccessCallback.h in Headers */,
                                BC9439C3116CF4940048C750 /* JSNodeCustom.h in Headers */,
                                14115B7309F84CD600CA4FC1 /* JSNodeFilter.h in Headers */,
                                1A750D8E0A90E521000FF215 /* JSNodeIterator.h in Headers */,
                                9711460414EF009A00674FD9 /* NavigatorGeolocation.h in Headers */,
                                5EA725D61ACABD5700EAD17B /* NavigatorMediaDevices.h in Headers */,
                                078E091B17D14D1C00420AA1 /* NavigatorUserMediaError.h in Headers */,
-                               078E091C17D14D1C00420AA1 /* NavigatorUserMediaErrorCallback.h in Headers */,
-                               078E091D17D14D1C00420AA1 /* NavigatorUserMediaSuccessCallback.h in Headers */,
                                A19D93461A9FEC7200B46C24 /* NEFilterSourceSPI.h in Headers */,
                                8A309C9F123950BE00CB9204 /* NestingLevelIncrementer.h in Headers */,
                                656D37430ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h in Headers */,
                                BCD9C2C00C17B69E005C90A2 /* JSNamedNodeMap.cpp in Sources */,
                                BCD9C2630C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp in Sources */,
                                A9D247F70D757E3400FDF959 /* JSNavigator.cpp in Sources */,
-                               073794E819EE335C00E5A045 /* JSNavigatorCustom.cpp in Sources */,
                                073BE34017D17E01002BD431 /* JSNavigatorUserMedia.cpp in Sources */,
                                073BE34817D17E7A002BD431 /* JSNavigatorUserMediaError.cpp in Sources */,
-                               073BE34A17D17E7A002BD431 /* JSNavigatorUserMediaErrorCallback.cpp in Sources */,
-                               073BE34C17D17E7A002BD431 /* JSNavigatorUserMediaSuccessCallback.cpp in Sources */,
                                14DC0D3709FED073007B0235 /* JSNode.cpp in Sources */,
                                BCD9C2640C17AA67005C90A2 /* JSNodeCustom.cpp in Sources */,
                                14115B7209F84CD600CA4FC1 /* JSNodeFilter.cpp in Sources */,
index f803dbecb194a565f98ace7ed657520668d38b73..db076358419e76f2e9980c7164ab09b5678275db 100644 (file)
@@ -3,6 +3,7 @@
  *  Copyright (C) 2006 Jon Shier (jshier@iastate.edu)
  *  Copyright (C) 2003-2009, 2014 Apple Inc. All rights reseved.
  *  Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
+ *  Copyright (c) 2015 Canon Inc. All rights reserved.
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
@@ -83,34 +84,35 @@ void JSDOMWindowBase::finishCreation(VM& vm, JSDOMWindowShell* shell)
 
     m_privateFunctions.init(*this);
 
+#if ENABLE(STREAMS_API)
+    JSVMClientData& clientData = *static_cast<JSVMClientData*>(vm.clientData);
+#endif
+
     GlobalPropertyInfo staticGlobals[] = {
         GlobalPropertyInfo(vm.propertyNames->document, jsNull(), DontDelete | ReadOnly),
         GlobalPropertyInfo(vm.propertyNames->window, m_shell, DontDelete | ReadOnly),
 #if ENABLE(STREAMS_API)
-        GlobalPropertyInfo(static_cast<JSVMClientData*>(vm.clientData)->builtinNames().streamClosedPrivateName(), jsNumber(1), DontDelete | ReadOnly),
-        GlobalPropertyInfo(static_cast<JSVMClientData*>(vm.clientData)->builtinNames().streamClosingPrivateName(), jsNumber(2), DontDelete | ReadOnly),
-        GlobalPropertyInfo(static_cast<JSVMClientData*>(vm.clientData)->builtinNames().streamErroredPrivateName(), jsNumber(3), DontDelete | ReadOnly),
-        GlobalPropertyInfo(static_cast<JSVMClientData*>(vm.clientData)->builtinNames().streamReadablePrivateName(), jsNumber(4), DontDelete | ReadOnly),
-        GlobalPropertyInfo(static_cast<JSVMClientData*>(vm.clientData)->builtinNames().streamWaitingPrivateName(), jsNumber(5), DontDelete | ReadOnly),
-        GlobalPropertyInfo(static_cast<JSVMClientData*>(vm.clientData)->builtinNames().streamWritablePrivateName(), jsNumber(6), DontDelete | ReadOnly),
-        GlobalPropertyInfo(static_cast<JSVMClientData*>(vm.clientData)->builtinNames().ReadableStreamControllerPrivateName(), createReadableStreamControllerPrivateConstructor(vm, *this), DontDelete | ReadOnly),
-        GlobalPropertyInfo(static_cast<JSVMClientData*>(vm.clientData)->builtinNames().ReadableStreamReaderPrivateName(), createReadableStreamReaderPrivateConstructor(vm, *this), DontDelete | ReadOnly),
+        GlobalPropertyInfo(clientData.builtinNames().streamClosedPrivateName(), jsNumber(1), DontDelete | ReadOnly),
+        GlobalPropertyInfo(clientData.builtinNames().streamClosingPrivateName(), jsNumber(2), DontDelete | ReadOnly),
+        GlobalPropertyInfo(clientData.builtinNames().streamErroredPrivateName(), jsNumber(3), DontDelete | ReadOnly),
+        GlobalPropertyInfo(clientData.builtinNames().streamReadablePrivateName(), jsNumber(4), DontDelete | ReadOnly),
+        GlobalPropertyInfo(clientData.builtinNames().streamWaitingPrivateName(), jsNumber(5), DontDelete | ReadOnly),
+        GlobalPropertyInfo(clientData.builtinNames().streamWritablePrivateName(), jsNumber(6), DontDelete | ReadOnly),
+        GlobalPropertyInfo(clientData.builtinNames().ReadableStreamControllerPrivateName(), createReadableStreamControllerPrivateConstructor(vm, *this), DontDelete | ReadOnly),
+        GlobalPropertyInfo(clientData.builtinNames().ReadableStreamReaderPrivateName(), createReadableStreamReaderPrivateConstructor(vm, *this), DontDelete | ReadOnly),
 #define DECLARE_GLOBAL_STATIC(name)\
         GlobalPropertyInfo(\
-            static_cast<JSVMClientData*>(vm.clientData)->builtinFunctions().readableStreamInternalsBuiltins().name##PrivateName(), \
-            m_privateFunctions.readableStreamInternals().m_##name##Function.get() , DontDelete | ReadOnly),
+            clientData.builtinFunctions().readableStreamInternalsBuiltins().name##PrivateName(), m_privateFunctions.readableStreamInternals().m_##name##Function.get() , DontDelete | ReadOnly),
         WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
 #undef DECLARE_GLOBAL_STATIC
 #define DECLARE_GLOBAL_STATIC(name)\
         GlobalPropertyInfo(\
-            static_cast<JSVMClientData*>(vm.clientData)->builtinFunctions().streamInternalsBuiltins().name##PrivateName(), \
-            m_privateFunctions.streamInternals().m_##name##Function.get() , DontDelete | ReadOnly),
+            clientData.builtinFunctions().streamInternalsBuiltins().name##PrivateName(), m_privateFunctions.streamInternals().m_##name##Function.get() , DontDelete | ReadOnly),
         WEBCORE_FOREACH_STREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
 #undef DECLARE_GLOBAL_STATIC
 #define DECLARE_GLOBAL_STATIC(name)\
         GlobalPropertyInfo(\
-            static_cast<JSVMClientData*>(vm.clientData)->builtinFunctions().writableStreamInternalsBuiltins().name##PrivateName(), \
-            m_privateFunctions.writableStreamInternals().m_##name##Function.get() , DontDelete | ReadOnly),
+            clientData.builtinFunctions().writableStreamInternalsBuiltins().name##PrivateName(), m_privateFunctions.writableStreamInternals().m_##name##Function.get() , DontDelete | ReadOnly),
         WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
 #undef DECLARE_GLOBAL_STATIC
 #endif
diff --git a/Source/WebCore/bindings/js/JSNavigatorCustom.cpp b/Source/WebCore/bindings/js/JSNavigatorCustom.cpp
deleted file mode 100644 (file)
index f24c055..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
- * Copyright (C) 2015 Canon INC.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(MEDIA_STREAM)
-#include "JSNavigator.h"
-
-#include "Dictionary.h"
-#include "Document.h"
-#include "ExceptionCode.h"
-#include "Frame.h"
-#include "JSNavigatorUserMediaErrorCallback.h"
-#include "JSNavigatorUserMediaSuccessCallback.h"
-#include "MediaStream.h"
-#include "UserMediaRequest.h"
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue JSNavigator::webkitGetUserMedia(ExecState& state)
-{
-    if (state.argumentCount() < 3) {
-        throwVMError(&state, createNotEnoughArgumentsError(&state));
-        return jsUndefined();
-    }
-
-    Dictionary options(&state, state.argument(0));
-    if (state.hadException())
-        return jsUndefined();
-
-    if (!options.isObject()) {
-        throwVMError(&state, createTypeError(&state, "First argument of webkitGetUserMedia must be a valid Dictionary"));
-        return jsUndefined();
-    }
-
-    if (!state.argument(1).isFunction()) {
-        throwVMTypeError(&state, "Argument 2 ('successCallback') to Navigator.webkitGetUserMedia must be a function");
-        return jsUndefined();
-    }
-
-    if (!state.argument(2).isFunction()) {
-        throwVMTypeError(&state, "Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function");
-        return jsUndefined();
-    }
-
-    if (!wrapped().frame()) {
-        setDOMException(&state, NOT_SUPPORTED_ERR);
-        return jsUndefined();
-    }
-
-    // We do not need to protect the context (i.e. document) here as UserMediaRequest is observing context destruction and will check validity before resolving/rejecting promise.
-    Document* document = wrapped().frame()->document();
-
-    RefPtr<NavigatorUserMediaSuccessCallback> successCallback = JSNavigatorUserMediaSuccessCallback::create(asObject(state.uncheckedArgument(1)), globalObject());
-    auto resolveCallback = [successCallback, document](const RefPtr<MediaStream>& stream) mutable {
-        RefPtr<MediaStream> protectedStream = stream;
-        document->postTask([successCallback, protectedStream](ScriptExecutionContext&) {
-            successCallback->handleEvent(protectedStream.get());
-        });
-    };
-
-    RefPtr<NavigatorUserMediaErrorCallback> errorCallback = JSNavigatorUserMediaErrorCallback::create(asObject(state.uncheckedArgument(2)), globalObject());
-    auto rejectCallback = [errorCallback, document](const RefPtr<NavigatorUserMediaError>& error) mutable {
-        RefPtr<NavigatorUserMediaError> protectedError = error;
-        document->postTask([errorCallback, protectedError](ScriptExecutionContext&) {
-            errorCallback->handleEvent(protectedError.get());
-        });
-    };
-
-    ExceptionCode ec = 0;
-    UserMediaRequest::start(document, options, MediaDevices::Promise(WTF::move(resolveCallback), WTF::move(rejectCallback)), ec);
-    setDOMException(&state, ec);
-    return jsUndefined();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM)
index adf10e87a7ebc3ca9cc7cf8bf8cdd2250a3adb7e..f82810e268d85777e60ab269d0d58adf33cb0444 100644 (file)
@@ -41,3 +41,6 @@
 #include "WritableStreamBuiltins.cpp"
 #include "WritableStreamInternalsBuiltins.cpp"
 #endif
+#if ENABLE(MEDIA_STREAM)
+#include "NavigatorUserMediaBuiltins.cpp"
+#endif
index aa79a132eafb1e9f216f385759b74789de596b60..84e67a93f8f41b4541db8e54ee19ea297a6405e0 100644 (file)
@@ -29,6 +29,7 @@
 
 #if ENABLE(MEDIA_STREAM)
 #include "MediaDevicesBuiltins.h"
+#include "NavigatorUserMediaBuiltins.h"
 #endif
 
 #if ENABLE(STREAMS_API)
@@ -64,6 +65,7 @@ public:
 #endif
 #if ENABLE(MEDIA_STREAM)
         , m_mediaDevicesBuiltins(&vm)
+        , m_navigatorUserMediaBuiltins(&vm)
 #endif
     {
 #if ENABLE(STREAMS_API)
@@ -85,6 +87,7 @@ public:
 #endif
 #if ENABLE(MEDIA_STREAM)
     MediaDevicesBuiltinsWrapper& mediaDevicesBuiltins() { return m_mediaDevicesBuiltins; }
+    NavigatorUserMediaBuiltinsWrapper& navigatorUserMediaBuiltins() { return m_navigatorUserMediaBuiltins;}
 #endif
 
 private:
@@ -102,6 +105,7 @@ private:
 #endif
 #if ENABLE(MEDIA_STREAM)
     MediaDevicesBuiltinsWrapper m_mediaDevicesBuiltins;
+    NavigatorUserMediaBuiltinsWrapper m_navigatorUserMediaBuiltins;
 #endif
 
 };