<!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>[265342] 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/265342">265342</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2020-08-06 13:01:30 -0700 (Thu, 06 Aug 2020)</dd>
</dl>

<h3>Log Message</h3>
<pre>MediaStreamAudioSourceNode should have a constructor
https://bugs.webkit.org/show_bug.cgi?id=215225

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

Rebaseline WPT tests now that more checks are passing.

* web-platform-tests/webaudio/idlharness.https.window-expected.txt:
* web-platform-tests/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-ctor-expected.txt:

Source/WebCore:

MediaStreamAudioSourceNode should have a constructor:
- https://webaudio.github.io/web-audio-api/#mediastreamaudiosourcenode

No new tests, rebaselined existing tests.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::createMediaStreamSource):
* Modules/webaudio/MediaStreamAudioSourceNode.cpp:
(WebCore::MediaStreamAudioSourceNode::create):
* Modules/webaudio/MediaStreamAudioSourceNode.h:
* Modules/webaudio/MediaStreamAudioSourceNode.idl:
* Modules/webaudio/MediaStreamAudioSourceOptions.h: Copied from Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl.
* Modules/webaudio/MediaStreamAudioSourceOptions.idl: Copied from Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl.
* Modules/webaudio/WebKitAudioContext.cpp:
(WebCore::WebKitAudioContext::createMediaStreamSource):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestswebaudioidlharnesshttpswindowexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/idlharness.https.window-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestswebaudiotheaudioapithemediastreamaudiosourcenodeinterfacemediastreamaudiosourcenodectorexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-ctor-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="#trunkSourceWebCoreDerivedSourcesinputxcfilelist">trunk/Source/WebCore/DerivedSources-input.xcfilelist</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesoutputxcfilelist">trunk/Source/WebCore/DerivedSources-output.xcfilelist</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioContextcpp">trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioMediaStreamAudioSourceNodecpp">trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioMediaStreamAudioSourceNodeh">trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioMediaStreamAudioSourceNodeidl">trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioWebKitAudioContextcpp">trunk/Source/WebCore/Modules/webaudio/WebKitAudioContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreSourcestxt">trunk/Source/WebCore/Sources.txt</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModuleswebaudioMediaStreamAudioSourceOptionsh">trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceOptions.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioMediaStreamAudioSourceOptionsidl">trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceOptions.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (265341 => 265342)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog 2020-08-06 18:38:07 UTC (rev 265341)
+++ trunk/LayoutTests/imported/w3c/ChangeLog    2020-08-06 20:01:30 UTC (rev 265342)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2020-08-06  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><ins>+        MediaStreamAudioSourceNode should have a constructor
+        https://bugs.webkit.org/show_bug.cgi?id=215225
+
+        Reviewed by Eric Carlson.
+
+        Rebaseline WPT tests now that more checks are passing.
+
+        * web-platform-tests/webaudio/idlharness.https.window-expected.txt:
+        * web-platform-tests/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-ctor-expected.txt:
+
+2020-08-06  Chris Dumez  <cdumez@apple.com>
+
</ins><span class="cx">         DynamicsCompressorNode.reduction attribute should be a float, not an AudioParam
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=215195
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestswebaudioidlharnesshttpswindowexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/idlharness.https.window-expected.txt (265341 => 265342)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/idlharness.https.window-expected.txt  2020-08-06 18:38:07 UTC (rev 265341)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/idlharness.https.window-expected.txt     2020-08-06 20:01:30 UTC (rev 265342)
</span><span class="lines">@@ -855,7 +855,7 @@
</span><span class="cx"> FAIL AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "channelCountMode" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new MediaStreamAudioDestinationNode(context)')"
</span><span class="cx"> FAIL AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "channelInterpretation" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new MediaStreamAudioDestinationNode(context)')"
</span><span class="cx"> PASS MediaStreamAudioSourceNode interface: existence and properties of interface object 
</span><del>-FAIL MediaStreamAudioSourceNode interface object length assert_equals: wrong value for MediaStreamAudioSourceNode.length expected 2 but got 0
</del><ins>+PASS MediaStreamAudioSourceNode interface object length 
</ins><span class="cx"> PASS MediaStreamAudioSourceNode interface object name 
</span><span class="cx"> PASS MediaStreamAudioSourceNode interface: existence and properties of interface prototype object 
</span><span class="cx"> PASS MediaStreamAudioSourceNode interface: existence and properties of interface prototype object's "constructor" property 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestswebaudiotheaudioapithemediastreamaudiosourcenodeinterfacemediastreamaudiosourcenodectorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-ctor-expected.txt (265341 => 265342)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-ctor-expected.txt   2020-08-06 18:38:07 UTC (rev 265341)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-ctor-expected.txt      2020-08-06 20:01:30 UTC (rev 265342)
</span><span class="lines">@@ -1,16 +1,6 @@
</span><span class="cx"> 
</span><span class="cx"> PASS MediaStreamAudioSourceNode created with factory method and MediaStream with no tracks 
</span><del>-FAIL MediaStreamAudioSourceNode created with constructor and MediaStream with no tracks assert_throws_dom: A MediaStreamAudioSourceNode can only be constructed via the constructor
-          with a MediaStream that has at least one track of kind "audio" function "function () {
-              new MediaStreamAudioSourceNode(ac, { mediaStream: emptyStream });
-            }" threw object "TypeError: function is not a constructor (evaluating 'new MediaStreamAudioSourceNode(ac, { mediaStream: emptyStream })')" that is not a DOMException InvalidStateError: property "code" is equal to undefined, expected 11
</del><ins>+PASS MediaStreamAudioSourceNode created with constructor and MediaStream with no tracks 
</ins><span class="cx"> PASS MediaStreamAudioSourceNode created with the factory method and MediaStream with only a video track 
</span><del>-FAIL MediaStreamAudioSourceNode created with constructor and MediaStream with only a video track assert_throws_dom: A MediaStreamAudioSourceNode can only be constructed via the factory with a
-          MediaStream that has at least one track of kind "audio" function "function () {
-              new MediaStreamAudioSourceNode(ac, {
-                mediaStream: videoOnlyStream,
-              });
-            }" threw object "TypeError: function is not a constructor (evaluating 'new MediaStreamAudioSourceNode(ac, {
-                mediaStream: videoOnlyStream,
-              })')" that is not a DOMException InvalidStateError: property "code" is equal to undefined, expected 11
</del><ins>+PASS MediaStreamAudioSourceNode created with constructor and MediaStream with only a video track 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (265341 => 265342)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt      2020-08-06 18:38:07 UTC (rev 265341)
+++ trunk/Source/WebCore/CMakeLists.txt 2020-08-06 20:01:30 UTC (rev 265342)
</span><span class="lines">@@ -486,6 +486,7 @@
</span><span class="cx">     Modules/webaudio/MediaElementAudioSourceOptions.idl
</span><span class="cx">     Modules/webaudio/MediaStreamAudioDestinationNode.idl
</span><span class="cx">     Modules/webaudio/MediaStreamAudioSourceNode.idl
</span><ins>+    Modules/webaudio/MediaStreamAudioSourceOptions.idl
</ins><span class="cx">     Modules/webaudio/OfflineAudioCompletionEvent.idl
</span><span class="cx">     Modules/webaudio/OfflineAudioCompletionEventInit.idl
</span><span class="cx">     Modules/webaudio/OfflineAudioContext.idl
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (265341 => 265342)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2020-08-06 18:38:07 UTC (rev 265341)
+++ trunk/Source/WebCore/ChangeLog      2020-08-06 20:01:30 UTC (rev 265342)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2020-08-06  Chris Dumez  <cdumez@apple.com>
+
+        MediaStreamAudioSourceNode should have a constructor
+        https://bugs.webkit.org/show_bug.cgi?id=215225
+
+        Reviewed by Eric Carlson.
+
+        MediaStreamAudioSourceNode should have a constructor:
+        - https://webaudio.github.io/web-audio-api/#mediastreamaudiosourcenode
+
+        No new tests, rebaselined existing tests.
+
+        * CMakeLists.txt:
+        * DerivedSources-input.xcfilelist:
+        * DerivedSources-output.xcfilelist:
+        * DerivedSources.make:
+        * Modules/webaudio/AudioContext.cpp:
+        (WebCore::AudioContext::createMediaStreamSource):
+        * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
+        (WebCore::MediaStreamAudioSourceNode::create):
+        * Modules/webaudio/MediaStreamAudioSourceNode.h:
+        * Modules/webaudio/MediaStreamAudioSourceNode.idl:
+        * Modules/webaudio/MediaStreamAudioSourceOptions.h: Copied from Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl.
+        * Modules/webaudio/MediaStreamAudioSourceOptions.idl: Copied from Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl.
+        * Modules/webaudio/WebKitAudioContext.cpp:
+        (WebCore::WebKitAudioContext::createMediaStreamSource):
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2020-08-06  Myles C. Maxfield  <mmaxfield@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Rename LeadingExpansion and TrailingExpansion to LeftExpansion and RightExpansion
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesinputxcfilelist"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources-input.xcfilelist (265341 => 265342)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources-input.xcfilelist     2020-08-06 18:38:07 UTC (rev 265341)
+++ trunk/Source/WebCore/DerivedSources-input.xcfilelist        2020-08-06 20:01:30 UTC (rev 265342)
</span><span class="lines">@@ -335,6 +335,7 @@
</span><span class="cx"> $(PROJECT_DIR)/Modules/webaudio/MediaElementAudioSourceOptions.idl
</span><span class="cx"> $(PROJECT_DIR)/Modules/webaudio/MediaStreamAudioDestinationNode.idl
</span><span class="cx"> $(PROJECT_DIR)/Modules/webaudio/MediaStreamAudioSourceNode.idl
</span><ins>+$(PROJECT_DIR)/Modules/webaudio/MediaStreamAudioSourceOptions.idl
</ins><span class="cx"> $(PROJECT_DIR)/Modules/webaudio/OfflineAudioCompletionEvent.idl
</span><span class="cx"> $(PROJECT_DIR)/Modules/webaudio/OfflineAudioCompletionEventInit.idl
</span><span class="cx"> $(PROJECT_DIR)/Modules/webaudio/OfflineAudioContext.idl
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesoutputxcfilelist"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (265341 => 265342)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources-output.xcfilelist    2020-08-06 18:38:07 UTC (rev 265341)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist       2020-08-06 20:01:30 UTC (rev 265342)
</span><span class="lines">@@ -1116,6 +1116,8 @@
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMediaStreamAudioDestinationNode.h
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMediaStreamAudioSourceNode.cpp
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMediaStreamAudioSourceNode.h
</span><ins>+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMediaStreamAudioSourceOptions.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMediaStreamAudioSourceOptions.h
</ins><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMediaStreamTrack.cpp
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMediaStreamTrack.h
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMediaStreamTrackEvent.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (265341 => 265342)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make 2020-08-06 18:38:07 UTC (rev 265341)
+++ trunk/Source/WebCore/DerivedSources.make    2020-08-06 20:01:30 UTC (rev 265342)
</span><span class="lines">@@ -418,6 +418,7 @@
</span><span class="cx">     $(WebCore)/Modules/webaudio/MediaElementAudioSourceOptions.idl \
</span><span class="cx">     $(WebCore)/Modules/webaudio/MediaStreamAudioDestinationNode.idl \
</span><span class="cx">     $(WebCore)/Modules/webaudio/MediaStreamAudioSourceNode.idl \
</span><ins>+    $(WebCore)/Modules/webaudio/MediaStreamAudioSourceOptions.idl \
</ins><span class="cx">     $(WebCore)/Modules/webaudio/OfflineAudioCompletionEvent.idl \
</span><span class="cx">     $(WebCore)/Modules/webaudio/OfflineAudioCompletionEventInit.idl \
</span><span class="cx">     $(WebCore)/Modules/webaudio/OfflineAudioContext.idl \
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp (265341 => 265342)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp   2020-08-06 18:38:07 UTC (rev 265341)
+++ trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp      2020-08-06 20:01:30 UTC (rev 265342)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include "MediaStreamAudioDestinationNode.h"
</span><span class="cx"> #include "MediaStreamAudioSource.h"
</span><span class="cx"> #include "MediaStreamAudioSourceNode.h"
</span><ins>+#include "MediaStreamAudioSourceOptions.h"
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="lines">@@ -128,30 +129,7 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx"> 
</span><del>-    if (isStopped())
-        return Exception { InvalidStateError };
-
-    auto audioTracks = mediaStream.getAudioTracks();
-    if (audioTracks.isEmpty())
-        return Exception { InvalidStateError };
-
-    MediaStreamTrack* providerTrack = nullptr;
-    for (auto& track : audioTracks) {
-        if (track->audioSourceProvider()) {
-            providerTrack = track.get();
-            break;
-        }
-    }
-    if (!providerTrack)
-        return Exception { InvalidStateError };
-
-    lazyInitialize();
-
-    auto node = MediaStreamAudioSourceNode::create(*this, mediaStream, *providerTrack);
-    node->setFormat(2, sampleRate());
-
-    refNode(node); // context keeps reference until node is disconnected
-    return node;
</del><ins>+    return MediaStreamAudioSourceNode::create(*this, { &mediaStream });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr<Ref<MediaStreamAudioDestinationNode>> AudioContext::createMediaStreamDestination()
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioMediaStreamAudioSourceNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp (265341 => 265342)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp     2020-08-06 18:38:07 UTC (rev 265341)
+++ trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp        2020-08-06 20:01:30 UTC (rev 265342)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "AudioContext.h"
</span><span class="cx"> #include "AudioNodeOutput.h"
</span><span class="cx"> #include "Logging.h"
</span><ins>+#include "MediaStreamAudioSourceOptions.h"
</ins><span class="cx"> #include <wtf/IsoMallocInlines.h>
</span><span class="cx"> #include <wtf/Locker.h>
</span><span class="cx"> 
</span><span class="lines">@@ -38,9 +39,35 @@
</span><span class="cx"> 
</span><span class="cx"> WTF_MAKE_ISO_ALLOCATED_IMPL(MediaStreamAudioSourceNode);
</span><span class="cx"> 
</span><del>-Ref<MediaStreamAudioSourceNode> MediaStreamAudioSourceNode::create(BaseAudioContext& context, MediaStream& mediaStream, MediaStreamTrack& audioTrack)
</del><ins>+ExceptionOr<Ref<MediaStreamAudioSourceNode>> MediaStreamAudioSourceNode::create(BaseAudioContext& context, MediaStreamAudioSourceOptions&& options)
</ins><span class="cx"> {
</span><del>-    return adoptRef(*new MediaStreamAudioSourceNode(context, mediaStream, audioTrack));
</del><ins>+    RELEASE_ASSERT(options.mediaStream);
+
+    if (context.isStopped())
+        return Exception { InvalidStateError };
+
+    auto audioTracks = options.mediaStream->getAudioTracks();
+    if (audioTracks.isEmpty())
+        return Exception { InvalidStateError, "Media stream has no audio tracks"_s };
+
+    MediaStreamTrack* providerTrack = nullptr;
+    for (auto& track : audioTracks) {
+        if (track->audioSourceProvider()) {
+            providerTrack = track.get();
+            break;
+        }
+    }
+    if (!providerTrack)
+        return Exception { InvalidStateError, "Could not find an audio track with an audio source provider"_s };
+
+    context.lazyInitialize();
+
+    auto node = adoptRef(*new MediaStreamAudioSourceNode(context, *options.mediaStream, *providerTrack));
+    node->setFormat(2, context.sampleRate());
+
+    context.refNode(node); // context keeps reference until node is disconnected
+
+    return node;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> MediaStreamAudioSourceNode::MediaStreamAudioSourceNode(BaseAudioContext& context, MediaStream& mediaStream, MediaStreamTrack& audioTrack)
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioMediaStreamAudioSourceNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.h (265341 => 265342)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.h       2020-08-06 18:38:07 UTC (rev 265341)
+++ trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.h  2020-08-06 20:01:30 UTC (rev 265342)
</span><span class="lines">@@ -35,12 +35,13 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class AudioContext;
</span><ins>+struct MediaStreamAudioSourceOptions;
</ins><span class="cx"> class MultiChannelResampler;
</span><span class="cx"> 
</span><span class="cx"> class MediaStreamAudioSourceNode final : public AudioNode, public AudioSourceProviderClient {
</span><span class="cx">     WTF_MAKE_ISO_ALLOCATED(MediaStreamAudioSourceNode);
</span><span class="cx"> public:
</span><del>-    static Ref<MediaStreamAudioSourceNode> create(BaseAudioContext&, MediaStream&, MediaStreamTrack&);
</del><ins>+    static ExceptionOr<Ref<MediaStreamAudioSourceNode>> create(BaseAudioContext&, MediaStreamAudioSourceOptions&&);
</ins><span class="cx"> 
</span><span class="cx">     virtual ~MediaStreamAudioSourceNode();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioMediaStreamAudioSourceNodeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl (265341 => 265342)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl     2020-08-06 18:38:07 UTC (rev 265341)
+++ trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl        2020-08-06 20:01:30 UTC (rev 265342)
</span><span class="lines">@@ -26,5 +26,7 @@
</span><span class="cx">     Conditional=WEB_AUDIO&MEDIA_STREAM,
</span><span class="cx">     JSGenerateToJSObject
</span><span class="cx"> ] interface MediaStreamAudioSourceNode : AudioNode {
</span><ins>+    [MayThrowException, EnabledBySetting=ModernUnprefixedWebAudio] constructor (AudioContext context, MediaStreamAudioSourceOptions options);
+
</ins><span class="cx">     readonly attribute MediaStream mediaStream;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioMediaStreamAudioSourceOptionshfromrev265341trunkSourceWebCoreModuleswebaudioMediaStreamAudioSourceNodeidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceOptions.h (from rev 265341, trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl) (0 => 265342)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceOptions.h                            (rev 0)
+++ trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceOptions.h       2020-08-06 20:01:30 UTC (rev 265342)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+/*
+ * Copyright (C) 2020, 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. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEB_AUDIO) && ENABLE(MEDIA_STREAM)
+
+#include "MediaStream.h"
+
+namespace WebCore {
+
+struct MediaStreamAudioSourceOptions {
+    RefPtr<MediaStream> mediaStream;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO) && ENABLE(MEDIA_STREAM)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioMediaStreamAudioSourceOptionsidlfromrev265341trunkSourceWebCoreModuleswebaudioMediaStreamAudioSourceNodeidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceOptions.idl (from rev 265341, trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl) (0 => 265342)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceOptions.idl                          (rev 0)
+++ trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceOptions.idl     2020-08-06 20:01:30 UTC (rev 265342)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+/*
+ * Copyright (C) 2020, 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. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=WEB_AUDIO&MEDIA_STREAM
+] dictionary MediaStreamAudioSourceOptions {
+    required MediaStream mediaStream;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioWebKitAudioContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/WebKitAudioContext.cpp (265341 => 265342)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/WebKitAudioContext.cpp     2020-08-06 18:38:07 UTC (rev 265341)
+++ trunk/Source/WebCore/Modules/webaudio/WebKitAudioContext.cpp        2020-08-06 20:01:30 UTC (rev 265342)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include "MediaStreamAudioDestinationNode.h"
</span><span class="cx"> #include "MediaStreamAudioSource.h"
</span><span class="cx"> #include "MediaStreamAudioSourceNode.h"
</span><ins>+#include "MediaStreamAudioSourceOptions.h"
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="lines">@@ -112,31 +113,7 @@
</span><span class="cx">     ALWAYS_LOG(LOGIDENTIFIER);
</span><span class="cx"> 
</span><span class="cx">     ASSERT(isMainThread());
</span><del>-
-    if (isStopped())
-        return Exception { InvalidStateError };
-
-    auto audioTracks = mediaStream.getAudioTracks();
-    if (audioTracks.isEmpty())
-        return Exception { InvalidStateError };
-
-    MediaStreamTrack* providerTrack = nullptr;
-    for (auto& track : audioTracks) {
-        if (track->audioSourceProvider()) {
-            providerTrack = track.get();
-            break;
-        }
-    }
-    if (!providerTrack)
-        return Exception { InvalidStateError };
-
-    lazyInitialize();
-
-    auto node = MediaStreamAudioSourceNode::create(*this, mediaStream, *providerTrack);
-    node->setFormat(2, sampleRate());
-
-    refNode(node); // context keeps reference until node is disconnected
-    return node;
</del><ins>+    return MediaStreamAudioSourceNode::create(*this, { &mediaStream });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr<Ref<MediaStreamAudioDestinationNode>> WebKitAudioContext::createMediaStreamDestination()
</span></span></pre></div>
<a id="trunkSourceWebCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Sources.txt (265341 => 265342)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Sources.txt 2020-08-06 18:38:07 UTC (rev 265341)
+++ trunk/Source/WebCore/Sources.txt    2020-08-06 20:01:30 UTC (rev 265342)
</span><span class="lines">@@ -3087,6 +3087,7 @@
</span><span class="cx"> JSMediaStream.cpp
</span><span class="cx"> JSMediaStreamAudioDestinationNode.cpp
</span><span class="cx"> JSMediaStreamAudioSourceNode.cpp
</span><ins>+JSMediaStreamAudioSourceOptions.cpp
</ins><span class="cx"> JSMediaStreamTrack.cpp
</span><span class="cx"> JSMediaStreamTrackEvent.cpp
</span><span class="cx"> JSMediaTrackConstraints.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (265341 => 265342)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2020-08-06 18:38:07 UTC (rev 265341)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2020-08-06 20:01:30 UTC (rev 265342)
</span><span class="lines">@@ -2455,6 +2455,7 @@
</span><span class="cx">          834476EF1DA5BC5E002B6EC1 /* JSScrollOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8E5 /* JSScrollOptions.h */; };
</span><span class="cx">          834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */; };
</span><span class="cx">          8348BFAC1B85729800912F36 /* ClassCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 8348BFAA1B85729500912F36 /* ClassCollection.h */; };
</span><ins>+               834CBFC224DC786700C2A3D8 /* MediaStreamAudioSourceOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 834CBFBF24DC785500C2A3D8 /* MediaStreamAudioSourceOptions.h */; };
</ins><span class="cx">           834DFAD01F7DAE5D00C2725B /* SharedStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 834DFACC1F7DAE5600C2725B /* SharedStringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          83520C7E1A71BFCC006BD2AA /* CSSFontFamily.h in Headers */ = {isa = PBXBuildFile; fileRef = 83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          8356F97F24D9F818006C3E41 /* WebKitAudioListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 8356F97E24D9F809006C3E41 /* WebKitAudioListener.h */; };
</span><span class="lines">@@ -10475,6 +10476,8 @@
</span><span class="cx">          834B86A71C56E83A00F3F0E3 /* HTMLDataElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLDataElement.h; sourceTree = "<group>"; };
</span><span class="cx">          834B86A81C56E93E00F3F0E3 /* JSHTMLDataElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLDataElement.h; sourceTree = "<group>"; };
</span><span class="cx">          834B86A91C56E93E00F3F0E3 /* JSHTMLDataElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLDataElement.cpp; sourceTree = "<group>"; };
</span><ins>+               834CBFBF24DC785500C2A3D8 /* MediaStreamAudioSourceOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaStreamAudioSourceOptions.h; sourceTree = "<group>"; };
+               834CBFC124DC785600C2A3D8 /* MediaStreamAudioSourceOptions.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = MediaStreamAudioSourceOptions.idl; sourceTree = "<group>"; };
</ins><span class="cx">           834DD4F31BE08989002C9C3E /* PageMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageMac.mm; sourceTree = "<group>"; };
</span><span class="cx">          834DFACC1F7DAE5600C2725B /* SharedStringHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharedStringHash.h; sourceTree = "<group>"; };
</span><span class="cx">          834DFACE1F7DAE5700C2725B /* SharedStringHash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedStringHash.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -29637,6 +29640,8 @@
</span><span class="cx">                          FD671A74159BB07000197559 /* MediaStreamAudioSourceNode.cpp */,
</span><span class="cx">                          FD671A75159BB07000197559 /* MediaStreamAudioSourceNode.h */,
</span><span class="cx">                          FD671A76159BB07000197559 /* MediaStreamAudioSourceNode.idl */,
</span><ins>+                               834CBFBF24DC785500C2A3D8 /* MediaStreamAudioSourceOptions.h */,
+                               834CBFC124DC785600C2A3D8 /* MediaStreamAudioSourceOptions.idl */,
</ins><span class="cx">                           FDA3E955134A49EF008D4B5A /* OfflineAudioCompletionEvent.cpp */,
</span><span class="cx">                          FDA3E956134A49EF008D4B5A /* OfflineAudioCompletionEvent.h */,
</span><span class="cx">                          FDA3E95D134A49FF008D4B5A /* OfflineAudioCompletionEvent.idl */,
</span><span class="lines">@@ -32607,6 +32612,7 @@
</span><span class="cx">                          078E094C17D1709600420AA1 /* MediaStreamAudioDestinationNode.h in Headers */,
</span><span class="cx">                          0783228518013ED800999E0C /* MediaStreamAudioSource.h in Headers */,
</span><span class="cx">                          FD671A78159BB07000197559 /* MediaStreamAudioSourceNode.h in Headers */,
</span><ins>+                               834CBFC224DC786700C2A3D8 /* MediaStreamAudioSourceOptions.h in Headers */,
</ins><span class="cx">                           070F549817F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h in Headers */,
</span><span class="cx">                          078E093717D16B2C00420AA1 /* MediaStreamPrivate.h in Headers */,
</span><span class="cx">                          078E3CC01FE1C73C00483C1D /* MediaStreamRequest.h in Headers */,
</span></span></pre>
</div>
</div>

</body>
</html>