<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[212323] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/212323">212323</a></dd>
<dt>Author</dt> <dd>eric.carlson@apple.com</dd>
<dt>Date</dt> <dd>2017-02-14 14:34:48 -0800 (Tue, 14 Feb 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>[MediaStream] add navigator.getUserMedia for compatibility with legacy content
https://bugs.webkit.org/show_bug.cgi?id=168324
<rdar://problem/30513125>
Reviewed by Youenn Fablet.
Source/WebCore:
Tests: fast/mediastream/argument-types.html
fast/mediastream/getusermedia.html
fast/mediastream/webkitGetUserMedia-shadowing-then.html
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/mediastream/MediaDevices.idl:
* Modules/mediastream/NavigatorUserMedia.idl: Added.
* Modules/mediastream/NavigatorUserMedia.js: Added.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* page/Navigator.idl:
Source/WebInspectorUI:
* UserInterface/Models/NativeFunctionParameters.js:
LayoutTests:
* fast/mediastream/argument-types-expected.txt:
* fast/mediastream/argument-types.html: Added.
* fast/mediastream/getusermedia-expected.txt:
* fast/mediastream/getusermedia.html: Added.
* fast/mediastream/script-tests/argument-types.js: Added.
* fast/mediastream/webkitGetUserMedia-shadowing-then.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomnavigatordetachednocrashhtml">trunk/LayoutTests/fast/dom/navigator-detached-no-crash.html</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamargumenttypesexpectedtxt">trunk/LayoutTests/fast/mediastream/argument-types-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamgetusermediaexpectedtxt">trunk/LayoutTests/fast/mediastream/getusermedia-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcescpp">trunk/Source/WebCore/DerivedSources.cpp</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaDevicesidl">trunk/Source/WebCore/Modules/mediastream/MediaDevices.idl</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsWebCoreBuiltinNamesh">trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h</a></li>
<li><a href="#trunkSourceWebCorepageNavigatoridl">trunk/Source/WebCore/page/Navigator.idl</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsNativeFunctionParametersjs">trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastmediastreamargumenttypeshtml">trunk/LayoutTests/fast/mediastream/argument-types.html</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamgetusermediahtml">trunk/LayoutTests/fast/mediastream/getusermedia.html</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamscripttestsargumenttypesjs">trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamwebkitGetUserMediashadowingthenhtml">trunk/LayoutTests/fast/mediastream/webkitGetUserMedia-shadowing-then.html</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamNavigatorUserMediaidl">trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamNavigatorUserMediajs">trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (212322 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/LayoutTests/ChangeLog        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2017-02-14 Eric Carlson <eric.carlson@apple.com>
+
+ [MediaStream] add navigator.getUserMedia for compatibility with legacy content
+ https://bugs.webkit.org/show_bug.cgi?id=168324
+ <rdar://problem/30513125>
+
+ Reviewed by Youenn Fablet.
+
+ * fast/mediastream/argument-types-expected.txt:
+ * fast/mediastream/argument-types.html: Added.
+ * fast/mediastream/getusermedia-expected.txt:
+ * fast/mediastream/getusermedia.html: Added.
+ * fast/mediastream/script-tests/argument-types.js: Added.
+ * fast/mediastream/webkitGetUserMedia-shadowing-then.html: Added.
+
</ins><span class="cx"> 2017-02-13 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> Rename preferLowPowerToHighPerformance to powerPreference
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomnavigatordetachednocrashhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/navigator-detached-no-crash.html (212322 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/navigator-detached-no-crash.html        2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/LayoutTests/fast/dom/navigator-detached-no-crash.html        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> var strings = [ ];
</span><span class="cx"> for (p in old_nav) {
</span><span class="cx"> // Don't include some features until most platforms have support.
</span><del>- if (p == 'geolocation' || p == 'webkitGetUserMedia' || p == 'mediaDevices' || p == "getGamepads")
</del><ins>+ if (p == 'geolocation' || p == 'getUserMedia' || p == 'mediaDevices' || p == "getGamepads")
</ins><span class="cx"> continue;
</span><span class="cx">
</span><span class="cx"> if (typeof old_nav[p] == 'function') {
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamargumenttypesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/mediastream/argument-types-expected.txt (212322 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/argument-types-expected.txt        2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/LayoutTests/fast/mediastream/argument-types-expected.txt        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -3,45 +3,45 @@
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><span class="cx">
</span><del>-PASS navigator.webkitGetUserMedia() threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(undefined) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(null) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({ }) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({video: true}) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(true) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(42) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(Infinity) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(-Infinity) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(undefined, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(null, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({ }, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(true, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(42, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(Infinity, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(-Infinity, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia(emptyFunction, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({video: true}, "foobar") threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({video: true}, undefined) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({video: true}, null) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({video: true}, {}) threw exception TypeError: Not enough arguments.
-PASS navigator.webkitGetUserMedia({video: true}, true) threw exception TypeError: Not enough arguments.
-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) 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.
-PASS navigator.webkitGetUserMedia({audio:true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, "video") threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, null) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, {}) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, true) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, 42) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, Infinity) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, -Infinity) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
</del><ins>+PASS navigator.getUserMedia() threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(undefined) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(null) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({ }) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(true) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(42) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(Infinity) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(-Infinity) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(undefined, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(null, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({ }, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(true, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(42, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(Infinity, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(-Infinity, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia(emptyFunction, emptyFunction) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, "foobar") threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, undefined) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, null) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, {}) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, true) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, 42) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, Infinity) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({video: true}, -Infinity) threw exception TypeError: Not enough arguments.
+PASS navigator.getUserMedia({ }, emptyFunction, emptyFunction) did not throw exception.
+PASS navigator.getUserMedia({video: true}, emptyFunction, emptyFunction) did not throw exception.
+PASS navigator.getUserMedia({video: true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({audio:true, video:true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({audio:true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({video: true}, emptyFunction, "video") threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({video: true}, emptyFunction, null) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({video: true}, emptyFunction, {}) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({video: true}, emptyFunction, true) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({video: true}, emptyFunction, 42) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({video: true}, emptyFunction, Infinity) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({video: true}, emptyFunction, -Infinity) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamargumenttypeshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/mediastream/argument-types.html (0 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/argument-types.html         (rev 0)
+++ trunk/LayoutTests/fast/mediastream/argument-types.html        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ <script src="../../resources/js-test-pre.js"></script>
+ </head>
+ <body>
+ <script src="script-tests/argument-types.js"></script>
+ <script src="../../resources/js-test-post.js"></script>
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamgetusermediaexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/mediastream/getusermedia-expected.txt (212322 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/getusermedia-expected.txt        2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/LayoutTests/fast/mediastream/getusermedia-expected.txt        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -1,37 +1,37 @@
</span><del>-Tests webkitGetUserMedia.
</del><ins>+Tests getUserMedia.
</ins><span class="cx">
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><span class="cx">
</span><del>-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.
</del><ins>+PASS navigator.getUserMedia({audio:false, video:false}, error, expectedError); did not throw exception.
+PASS navigator.getUserMedia({audio:false, video:false}, error, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({audio:true}, gotStream1, error); did not throw exception.
</ins><span class="cx"> PASS Error callback called.
</span><span class="cx"> PASS Stream generated.
</span><span class="cx"> PASS stream.getAudioTracks().length is 1
</span><span class="cx"> PASS stream.getVideoTracks().length is 0
</span><del>-PASS navigator.webkitGetUserMedia({video:true}, gotStream2, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({video:true}, gotStream2, error); did not throw exception.
</del><ins>+PASS navigator.getUserMedia({video:true}, gotStream2, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({video:true}, gotStream2, error); did not throw exception.
</ins><span class="cx"> PASS Stream generated.
</span><span class="cx"> PASS stream.getAudioTracks().length is 0
</span><span class="cx"> PASS stream.getVideoTracks().length is 1
</span><del>-PASS navigator.webkitGetUserMedia({audio:true, video:true}, gotStream3, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({audio:true, video:true}, gotStream3, error); did not throw exception.
</del><ins>+PASS navigator.getUserMedia({audio:true, video:true}, gotStream3, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({audio:true, video:true}, gotStream3, error); did not throw exception.
</ins><span class="cx"> PASS Stream generated.
</span><span class="cx"> PASS stream.getAudioTracks().length is 1
</span><span class="cx"> PASS stream.getVideoTracks().length is 1
</span><del>-PASS navigator.webkitGetUserMedia({audio:{}, video:true}, gotStream4, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({audio:{}, video:true}, gotStream4, error); did not throw exception.
</del><ins>+PASS navigator.getUserMedia({audio:{}, video:true}, gotStream4, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({audio:{}, video:true}, gotStream4, error); did not throw exception.
</ins><span class="cx"> PASS Stream generated.
</span><span class="cx"> PASS stream.getAudioTracks().length is 1
</span><span class="cx"> PASS stream.getVideoTracks().length is 1
</span><del>-PASS navigator.webkitGetUserMedia({audio:true, video:{width:{exact:11}}}, gotStreamInError, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({audio:true, video:{width:{exact:11}}}, gotStreamInError, error1); did not throw exception.
</del><ins>+PASS navigator.getUserMedia({audio:true, video:{width:{exact:11}}}, gotStreamInError, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({audio:true, video:{width:{exact:11}}}, gotStreamInError, error1); did not throw exception.
</ins><span class="cx"> PASS Error callback called.
</span><span class="cx"> FAIL errorArg.name should be OverconstrainedError. Was Error.
</span><span class="cx"> PASS errorArg.message is "Invalid constraint"
</span><del>-PASS navigator.webkitGetUserMedia({audio:{volume:{exact:1}}, video:true}, gotStream5, 0); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.webkitGetUserMedia must be a function.
-PASS navigator.webkitGetUserMedia({audio:{volume:{exact:1}}, video:true}, gotStream5, error); did not throw exception.
</del><ins>+PASS navigator.getUserMedia({audio:{volume:{exact:1}}, video:true}, gotStream5, 0); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
+PASS navigator.getUserMedia({audio:{volume:{exact:1}}, video:true}, gotStream5, error); did not throw exception.
</ins><span class="cx"> PASS Stream generated.
</span><span class="cx"> PASS stream.getAudioTracks().length is 1
</span><span class="cx"> PASS stream.getVideoTracks().length is 1
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamgetusermediahtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/mediastream/getusermedia.html (0 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/getusermedia.html         (rev 0)
+++ trunk/LayoutTests/fast/mediastream/getusermedia.html        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -0,0 +1,105 @@
</span><ins>+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ <script src="../../resources/js-test-pre.js"></script>
+ </head>
+ <body>
+ <p id="description"></p>
+ <div id="console"></div>
+ <script>
+ description("Tests getUserMedia.");
+
+ 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.getUserMedia({audio:{volume:{exact:1}}, video:true}, gotStream5, 0);");
+ shouldNotThrow("navigator.getUserMedia({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.getUserMedia({audio:true, video:{width:{exact:11}}}, gotStreamInError, null);");
+ shouldNotThrow("navigator.getUserMedia({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.getUserMedia({audio:{}, video:true}, gotStream4, null);");
+ shouldNotThrow("navigator.getUserMedia({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.getUserMedia({audio:true, video:true}, gotStream3, null);");
+ shouldNotThrow("navigator.getUserMedia({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.getUserMedia({video:true}, gotStream2, null);")
+ shouldNotThrow("navigator.getUserMedia({video:true}, gotStream2, error);")
+ }
+
+ shouldNotThrow("navigator.getUserMedia({audio:false, video:false}, error, expectedError);")
+ shouldThrow("navigator.getUserMedia({audio:false, video:false}, error, null);")
+
+ setUserMediaPermission(true);
+ shouldNotThrow("navigator.getUserMedia({audio:true}, gotStream1, error);");
+
+ window.jsTestIsAsync = true;
+ window.successfullyParsed = true;
+ </script>
+ <script src="../../resources/js-test-post.js"></script>
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamscripttestsargumenttypesjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js (0 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js         (rev 0)
+++ trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -0,0 +1,70 @@
</span><ins>+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.getUserMedia must be a function")
+var invalidDictionaryError = new TypeError('First argument of getUserMedia must be a valid Dictionary')
+var notSupportedError = new Error('NotSupportedError: DOM Exception 9');
+var successCallbackError = new TypeError("Argument 2 ('successCallback') to Navigator.getUserMedia must be a function")
+var typeError = new TypeError('Type error');
+var typeNotAnObjectError = new TypeError('Not an object.');
+
+var emptyFunction = function() {};
+
+// No arguments
+test('navigator.getUserMedia()', true);
+
+// 1 Argument (Navigtor.getUserMedia requires at least 3 arguments).
+test('navigator.getUserMedia(undefined)', true);
+test('navigator.getUserMedia(null)', true);
+test('navigator.getUserMedia({ })', true);
+test('navigator.getUserMedia({video: true})', true);
+test('navigator.getUserMedia(true)', true);
+test('navigator.getUserMedia(42)', true);
+test('navigator.getUserMedia(Infinity)', true);
+test('navigator.getUserMedia(-Infinity)', true);
+test('navigator.getUserMedia(emptyFunction)', true);
+
+// 2 Arguments.
+test('navigator.getUserMedia({video: true}, emptyFunction)', true);
+test('navigator.getUserMedia(undefined, emptyFunction)', true);
+test('navigator.getUserMedia(null, emptyFunction)', true);
+test('navigator.getUserMedia({ }, emptyFunction)', true);
+test('navigator.getUserMedia(true, emptyFunction)', true);
+test('navigator.getUserMedia(42, emptyFunction)', true);
+test('navigator.getUserMedia(Infinity, emptyFunction)', true);
+test('navigator.getUserMedia(-Infinity, emptyFunction)', true);
+test('navigator.getUserMedia(emptyFunction, emptyFunction)', true);
+test('navigator.getUserMedia({video: true}, "foobar")', true);
+test('navigator.getUserMedia({video: true}, undefined)', true);
+test('navigator.getUserMedia({video: true}, null)', true);
+test('navigator.getUserMedia({video: true}, {})', true);
+test('navigator.getUserMedia({video: true}, true)', true);
+test('navigator.getUserMedia({video: true}, 42)', true);
+test('navigator.getUserMedia({video: true}, Infinity)', true);
+test('navigator.getUserMedia({video: true}, -Infinity)', true);
+
+// 3 Arguments.
+test('navigator.getUserMedia({ }, emptyFunction, emptyFunction)', false);
+test('navigator.getUserMedia({video: true}, emptyFunction, emptyFunction)', false);
+test('navigator.getUserMedia({video: true}, emptyFunction, undefined)', true, errorCallbackError);
+test('navigator.getUserMedia({audio:true, video:true}, emptyFunction, undefined)', true, errorCallbackError);
+test('navigator.getUserMedia({audio:true}, emptyFunction, undefined)', true, errorCallbackError);
+test('navigator.getUserMedia({video: true}, emptyFunction, "video")', true, errorCallbackError);
+test('navigator.getUserMedia({video: true}, emptyFunction, null)', true, errorCallbackError );
+test('navigator.getUserMedia({video: true}, emptyFunction, {})', true, errorCallbackError);
+test('navigator.getUserMedia({video: true}, emptyFunction, true)', true, errorCallbackError);
+test('navigator.getUserMedia({video: true}, emptyFunction, 42)', true, errorCallbackError);
+test('navigator.getUserMedia({video: true}, emptyFunction, Infinity)', true, errorCallbackError);
+test('navigator.getUserMedia({video: true}, emptyFunction, -Infinity)', true, errorCallbackError);
+
+window.jsTestIsAsync = false;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamwebkitGetUserMediashadowingthenhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/mediastream/webkitGetUserMedia-shadowing-then.html (0 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/webkitGetUserMedia-shadowing-then.html         (rev 0)
+++ trunk/LayoutTests/fast/mediastream/webkitGetUserMedia-shadowing-then.html        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>Shadowing then()</title>
+</head>
+<body>
+<!--
+This test verifies that the implementation of navigator.getUserMedia 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.getUserMedia(options, gotUserMedia, userMediaError);
+
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (212322 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebCore/CMakeLists.txt        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -221,6 +221,7 @@
</span><span class="cx"> Modules/mediastream/MediaTrackConstraints.idl
</span><span class="cx"> Modules/mediastream/MediaTrackSupportedConstraints.idl
</span><span class="cx"> Modules/mediastream/NavigatorMediaDevices.idl
</span><ins>+ Modules/mediastream/NavigatorUserMedia.idl
</ins><span class="cx"> Modules/mediastream/OverconstrainedError.idl
</span><span class="cx"> Modules/mediastream/OverconstrainedErrorEvent.idl
</span><span class="cx"> Modules/mediastream/RTCConfiguration.idl
</span><span class="lines">@@ -3666,6 +3667,7 @@
</span><span class="cx"> ${WEBCORE_DIR}/Modules/fetch/FetchRequest.js
</span><span class="cx"> ${WEBCORE_DIR}/Modules/fetch/FetchResponse.js
</span><span class="cx"> ${WEBCORE_DIR}/Modules/fetch/WorkerGlobalScopeFetch.js
</span><ins>+ ${WEBCORE_DIR}/Modules/mediastream/NavigatorUserMedia.js
</ins><span class="cx"> ${WEBCORE_DIR}/Modules/mediastream/RTCPeerConnection.js
</span><span class="cx"> ${WEBCORE_DIR}/Modules/mediastream/RTCPeerConnectionInternals.js
</span><span class="cx"> ${WEBCORE_DIR}/Modules/streams/ByteLengthQueuingStrategy.js
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (212322 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebCore/ChangeLog        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2017-02-14 Eric Carlson <eric.carlson@apple.com>
+
+ [MediaStream] add navigator.getUserMedia for compatibility with legacy content
+ https://bugs.webkit.org/show_bug.cgi?id=168324
+ <rdar://problem/30513125>
+
+ Reviewed by Youenn Fablet.
+
+ Tests: fast/mediastream/argument-types.html
+ fast/mediastream/getusermedia.html
+ fast/mediastream/webkitGetUserMedia-shadowing-then.html
+
+ * CMakeLists.txt:
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * Modules/mediastream/MediaDevices.idl:
+ * Modules/mediastream/NavigatorUserMedia.idl: Added.
+ * Modules/mediastream/NavigatorUserMedia.js: Added.
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/WebCoreBuiltinNames.h:
+ * page/Navigator.idl:
+
</ins><span class="cx"> 2017-02-14 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Fallback to legacy type only when event is trusted
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.cpp (212322 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.cpp        2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebCore/DerivedSources.cpp        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -349,6 +349,7 @@
</span><span class="cx"> #include "JSNavigatorContentUtils.cpp"
</span><span class="cx"> #include "JSNavigatorGeolocation.cpp"
</span><span class="cx"> #include "JSNavigatorMediaDevices.cpp"
</span><ins>+#include "JSNavigatorUserMedia.cpp"
</ins><span class="cx"> #include "JSNavigatorVibration.cpp"
</span><span class="cx"> #include "JSNode.cpp"
</span><span class="cx"> #include "JSNodeFilter.cpp"
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (212322 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebCore/DerivedSources.make        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -162,6 +162,7 @@
</span><span class="cx"> $(WebCore)/Modules/mediastream/MediaTrackConstraints.idl \
</span><span class="cx"> $(WebCore)/Modules/mediastream/MediaTrackSupportedConstraints.idl \
</span><span class="cx"> $(WebCore)/Modules/mediastream/NavigatorMediaDevices.idl \
</span><ins>+ $(WebCore)/Modules/mediastream/NavigatorUserMedia.idl \
</ins><span class="cx"> $(WebCore)/Modules/mediastream/OverconstrainedError.idl \
</span><span class="cx"> $(WebCore)/Modules/mediastream/OverconstrainedErrorEvent.idl \
</span><span class="cx"> $(WebCore)/Modules/mediastream/RTCConfiguration.idl \
</span><span class="lines">@@ -1341,6 +1342,7 @@
</span><span class="cx"> $(WebCore)/Modules/fetch/FetchRequest.js \
</span><span class="cx"> $(WebCore)/Modules/fetch/FetchResponse.js \
</span><span class="cx"> ${WebCore}/Modules/fetch/WorkerGlobalScopeFetch.js \
</span><ins>+ $(WebCore)/Modules/mediastream/NavigatorUserMedia.js \
</ins><span class="cx"> $(WebCore)/Modules/mediastream/RTCPeerConnection.js \
</span><span class="cx"> $(WebCore)/Modules/mediastream/RTCPeerConnectionInternals.js \
</span><span class="cx"> $(WebCore)/Modules/streams/ByteLengthQueuingStrategy.js \
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaDevicesidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaDevices.idl (212322 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaDevices.idl        2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDevices.idl        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> ] interface MediaDevices {
</span><span class="cx"> MediaTrackSupportedConstraints getSupportedConstraints();
</span><span class="cx">
</span><del>- Promise<MediaStream> getUserMedia(optional MediaStreamConstraints constraints);
</del><ins>+ [PrivateIdentifier, PublicIdentifier] Promise<MediaStream> getUserMedia(optional MediaStreamConstraints constraints);
</ins><span class="cx"> Promise<sequence<MediaDeviceInfo>> enumerateDevices();
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamNavigatorUserMediaidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.idl (0 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.idl         (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.idl        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+/*
+* Copyright (C) 2017 Apple 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.
+* 3. Neither the name of Ericsson nor the names of its contributors
+* may be used to endorse or promote products derived from this
+* software without specific prior written permission.
+*
+* 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.
+*/
+
+[
+ Conditional=MEDIA_STREAM,
+ EnabledAtRuntime=MediaStream,
+] partial interface Navigator {
+ [JSBuiltin] void getUserMedia(MediaStreamConstraints constraints, NavigatorUserMediaSuccessCallback successCallback, NavigatorUserMediaErrorCallback errorCallback);
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamNavigatorUserMediajs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.js (0 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.js         (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/NavigatorUserMedia.js        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2015 Canon Inc.
+ * Copyright (C) 2017 Apple 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. ``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 getUserMedia(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", "getUserMedia");
+
+ if (arguments.length < 3)
+ @throwTypeError("Not enough arguments");
+
+ if (options !== @Object(options))
+ @throwTypeError("Argument 1 (options) to Navigator.getUserMedia must be an object");
+
+ if (typeof successCallback !== "function")
+ @throwTypeError("Argument 2 ('successCallback') to Navigator.getUserMedia must be a function");
+ if (typeof errorCallback !== "function")
+ @throwTypeError("Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function");
+
+ this.mediaDevices.@getUserMedia(options).@then(successCallback, errorCallback);
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (212322 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -146,6 +146,8 @@
</span><span class="cx">                 073B87671E4385AC0071C0EC /* AudioSampleBufferList.h in Headers */ = {isa = PBXBuildFile; fileRef = 073B87631E43859D0071C0EC /* AudioSampleBufferList.h */; };
</span><span class="cx">                 073B87681E4385AC0071C0EC /* AudioSampleDataSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073B87641E43859D0071C0EC /* AudioSampleDataSource.cpp */; };
</span><span class="cx">                 073B87691E4385AC0071C0EC /* AudioSampleDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 073B87651E43859D0071C0EC /* AudioSampleDataSource.h */; };
</span><ins>+                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, ); }; };
</ins><span class="cx">                 073BE34E17D180B2002BD431 /* RTCSessionDescriptionDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221BAB17CF0AD400848E51 /* RTCSessionDescriptionDescriptor.cpp */; };
</span><span class="cx">                 073BE34F17D18183002BD431 /* RTCIceCandidateDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221BA617CF0AD400848E51 /* RTCIceCandidateDescriptor.cpp */; };
</span><span class="cx">                 0744ECED1E0C4E30000D0944 /* MockRealtimeAudioSourceMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0744ECEC1E0C4AE5000D0944 /* MockRealtimeAudioSourceMac.mm */; };
</span><span class="lines">@@ -7180,6 +7182,7 @@
</span><span class="cx">                 07221B5717CEC32700848E51 /* MediaStreamTrackEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamTrackEvent.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 07221B5817CEC32700848E51 /* MediaStreamTrackEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamTrackEvent.h; sourceTree = "<group>"; };
</span><span class="cx">                 07221B5917CEC32700848E51 /* MediaStreamTrackEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaStreamTrackEvent.idl; sourceTree = "<group>"; };
</span><ins>+                07221B5C17CEC32700848E51 /* NavigatorUserMedia.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorUserMedia.idl; sourceTree = "<group>"; };
</ins><span class="cx">                 07221B6317CEC32700848E51 /* RTCDataChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCDataChannel.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 07221B6417CEC32700848E51 /* RTCDataChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCDataChannel.h; sourceTree = "<group>"; };
</span><span class="cx">                 07221B6517CEC32700848E51 /* RTCDataChannel.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCDataChannel.idl; sourceTree = "<group>"; };
</span><span class="lines">@@ -7272,6 +7275,8 @@
</span><span class="cx">                 073B87631E43859D0071C0EC /* AudioSampleBufferList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioSampleBufferList.h; sourceTree = "<group>"; };
</span><span class="cx">                 073B87641E43859D0071C0EC /* AudioSampleDataSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioSampleDataSource.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 073B87651E43859D0071C0EC /* AudioSampleDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioSampleDataSource.h; sourceTree = "<group>"; };
</span><ins>+                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>"; };
</ins><span class="cx">                 0744ECEB1E0C4AE5000D0944 /* MockRealtimeAudioSourceMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockRealtimeAudioSourceMac.h; sourceTree = "<group>"; };
</span><span class="cx">                 0744ECEC1E0C4AE5000D0944 /* MockRealtimeAudioSourceMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MockRealtimeAudioSourceMac.mm; sourceTree = "<group>"; };
</span><span class="cx">                 074E82B818A69F0E007EF54C /* PlatformTimeRanges.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformTimeRanges.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -8851,6 +8856,7 @@
</span><span class="cx">                 419BC2DC1685329900D64D6D /* VisitedLinkState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisitedLinkState.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 419BC2DD1685329900D64D6D /* VisitedLinkState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitedLinkState.h; sourceTree = "<group>"; };
</span><span class="cx">                 419BE7521BC7F3DB00E1C85B /* WebCoreBuiltinNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreBuiltinNames.h; sourceTree = "<group>"; };
</span><ins>+                419BE75A1BCBD3ED00E1C85B /* NavigatorUserMedia.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = NavigatorUserMedia.js; sourceTree = "<group>"; };
</ins><span class="cx">                 419FAFAD1ABABCD5005B828B /* ReadableStreamDefaultReader.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStreamDefaultReader.idl; sourceTree = "<group>"; };
</span><span class="cx">                 41A023ED1A39DB7900F722CF /* ReadableStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStream.idl; sourceTree = "<group>"; };
</span><span class="cx">                 41A023ED1A39DB7900F722DF /* WritableStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WritableStream.idl; sourceTree = "<group>"; };
</span><span class="lines">@@ -15337,6 +15343,8 @@
</span><span class="cx">                                 5EA725CA1ACABCB500EAD17B /* NavigatorMediaDevices.cpp */,
</span><span class="cx">                                 5EA725CB1ACABCB500EAD17B /* NavigatorMediaDevices.h */,
</span><span class="cx">                                 5EA725CC1ACABCB500EAD17B /* NavigatorMediaDevices.idl */,
</span><ins>+                                07221B5C17CEC32700848E51 /* NavigatorUserMedia.idl */,
+                                419BE75A1BCBD3ED00E1C85B /* NavigatorUserMedia.js */,
</ins><span class="cx">                                 0704A4051D6DE9F10086DCDB /* OverconstrainedError.h */,
</span><span class="cx">                                 0704A4031D6DE9F10086DCDB /* OverconstrainedError.idl */,
</span><span class="cx">                                 072A703E1D6E8F6200DF0AFC /* OverconstrainedErrorEvent.h */,
</span><span class="lines">@@ -15564,6 +15572,8 @@
</span><span class="cx">                                 932CC0D11DFFD667004C0F9F /* JSMediaTrackConstraints.h */,
</span><span class="cx">                                 0787C4671BFBDF6F006DCD7F /* JSMediaTrackSupportedConstraints.cpp */,
</span><span class="cx">                                 0787C4681BFBDF6F006DCD7F /* JSMediaTrackSupportedConstraints.h */,
</span><ins>+                                073BE33E17D17E01002BD431 /* JSNavigatorUserMedia.cpp */,
+                                073BE33F17D17E01002BD431 /* JSNavigatorUserMedia.h */,
</ins><span class="cx">                                 0704A4091D6DFC690086DCDB /* JSOverconstrainedError.cpp */,
</span><span class="cx">                                 0704A40A1D6DFC690086DCDB /* JSOverconstrainedError.h */,
</span><span class="cx">                                 0704A4131D6F39FB0086DCDB /* JSOverconstrainedErrorEvent.cpp */,
</span><span class="lines">@@ -26790,6 +26800,7 @@
</span><span class="cx">                                 C6F08FCA1431000D00685849 /* JSMutationRecord.h in Headers */,
</span><span class="cx">                                 BCD9C2C10C17B69E005C90A2 /* JSNamedNodeMap.h in Headers */,
</span><span class="cx">                                 A9D247F80D757E3400FDF959 /* JSNavigator.h in Headers */,
</span><ins>+                                073BE34117D17E01002BD431 /* JSNavigatorUserMedia.h in Headers */,
</ins><span class="cx">                                 BC9439C3116CF4940048C750 /* JSNodeCustom.h in Headers */,
</span><span class="cx">                                 14115B7309F84CD600CA4FC1 /* JSNodeFilter.h in Headers */,
</span><span class="cx">                                 1A750D8E0A90E521000FF215 /* JSNodeIterator.h in Headers */,
</span><span class="lines">@@ -30628,6 +30639,7 @@
</span><span class="cx">                                 C6F08FC91431000D00685849 /* JSMutationRecord.cpp in Sources */,
</span><span class="cx">                                 BCD9C2C00C17B69E005C90A2 /* JSNamedNodeMap.cpp in Sources */,
</span><span class="cx">                                 A9D247F70D757E3400FDF959 /* JSNavigator.cpp in Sources */,
</span><ins>+                                073BE34017D17E01002BD431 /* JSNavigatorUserMedia.cpp in Sources */,
</ins><span class="cx">                                 14DC0D3709FED073007B0235 /* JSNode.cpp in Sources */,
</span><span class="cx">                                 BCD9C2640C17AA67005C90A2 /* JSNodeCustom.cpp in Sources */,
</span><span class="cx">                                 E3150EA61DA7219000194012 /* JSNodeDOMJIT.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWebCoreBuiltinNamesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (212322 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h        2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> macro(fetchRequest) \
</span><span class="cx"> macro(fillFromJS) \
</span><span class="cx"> macro(finishConsumingStream) \
</span><ins>+ macro(getUserMedia) \
</ins><span class="cx"> macro(getRemoteStreams) \
</span><span class="cx"> macro(getSenders) \
</span><span class="cx"> macro(getTracks) \
</span></span></pre></div>
<a id="trunkSourceWebCorepageNavigatoridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Navigator.idl (212322 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Navigator.idl        2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebCore/page/Navigator.idl        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx"> readonly attribute DOMMimeTypeArray mimeTypes;
</span><span class="cx"> readonly attribute boolean cookieEnabled;
</span><span class="cx"> boolean javaEnabled();
</span><del>-
</del><ins>+
</ins><span class="cx"> // FIXME: Convert this #if'def to an IDL conditional attribute.
</span><span class="cx"> #if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS
</span><span class="cx"> readonly attribute boolean standalone;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (212322 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebInspectorUI/ChangeLog        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2017-02-14 Eric Carlson <eric.carlson@apple.com>
+
+ [MediaStream] add navigator.getUserMedia for compatibility with legacy content
+ https://bugs.webkit.org/show_bug.cgi?id=168324
+ <rdar://problem/30513125>
+
+ Reviewed by Youenn Fablet.
+
+ * UserInterface/Models/NativeFunctionParameters.js:
+
</ins><span class="cx"> 2017-02-13 Devin Rousso <dcrousso+webkit@gmail.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: provide a way to show current value of CSS variables in style rules
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsNativeFunctionParametersjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js (212322 => 212323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js        2017-02-14 21:15:07 UTC (rev 212322)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js        2017-02-14 22:34:48 UTC (rev 212323)
</span><span class="lines">@@ -1161,6 +1161,21 @@
</span><span class="cx"> __proto__: null,
</span><span class="cx"> },
</span><span class="cx">
</span><ins>+ Navigator: {
+ getUserMedia: "options, successCallback, errorCallback",
+ __proto__: null,
+ },
+
+ NavigatorUserMediaErrorCallback: {
+ handleEvent: "error",
+ __proto__: null,
+ },
+
+ NavigatorUserMediaSuccessCallback: {
+ handleEvent: "stream",
+ __proto__: null,
+ },
+
</ins><span class="cx"> NodeFilter: {
</span><span class="cx"> acceptNode: "[n]",
</span><span class="cx"> __proto__: null,
</span></span></pre>
</div>
</div>
</body>
</html>