Diff
Modified: trunk/LayoutTests/ChangeLog (211926 => 211927)
--- trunk/LayoutTests/ChangeLog 2017-02-09 02:50:00 UTC (rev 211926)
+++ trunk/LayoutTests/ChangeLog 2017-02-09 04:49:25 UTC (rev 211927)
@@ -1,3 +1,18 @@
+2017-02-08 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r211912.
+ https://bugs.webkit.org/show_bug.cgi?id=168034
+
+ http/tests/media/media-stream/disconnected-frame-permission-
+ denied.html should be updated (Requested by youenn on
+ #webkit).
+
+ Reverted changeset:
+
+ "[MediaStream] Remove legacy Navigator.webkitGetUserMedia"
+ https://bugs.webkit.org/show_bug.cgi?id=168016
+ http://trac.webkit.org/changeset/211912
+
2017-02-08 Youenn Fablet <[email protected]>
HTML Link elements should load data URLs as same origin
Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream.html (211926 => 211927)
--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream.html 2017-02-09 02:50:00 UTC (rev 211926)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream.html 2017-02-09 04:49:25 UTC (rev 211927)
@@ -2,7 +2,6 @@
<html>
<head>
<script src=""
- <script src=""
</head>
<body>
<script>
@@ -21,9 +20,7 @@
function getUserMedia(dictionary, callback)
{
try {
- navigator.mediaDevices.getUserMedia(dictionary)
- .then(callback)
- .catch(error);
+ navigator.webkitGetUserMedia(dictionary, callback, error);
} catch (e) {
testFailed('webkitGetUserMedia threw exception :' + e);
finishJSTest();
Added: trunk/LayoutTests/fast/mediastream/argument-types.html (0 => 211927)
--- trunk/LayoutTests/fast/mediastream/argument-types.html (rev 0)
+++ trunk/LayoutTests/fast/mediastream/argument-types.html 2017-02-09 04:49:25 UTC (rev 211927)
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ <script src=""
+ </head>
+ <body>
+ <script src=""
+ <script src=""
+ </body>
+</html>
Modified: trunk/LayoutTests/fast/mediastream/delayed-permission-allowed.html (211926 => 211927)
--- trunk/LayoutTests/fast/mediastream/delayed-permission-allowed.html 2017-02-09 02:50:00 UTC (rev 211926)
+++ trunk/LayoutTests/fast/mediastream/delayed-permission-allowed.html 2017-02-09 04:49:25 UTC (rev 211927)
@@ -15,19 +15,17 @@
}
var options = {audio: true, video: true};
-navigator.mediaDevices.getUserMedia(options)
- .then(stream => {
- if (permissionSet) {
- testPassed('Success callback invoked');
- finishJSTest();
- return;
- }
- testFailed('Success callback invoked unexpectedly');
- })
- .catch(err => {
- testFailed('Error callback invoked unexpectedly');
+navigator.webkitGetUserMedia(options, function(stream) {
+ if (permissionSet) {
+ testPassed('Success callback invoked');
finishJSTest();
- });
+ return;
+ }
+ testFailed('Success callback invoked unexpectedly');
+}, function(e) {
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+});
window.setTimeout(allowPermission, 100);
</script>
Modified: trunk/LayoutTests/fast/mediastream/delayed-permission-denied.html (211926 => 211927)
--- trunk/LayoutTests/fast/mediastream/delayed-permission-denied.html 2017-02-09 02:50:00 UTC (rev 211926)
+++ trunk/LayoutTests/fast/mediastream/delayed-permission-denied.html 2017-02-09 04:49:25 UTC (rev 211927)
@@ -16,19 +16,19 @@
var error;
var options = {audio: true, video: true};
-navigator.mediaDevices.getUserMedia(options)
- .then(stream => {
- testFailed('Success callback invoked unexpectedly');
+navigator.webkitGetUserMedia(options, function(stream) {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+}, function(e) {
+ if (permissionSet) {
+ error = e;
+ shouldBeEqualToString('error.name', 'NotAllowedError');
finishJSTest();
- })
- .catch(err => {
- if (permissionSet) {
- error = err;
- shouldBeEqualToString('error.name', 'NotAllowedError');
- } else
- testFailed('Error callback invoked unexpectedly');
- finishJSTest();
- });
+ return;
+ }
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+});
window.setTimeout(denyPermission, 100);
</script>
Modified: trunk/LayoutTests/fast/mediastream/enabled-expected.txt (211926 => 211927)
--- trunk/LayoutTests/fast/mediastream/enabled-expected.txt 2017-02-09 02:50:00 UTC (rev 211926)
+++ trunk/LayoutTests/fast/mediastream/enabled-expected.txt 2017-02-09 04:49:25 UTC (rev 211927)
@@ -3,12 +3,10 @@
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS typeof navigator.mediaDevices == 'object' is true
-PASS typeof navigator.mediaDevices.getUserMedia == 'function' is true
+PASS typeof navigator.webkitGetUserMedia == 'function' is true
PASS hasGetUserMediaProperty() is true
-PASS 'mediaDevices' in navigator is true
-PASS 'getUserMedia' in navigator.mediaDevices is true
-PASS navigator.hasOwnProperty('mediaDevices') is false
+PASS 'webkitGetUserMedia' in navigator is true
+PASS navigator.hasOwnProperty('webkitGetUserMedia') is false
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/fast/mediastream/error.html (211926 => 211927)
--- trunk/LayoutTests/fast/mediastream/error.html 2017-02-09 02:50:00 UTC (rev 211926)
+++ trunk/LayoutTests/fast/mediastream/error.html 2017-02-09 04:49:25 UTC (rev 211927)
@@ -15,16 +15,14 @@
var error;
var options = {audio:false, video:true};
-navigator.mediaDevices.getUserMedia(options)
- .then(stream => {
- testFailed('Success callback invoked unexpectedly');
- finishJSTest();
- })
- .catch(err => {
- error = err;
- shouldBeEqualToString('error.name', 'NotAllowedError');
- finishJSTest();
- });
+navigator.webkitGetUserMedia(options, function(stream) {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+}, function(e) {
+ error = e;
+ shouldBeEqualToString('error.name', 'NotAllowedError');
+ finishJSTest();
+});
</script>
<script src=""
</body>
Added: trunk/LayoutTests/fast/mediastream/getusermedia.html (0 => 211927)
--- trunk/LayoutTests/fast/mediastream/getusermedia.html (rev 0)
+++ trunk/LayoutTests/fast/mediastream/getusermedia.html 2017-02-09 04:49:25 UTC (rev 211927)
@@ -0,0 +1,105 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ <script src=""
+ </head>
+ <body>
+ <p id="description"></p>
+ <div id="console"></div>
+ <script>
+ description("Tests webkitGetUserMedia.");
+
+ function setUserMediaPermission(isGranted) {
+ if (window.testRunner)
+ testRunner.setUserMediaPermission(isGranted);
+ else
+ debug("This test can not be run without the testRunner");
+ }
+
+ var stream;
+ var errorArg;
+
+ function error() {
+ testFailed('Error callback called.');
+ finishJSTest();
+ }
+
+ function expectedError() {
+ testPassed('Error callback called.');
+ }
+
+ function gotStreamInError(s) {
+ testFailed('Stream generated.');
+ finishJSTest();
+ }
+
+ function gotStream5(s) {
+ stream = s;
+ testPassed('Stream generated.');
+ shouldBe('stream.getAudioTracks().length', '1');
+ shouldBe('stream.getVideoTracks().length', '1');
+ finishJSTest();
+ }
+
+ function error1(e) {
+ errorArg = e;
+ testPassed('Error callback called.');
+ shouldBeEqualToString('errorArg.name', 'OverconstrainedError');
+ shouldBeEqualToString('errorArg.message', 'Invalid constraint');
+
+ shouldThrow("navigator.webkitGetUserMedia({audio:{volume:{exact:1}}, video:true}, gotStream5, 0);");
+ shouldNotThrow("navigator.webkitGetUserMedia({audio:{volume:{exact:1}}, video:true}, gotStream5, error);");
+ }
+
+ function gotStream4(s) {
+ stream = s;
+ testPassed('Stream generated.');
+ shouldBe('stream.getAudioTracks().length', '1');
+ shouldBe('stream.getVideoTracks().length', '1');
+
+ shouldThrow("navigator.webkitGetUserMedia({audio:true, video:{width:{exact:11}}}, gotStreamInError, null);");
+ shouldNotThrow("navigator.webkitGetUserMedia({audio:true, video:{width:{exact:11}}}, gotStreamInError, error1);");
+ }
+
+ function gotStream3(s) {
+ stream = s;
+ testPassed('Stream generated.');
+ shouldBe('stream.getAudioTracks().length', '1');
+ shouldBe('stream.getVideoTracks().length', '1');
+
+ shouldThrow("navigator.webkitGetUserMedia({audio:{}, video:true}, gotStream4, null);");
+ shouldNotThrow("navigator.webkitGetUserMedia({audio:{}, video:true}, gotStream4, error);");
+ }
+
+ function gotStream2(s) {
+ stream = s;
+ testPassed('Stream generated.');
+ shouldBe('stream.getAudioTracks().length', '0');
+ shouldBe('stream.getVideoTracks().length', '1');
+
+ shouldThrow("navigator.webkitGetUserMedia({audio:true, video:true}, gotStream3, null);");
+ shouldNotThrow("navigator.webkitGetUserMedia({audio:true, video:true}, gotStream3, error);");
+ }
+
+ function gotStream1(s) {
+ stream = s;
+ testPassed('Stream generated.');
+ shouldBe('stream.getAudioTracks().length', '1');
+ shouldBe('stream.getVideoTracks().length', '0');
+
+ shouldThrow("navigator.webkitGetUserMedia({video:true}, gotStream2, null);")
+ shouldNotThrow("navigator.webkitGetUserMedia({video:true}, gotStream2, error);")
+ }
+
+ shouldNotThrow("navigator.webkitGetUserMedia({audio:false, video:false}, error, expectedError);")
+ shouldThrow("navigator.webkitGetUserMedia({audio:false, video:false}, error, null);")
+
+ setUserMediaPermission(true);
+ shouldNotThrow("navigator.webkitGetUserMedia({audio:true}, gotStream1, error);");
+
+ window.jsTestIsAsync = true;
+ window.successfullyParsed = true;
+ </script>
+ <script src=""
+ </body>
+</html>
Added: trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js (0 => 211927)
--- trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js (rev 0)
+++ trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js 2017-02-09 04:49:25 UTC (rev 211927)
@@ -0,0 +1,70 @@
+description("Tests the acceptable types for arguments to navigator.getUserMedia methods.");
+
+function test(_expression_, expressionShouldThrow, expectedException) {
+ if (expressionShouldThrow) {
+ if (expectedException)
+ shouldThrow(_expression_, '"' + expectedException + '"');
+ else
+ shouldThrow(_expression_, '"TypeError: Not enough arguments"');
+ } else {
+ shouldNotThrow(_expression_);
+ }
+}
+
+var errorCallbackError = new TypeError("Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function")
+var invalidDictionaryError = new TypeError('First argument of webkitGetUserMedia must be a valid Dictionary')
+var notSupportedError = new Error('NotSupportedError: DOM Exception 9');
+var successCallbackError = new TypeError("Argument 2 ('successCallback') to Navigator.webkitGetUserMedia must be a function")
+var typeError = new TypeError('Type error');
+var typeNotAnObjectError = new TypeError('Not an object.');
+
+var emptyFunction = function() {};
+
+// No arguments
+test('navigator.webkitGetUserMedia()', true);
+
+// 1 Argument (Navigtor.webkitGetUserMedia requires at least 3 arguments).
+test('navigator.webkitGetUserMedia(undefined)', true);
+test('navigator.webkitGetUserMedia(null)', true);
+test('navigator.webkitGetUserMedia({ })', true);
+test('navigator.webkitGetUserMedia({video: true})', true);
+test('navigator.webkitGetUserMedia(true)', true);
+test('navigator.webkitGetUserMedia(42)', true);
+test('navigator.webkitGetUserMedia(Infinity)', true);
+test('navigator.webkitGetUserMedia(-Infinity)', true);
+test('navigator.webkitGetUserMedia(emptyFunction)', true);
+
+// 2 Arguments.
+test('navigator.webkitGetUserMedia({video: true}, emptyFunction)', true);
+test('navigator.webkitGetUserMedia(undefined, emptyFunction)', true);
+test('navigator.webkitGetUserMedia(null, emptyFunction)', true);
+test('navigator.webkitGetUserMedia({ }, emptyFunction)', true);
+test('navigator.webkitGetUserMedia(true, emptyFunction)', true);
+test('navigator.webkitGetUserMedia(42, emptyFunction)', true);
+test('navigator.webkitGetUserMedia(Infinity, emptyFunction)', true);
+test('navigator.webkitGetUserMedia(-Infinity, emptyFunction)', true);
+test('navigator.webkitGetUserMedia(emptyFunction, emptyFunction)', true);
+test('navigator.webkitGetUserMedia({video: true}, "foobar")', true);
+test('navigator.webkitGetUserMedia({video: true}, undefined)', true);
+test('navigator.webkitGetUserMedia({video: true}, null)', true);
+test('navigator.webkitGetUserMedia({video: true}, {})', true);
+test('navigator.webkitGetUserMedia({video: true}, true)', true);
+test('navigator.webkitGetUserMedia({video: true}, 42)', true);
+test('navigator.webkitGetUserMedia({video: true}, Infinity)', true);
+test('navigator.webkitGetUserMedia({video: true}, -Infinity)', true);
+
+// 3 Arguments.
+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);
+test('navigator.webkitGetUserMedia({audio:true}, emptyFunction, undefined)', true, errorCallbackError);
+test('navigator.webkitGetUserMedia({video: true}, emptyFunction, "video")', true, errorCallbackError);
+test('navigator.webkitGetUserMedia({video: true}, emptyFunction, null)', true, errorCallbackError );
+test('navigator.webkitGetUserMedia({video: true}, emptyFunction, {})', true, errorCallbackError);
+test('navigator.webkitGetUserMedia({video: true}, emptyFunction, true)', true, errorCallbackError);
+test('navigator.webkitGetUserMedia({video: true}, emptyFunction, 42)', true, errorCallbackError);
+test('navigator.webkitGetUserMedia({video: true}, emptyFunction, Infinity)', true, errorCallbackError);
+test('navigator.webkitGetUserMedia({video: true}, emptyFunction, -Infinity)', true, errorCallbackError);
+
+window.jsTestIsAsync = false;
Modified: trunk/LayoutTests/fast/mediastream/script-tests/enabled.js (211926 => 211927)
--- trunk/LayoutTests/fast/mediastream/script-tests/enabled.js 2017-02-09 02:50:00 UTC (rev 211926)
+++ trunk/LayoutTests/fast/mediastream/script-tests/enabled.js 2017-02-09 04:49:25 UTC (rev 211927)
@@ -3,22 +3,15 @@
function hasGetUserMediaProperty()
{
for (var property in navigator) {
- if (property == "mediaDevices") {
- var devices = navigator[property];
- for (property in devices) {
- if (property == "getUserMedia")
- return true;
- }
- }
+ if (property == "webkitGetUserMedia")
+ return true;
}
return false;
}
-shouldBeTrue("typeof navigator.mediaDevices == 'object'");
-shouldBeTrue("typeof navigator.mediaDevices.getUserMedia == 'function'");
+shouldBeTrue("typeof navigator.webkitGetUserMedia == 'function'");
shouldBeTrue("hasGetUserMediaProperty()");
-shouldBeTrue("'mediaDevices' in navigator");
-shouldBeTrue("'getUserMedia' in navigator.mediaDevices");
-shouldBeFalse("navigator.hasOwnProperty('mediaDevices')");
+shouldBeTrue("'webkitGetUserMedia' in navigator");
+shouldBeFalse("navigator.hasOwnProperty('webkitGetUserMedia')");
window.jsTestIsAsync = false;
Modified: trunk/LayoutTests/fast/mediastream/success.html (211926 => 211927)
--- trunk/LayoutTests/fast/mediastream/success.html 2017-02-09 02:50:00 UTC (rev 211926)
+++ trunk/LayoutTests/fast/mediastream/success.html 2017-02-09 04:49:25 UTC (rev 211927)
@@ -14,14 +14,12 @@
debug('This test can not be run without the testRunner');
var options = {audio: true, video: true};
-navigator.mediaDevices.getUserMedia(options)
- .then(stream => {
- finishJSTest();
- })
- .catch(err => {
- testFailed('Error callback invoked unexpectedly');
- finishJSTest();
- });
+navigator.webkitGetUserMedia(options, function(stream) {
+ finishJSTest();
+}, function(e) {
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+});
</script>
<script src=""
</body>
Added: trunk/LayoutTests/fast/mediastream/webkitGetUserMedia-shadowing-then.html (0 => 211927)
--- trunk/LayoutTests/fast/mediastream/webkitGetUserMedia-shadowing-then.html (rev 0)
+++ trunk/LayoutTests/fast/mediastream/webkitGetUserMedia-shadowing-then.html 2017-02-09 04:49:25 UTC (rev 211927)
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>Shadowing then()</title>
+</head>
+<body>
+<!--
+This test verifies that the implementation of navigator.webkitGetUserMedia does not use public promise APIs.
+-->
+<p id="output"></p>
+<script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ function endTest(testStatus) {
+ document.getElementById("output").textContent = testStatus;
+ testRunner.notifyDone();
+ }
+
+ // Shadow Promise.prototype.then
+ Promise.prototype.then = (function () {
+ const realThen = Promise.prototype.then;
+ return function () {
+ endTest("FAIL: Executed shadowed, public .then()");
+ }
+ })();
+
+ function gotUserMedia(mediaStream) {
+ endTest("FAIL: Got user media");
+ }
+
+ function userMediaError(error) {
+ endTest("PASS");
+ }
+
+ var options = { audio: false, video: false };
+ navigator.webkitGetUserMedia(options, gotUserMedia, userMediaError);
+
+</script>
+</body>
+</html>
Modified: trunk/Source/WebCore/CMakeLists.txt (211926 => 211927)
--- trunk/Source/WebCore/CMakeLists.txt 2017-02-09 02:50:00 UTC (rev 211926)
+++ trunk/Source/WebCore/CMakeLists.txt 2017-02-09 04:49:25 UTC (rev 211927)
@@ -222,6 +222,7 @@
Modules/mediastream/MediaTrackConstraints.idl
Modules/mediastream/MediaTrackSupportedConstraints.idl
Modules/mediastream/NavigatorMediaDevices.idl
+ Modules/mediastream/NavigatorUserMedia.idl
Modules/mediastream/OverconstrainedError.idl
Modules/mediastream/OverconstrainedErrorEvent.idl
Modules/mediastream/RTCConfiguration.idl
@@ -3671,6 +3672,7 @@
${WEBCORE_DIR}/Modules/fetch/FetchRequest.js
${WEBCORE_DIR}/Modules/fetch/FetchResponse.js
${WEBCORE_DIR}/Modules/fetch/WorkerGlobalScopeFetch.js
+ ${WEBCORE_DIR}/Modules/mediastream/NavigatorUserMedia.js
${WEBCORE_DIR}/Modules/mediastream/RTCPeerConnection.js
${WEBCORE_DIR}/Modules/mediastream/RTCPeerConnectionInternals.js
${WEBCORE_DIR}/Modules/streams/ByteLengthQueuingStrategy.js
Modified: trunk/Source/WebCore/ChangeLog (211926 => 211927)
--- trunk/Source/WebCore/ChangeLog 2017-02-09 02:50:00 UTC (rev 211926)
+++ trunk/Source/WebCore/ChangeLog 2017-02-09 04:49:25 UTC (rev 211927)
@@ -1,3 +1,18 @@
+2017-02-08 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r211912.
+ https://bugs.webkit.org/show_bug.cgi?id=168034
+
+ http/tests/media/media-stream/disconnected-frame-permission-
+ denied.html should be updated (Requested by youenn on
+ #webkit).
+
+ Reverted changeset:
+
+ "[MediaStream] Remove legacy Navigator.webkitGetUserMedia"
+ https://bugs.webkit.org/show_bug.cgi?id=168016
+ http://trac.webkit.org/changeset/211912
+
2017-02-08 Youenn Fablet <[email protected]>
HTML Link elements should load data URLs as same origin
Modified: trunk/Source/WebCore/DerivedSources.cpp (211926 => 211927)
--- trunk/Source/WebCore/DerivedSources.cpp 2017-02-09 02:50:00 UTC (rev 211926)
+++ trunk/Source/WebCore/DerivedSources.cpp 2017-02-09 04:49:25 UTC (rev 211927)
@@ -350,6 +350,7 @@
#include "JSNavigatorContentUtils.cpp"
#include "JSNavigatorGeolocation.cpp"
#include "JSNavigatorMediaDevices.cpp"
+#include "JSNavigatorUserMedia.cpp"
#include "JSNavigatorVibration.cpp"
#include "JSNode.cpp"
#include "JSNodeFilter.cpp"
Modified: trunk/Source/WebCore/DerivedSources.make (211926 => 211927)
--- trunk/Source/WebCore/DerivedSources.make 2017-02-09 02:50:00 UTC (rev 211926)
+++ trunk/Source/WebCore/DerivedSources.make 2017-02-09 04:49:25 UTC (rev 211927)
@@ -163,6 +163,7 @@
$(WebCore)/Modules/mediastream/MediaTrackConstraints.idl \
$(WebCore)/Modules/mediastream/MediaTrackSupportedConstraints.idl \
$(WebCore)/Modules/mediastream/NavigatorMediaDevices.idl \
+ $(WebCore)/Modules/mediastream/NavigatorUserMedia.idl \
$(WebCore)/Modules/mediastream/OverconstrainedError.idl \
$(WebCore)/Modules/mediastream/OverconstrainedErrorEvent.idl \
$(WebCore)/Modules/mediastream/RTCConfiguration.idl \
@@ -1343,6 +1344,7 @@
$(WebCore)/Modules/fetch/FetchRequest.js \
$(WebCore)/Modules/fetch/FetchResponse.js \
${WebCore}/Modules/fetch/WorkerGlobalScopeFetch.js \
+ $(WebCore)/Modules/mediastream/NavigatorUserMedia.js \
$(WebCore)/Modules/mediastream/RTCPeerConnection.js \
$(WebCore)/Modules/mediastream/RTCPeerConnectionInternals.js \
$(WebCore)/Modules/streams/ByteLengthQueuingStrategy.js \
Added: trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.idl (0 => 211927)
--- trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.idl (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.idl 2017-02-09 04:49:25 UTC (rev 211927)
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+[
+ Conditional=MEDIA_STREAM,
+ EnabledAtRuntime=MediaStream,
+] partial interface Navigator {
+ [JSBuiltin] void webkitGetUserMedia(MediaStreamConstraints constraints, NavigatorUserMediaSuccessCallback successCallback, NavigatorUserMediaErrorCallback errorCallback);
+};
Added: trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.js (0 => 211927)
--- trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.js (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.js 2017-02-09 04:49:25 UTC (rev 211927)
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+// @conditional=ENABLE(MEDIA_STREAM)
+
+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.@getUserMedia))
+ throw @makeThisTypeError("Navigator", "webkitGetUserMedia");
+
+ if (arguments.length < 3)
+ @throwTypeError("Not enough arguments");
+
+ if (options !== @Object(options))
+ @throwTypeError("Argument 1 (options) to Navigator.webkitGetUserMedia must be an object");
+
+ if (typeof successCallback !== "function")
+ @throwTypeError("Argument 2 ('successCallback') to Navigator.webkitGetUserMedia must be a function");
+ if (typeof errorCallback !== "function")
+ @throwTypeError("Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function");
+
+ this.mediaDevices.@getUserMedia(options).@then(successCallback, errorCallback);
+}
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (211926 => 211927)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-02-09 02:50:00 UTC (rev 211926)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-02-09 04:49:25 UTC (rev 211927)
@@ -146,6 +146,8 @@
073B87671E4385AC0071C0EC /* AudioSampleBufferList.h in Headers */ = {isa = PBXBuildFile; fileRef = 073B87631E43859D0071C0EC /* AudioSampleBufferList.h */; };
073B87681E4385AC0071C0EC /* AudioSampleDataSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073B87641E43859D0071C0EC /* AudioSampleDataSource.cpp */; };
073B87691E4385AC0071C0EC /* AudioSampleDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 073B87651E43859D0071C0EC /* AudioSampleDataSource.h */; };
+ 073BE34017D17E01002BD431 /* JSNavigatorUserMedia.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073BE33E17D17E01002BD431 /* JSNavigatorUserMedia.cpp */; };
+ 073BE34117D17E01002BD431 /* JSNavigatorUserMedia.h in Headers */ = {isa = PBXBuildFile; fileRef = 073BE33F17D17E01002BD431 /* JSNavigatorUserMedia.h */; settings = {ATTRIBUTES = (Private, ); }; };
073BE34E17D180B2002BD431 /* RTCSessionDescriptionDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221BAB17CF0AD400848E51 /* RTCSessionDescriptionDescriptor.cpp */; };
073BE34F17D18183002BD431 /* RTCIceCandidateDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221BA617CF0AD400848E51 /* RTCIceCandidateDescriptor.cpp */; };
0744ECED1E0C4E30000D0944 /* MockRealtimeAudioSourceMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0744ECEC1E0C4AE5000D0944 /* MockRealtimeAudioSourceMac.mm */; };
@@ -7183,6 +7185,7 @@
07221B5717CEC32700848E51 /* MediaStreamTrackEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamTrackEvent.cpp; sourceTree = "<group>"; };
07221B5817CEC32700848E51 /* MediaStreamTrackEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamTrackEvent.h; sourceTree = "<group>"; };
07221B5917CEC32700848E51 /* MediaStreamTrackEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaStreamTrackEvent.idl; sourceTree = "<group>"; };
+ 07221B5C17CEC32700848E51 /* NavigatorUserMedia.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorUserMedia.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>"; };
@@ -7275,6 +7278,8 @@
073B87631E43859D0071C0EC /* AudioSampleBufferList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioSampleBufferList.h; sourceTree = "<group>"; };
073B87641E43859D0071C0EC /* AudioSampleDataSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioSampleDataSource.cpp; sourceTree = "<group>"; };
073B87651E43859D0071C0EC /* AudioSampleDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioSampleDataSource.h; sourceTree = "<group>"; };
+ 073BE33E17D17E01002BD431 /* JSNavigatorUserMedia.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNavigatorUserMedia.cpp; sourceTree = "<group>"; };
+ 073BE33F17D17E01002BD431 /* JSNavigatorUserMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNavigatorUserMedia.h; sourceTree = "<group>"; };
0744ECEB1E0C4AE5000D0944 /* MockRealtimeAudioSourceMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockRealtimeAudioSourceMac.h; sourceTree = "<group>"; };
0744ECEC1E0C4AE5000D0944 /* MockRealtimeAudioSourceMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MockRealtimeAudioSourceMac.mm; sourceTree = "<group>"; };
074E82B818A69F0E007EF54C /* PlatformTimeRanges.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformTimeRanges.cpp; sourceTree = "<group>"; };
@@ -8857,6 +8862,7 @@
419BC2DC1685329900D64D6D /* VisitedLinkState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisitedLinkState.cpp; sourceTree = "<group>"; };
419BC2DD1685329900D64D6D /* VisitedLinkState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitedLinkState.h; sourceTree = "<group>"; };
419BE7521BC7F3DB00E1C85B /* WebCoreBuiltinNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreBuiltinNames.h; sourceTree = "<group>"; };
+ 419BE75A1BCBD3ED00E1C85B /* NavigatorUserMedia.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = NavigatorUserMedia.js; sourceTree = "<group>"; };
419FAFAD1ABABCD5005B828B /* ReadableStreamDefaultReader.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStreamDefaultReader.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>"; };
@@ -15343,6 +15349,8 @@
5EA725CA1ACABCB500EAD17B /* NavigatorMediaDevices.cpp */,
5EA725CB1ACABCB500EAD17B /* NavigatorMediaDevices.h */,
5EA725CC1ACABCB500EAD17B /* NavigatorMediaDevices.idl */,
+ 07221B5C17CEC32700848E51 /* NavigatorUserMedia.idl */,
+ 419BE75A1BCBD3ED00E1C85B /* NavigatorUserMedia.js */,
0704A4051D6DE9F10086DCDB /* OverconstrainedError.h */,
0704A4031D6DE9F10086DCDB /* OverconstrainedError.idl */,
072A703E1D6E8F6200DF0AFC /* OverconstrainedErrorEvent.h */,
@@ -15570,6 +15578,8 @@
932CC0D11DFFD667004C0F9F /* JSMediaTrackConstraints.h */,
0787C4671BFBDF6F006DCD7F /* JSMediaTrackSupportedConstraints.cpp */,
0787C4681BFBDF6F006DCD7F /* JSMediaTrackSupportedConstraints.h */,
+ 073BE33E17D17E01002BD431 /* JSNavigatorUserMedia.cpp */,
+ 073BE33F17D17E01002BD431 /* JSNavigatorUserMedia.h */,
0704A4091D6DFC690086DCDB /* JSOverconstrainedError.cpp */,
0704A40A1D6DFC690086DCDB /* JSOverconstrainedError.h */,
0704A4131D6F39FB0086DCDB /* JSOverconstrainedErrorEvent.cpp */,
@@ -26796,6 +26806,7 @@
C6F08FCA1431000D00685849 /* JSMutationRecord.h in Headers */,
BCD9C2C10C17B69E005C90A2 /* JSNamedNodeMap.h in Headers */,
A9D247F80D757E3400FDF959 /* JSNavigator.h in Headers */,
+ 073BE34117D17E01002BD431 /* JSNavigatorUserMedia.h in Headers */,
BC9439C3116CF4940048C750 /* JSNodeCustom.h in Headers */,
14115B7309F84CD600CA4FC1 /* JSNodeFilter.h in Headers */,
1A750D8E0A90E521000FF215 /* JSNodeIterator.h in Headers */,
@@ -30637,6 +30648,7 @@
C6F08FC91431000D00685849 /* JSMutationRecord.cpp in Sources */,
BCD9C2C00C17B69E005C90A2 /* JSNamedNodeMap.cpp in Sources */,
A9D247F70D757E3400FDF959 /* JSNavigator.cpp in Sources */,
+ 073BE34017D17E01002BD431 /* JSNavigatorUserMedia.cpp in Sources */,
14DC0D3709FED073007B0235 /* JSNode.cpp in Sources */,
BCD9C2640C17AA67005C90A2 /* JSNodeCustom.cpp in Sources */,
E3150EA61DA7219000194012 /* JSNodeDOMJIT.cpp in Sources */,
Modified: trunk/Source/WebCore/page/Navigator.idl (211926 => 211927)
--- trunk/Source/WebCore/page/Navigator.idl 2017-02-09 02:50:00 UTC (rev 211926)
+++ trunk/Source/WebCore/page/Navigator.idl 2017-02-09 04:49:25 UTC (rev 211927)
@@ -24,7 +24,7 @@
readonly attribute DOMMimeTypeArray mimeTypes;
readonly attribute boolean cookieEnabled;
boolean javaEnabled();
-
+
// FIXME: Convert this #if'def to an IDL conditional attribute.
#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS
readonly attribute boolean standalone;
Modified: trunk/Source/WebInspectorUI/ChangeLog (211926 => 211927)
--- trunk/Source/WebInspectorUI/ChangeLog 2017-02-09 02:50:00 UTC (rev 211926)
+++ trunk/Source/WebInspectorUI/ChangeLog 2017-02-09 04:49:25 UTC (rev 211927)
@@ -1,3 +1,18 @@
+2017-02-08 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r211912.
+ https://bugs.webkit.org/show_bug.cgi?id=168034
+
+ http/tests/media/media-stream/disconnected-frame-permission-
+ denied.html should be updated (Requested by youenn on
+ #webkit).
+
+ Reverted changeset:
+
+ "[MediaStream] Remove legacy Navigator.webkitGetUserMedia"
+ https://bugs.webkit.org/show_bug.cgi?id=168016
+ http://trac.webkit.org/changeset/211912
+
2017-02-08 Eric Carlson <[email protected]>
[MediaStream] Remove legacy Navigator.webkitGetUserMedia
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js (211926 => 211927)
--- trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js 2017-02-09 02:50:00 UTC (rev 211926)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js 2017-02-09 04:49:25 UTC (rev 211927)
@@ -1161,6 +1161,21 @@
__proto__: null,
},
+ Navigator: {
+ webkitGetUserMedia: "options, successCallback, errorCallback",
+ __proto__: null,
+ },
+
+ NavigatorUserMediaErrorCallback: {
+ handleEvent: "error",
+ __proto__: null,
+ },
+
+ NavigatorUserMediaSuccessCallback: {
+ handleEvent: "stream",
+ __proto__: null,
+ },
+
NodeFilter: {
acceptNode: "[n]",
__proto__: null,