<!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>[244899] trunk/Source/WebCore</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/244899">244899</a></dd>
<dt>Author</dt> <dd>youenn@apple.com</dd>
<dt>Date</dt> <dd>2019-05-02 21:28:13 -0700 (Thu, 02 May 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make AudioContext::scriptExecutionContext() private
https://bugs.webkit.org/show_bug.cgi?id=197512

Reviewed by Eric Carlson.

Refactor code to make audio nodes not rely on AudioContext::scriptExecutionContext.
Instead, let AudioContext provide the necessary API for its nodes.
Covered by existing tests.

* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::looping):
(WebCore::AudioBufferSourceNode::setLooping):
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::postTask):
(WebCore::AudioContext::origin const):
(WebCore::AudioContext::addConsoleMessage):
* Modules/webaudio/AudioContext.h:
(WebCore::AudioContext::isStopped const):
* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::scriptExecutionContext const):
* Modules/webaudio/AudioNode.h:
* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::finish):
* Modules/webaudio/DefaultAudioDestinationNode.cpp:
(WebCore::DefaultAudioDestinationNode::resume):
(WebCore::DefaultAudioDestinationNode::suspend):
(WebCore::DefaultAudioDestinationNode::close):
* Modules/webaudio/MediaElementAudioSourceNode.cpp:
(WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
* Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
(WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
* Modules/webaudio/ScriptProcessorNode.cpp:
(WebCore::ScriptProcessorNode::fireProcessEvent):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioBufferSourceNodecpp">trunk/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioContextcpp">trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioContexth">trunk/Source/WebCore/Modules/webaudio/AudioContext.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioNodecpp">trunk/Source/WebCore/Modules/webaudio/AudioNode.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioNodeh">trunk/Source/WebCore/Modules/webaudio/AudioNode.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioScheduledSourceNodecpp">trunk/Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioDefaultAudioDestinationNodecpp">trunk/Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioMediaElementAudioSourceNodecpp">trunk/Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioMediaStreamAudioDestinationNodecpp">trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioDestinationNode.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioScriptProcessorNodecpp">trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (244898 => 244899)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-05-03 01:19:03 UTC (rev 244898)
+++ trunk/Source/WebCore/ChangeLog      2019-05-03 04:28:13 UTC (rev 244899)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2019-05-02  Youenn Fablet  <youenn@apple.com>
+
+        Make AudioContext::scriptExecutionContext() private
+        https://bugs.webkit.org/show_bug.cgi?id=197512
+
+        Reviewed by Eric Carlson.
+
+        Refactor code to make audio nodes not rely on AudioContext::scriptExecutionContext.
+        Instead, let AudioContext provide the necessary API for its nodes.
+        Covered by existing tests.
+
+        * Modules/webaudio/AudioBufferSourceNode.cpp:
+        (WebCore::AudioBufferSourceNode::looping):
+        (WebCore::AudioBufferSourceNode::setLooping):
+        * Modules/webaudio/AudioContext.cpp:
+        (WebCore::AudioContext::postTask):
+        (WebCore::AudioContext::origin const):
+        (WebCore::AudioContext::addConsoleMessage):
+        * Modules/webaudio/AudioContext.h:
+        (WebCore::AudioContext::isStopped const):
+        * Modules/webaudio/AudioNode.cpp:
+        (WebCore::AudioNode::scriptExecutionContext const):
+        * Modules/webaudio/AudioNode.h:
+        * Modules/webaudio/AudioScheduledSourceNode.cpp:
+        (WebCore::AudioScheduledSourceNode::finish):
+        * Modules/webaudio/DefaultAudioDestinationNode.cpp:
+        (WebCore::DefaultAudioDestinationNode::resume):
+        (WebCore::DefaultAudioDestinationNode::suspend):
+        (WebCore::DefaultAudioDestinationNode::close):
+        * Modules/webaudio/MediaElementAudioSourceNode.cpp:
+        (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
+        * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
+        (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
+        * Modules/webaudio/ScriptProcessorNode.cpp:
+        (WebCore::ScriptProcessorNode::fireProcessEvent):
+
</ins><span class="cx"> 2019-05-02  Ryosuke Niwa  <rniwa@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Disable software keyboard for a math field textarea on desmos.com
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioBufferSourceNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp (244898 => 244899)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp  2019-05-03 01:19:03 UTC (rev 244898)
+++ trunk/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp     2019-05-03 04:28:13 UTC (rev 244899)
</span><span class="lines">@@ -533,8 +533,8 @@
</span><span class="cx"> bool AudioBufferSourceNode::looping()
</span><span class="cx"> {
</span><span class="cx">     static bool firstTime = true;
</span><del>-    if (firstTime && context().scriptExecutionContext()) {
-        context().scriptExecutionContext()->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, "AudioBufferSourceNode 'looping' attribute is deprecated.  Use 'loop' instead."_s);
</del><ins>+    if (firstTime) {
+        context().addConsoleMessage(MessageSource::JS, MessageLevel::Warning, "AudioBufferSourceNode 'looping' attribute is deprecated.  Use 'loop' instead."_s);
</ins><span class="cx">         firstTime = false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -544,8 +544,8 @@
</span><span class="cx"> void AudioBufferSourceNode::setLooping(bool looping)
</span><span class="cx"> {
</span><span class="cx">     static bool firstTime = true;
</span><del>-    if (firstTime && context().scriptExecutionContext()) {
-        context().scriptExecutionContext()->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, "AudioBufferSourceNode 'looping' attribute is deprecated.  Use 'loop' instead."_s);
</del><ins>+    if (firstTime) {
+        context().addConsoleMessage(MessageSource::JS, MessageLevel::Warning, "AudioBufferSourceNode 'looping' attribute is deprecated.  Use 'loop' instead."_s);
</ins><span class="cx">         firstTime = false;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp (244898 => 244899)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp   2019-05-03 01:19:03 UTC (rev 244898)
+++ trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp      2019-05-03 04:28:13 UTC (rev 244899)
</span><span class="lines">@@ -1320,6 +1320,25 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void AudioContext::postTask(WTF::Function<void()>&& task)
+{
+    if (m_isStopScheduled)
+        return;
+
+    m_scriptExecutionContext->postTask(WTFMove(task));
+}
+
+const SecurityOrigin* AudioContext::origin() const
+{
+    return m_scriptExecutionContext ? m_scriptExecutionContext->securityOrigin() : nullptr;
+}
+
+void AudioContext::addConsoleMessage(MessageSource source, MessageLevel level, const String& message)
+{
+    if (m_scriptExecutionContext)
+        m_scriptExecutionContext->addConsoleMessage(source, level, message);
+}
+
</ins><span class="cx"> #if !RELEASE_LOG_DISABLED
</span><span class="cx"> WTFLogChannel& AudioContext::logChannel() const
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioContext.h (244898 => 244899)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioContext.h     2019-05-03 01:19:03 UTC (rev 244898)
+++ trunk/Source/WebCore/Modules/webaudio/AudioContext.h        2019-05-03 04:28:13 UTC (rev 244899)
</span><span class="lines">@@ -34,7 +34,9 @@
</span><span class="cx"> #include "MediaCanStartListener.h"
</span><span class="cx"> #include "MediaProducer.h"
</span><span class="cx"> #include "PlatformMediaSession.h"
</span><ins>+#include "ScriptExecutionContext.h"
</ins><span class="cx"> #include "VisibilityChangeClient.h"
</span><ins>+#include <JavaScriptCore/ConsoleTypes.h>
</ins><span class="cx"> #include <JavaScriptCore/Float32Array.h>
</span><span class="cx"> #include <atomic>
</span><span class="cx"> #include <wtf/HashSet.h>
</span><span class="lines">@@ -72,6 +74,7 @@
</span><span class="cx"> class PannerNode;
</span><span class="cx"> class PeriodicWave;
</span><span class="cx"> class ScriptProcessorNode;
</span><ins>+class SecurityOrigin;
</ins><span class="cx"> class WaveShaperNode;
</span><span class="cx"> 
</span><span class="cx"> // AudioContext is the cornerstone of the web audio API and all AudioNodes are created from it.
</span><span class="lines">@@ -249,7 +252,6 @@
</span><span class="cx"> 
</span><span class="cx">     // EventTarget
</span><span class="cx">     EventTargetInterface eventTargetInterface() const final { return AudioContextEventTargetInterfaceType; }
</span><del>-    ScriptExecutionContext* scriptExecutionContext() const final;
</del><span class="cx"> 
</span><span class="cx">     // Reconcile ref/deref which are defined both in ThreadSafeRefCounted and EventTarget.
</span><span class="cx">     using ThreadSafeRefCounted::ref;
</span><span class="lines">@@ -284,6 +286,11 @@
</span><span class="cx">     const void* nextAudioParameterLogIdentifier() { return childLogIdentifier(++m_nextAudioParameterIdentifier); }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    void postTask(WTF::Function<void()>&&);
+    bool isStopped() const { return m_isStopScheduled; }
+    const SecurityOrigin* origin() const;
+    void addConsoleMessage(MessageSource, MessageLevel, const String& message);
+
</ins><span class="cx"> protected:
</span><span class="cx">     explicit AudioContext(Document&);
</span><span class="cx">     AudioContext(Document&, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate);
</span><span class="lines">@@ -310,6 +317,9 @@
</span><span class="cx"> 
</span><span class="cx">     void mediaCanStart(Document&) override;
</span><span class="cx"> 
</span><ins>+    // EventTarget
+    ScriptExecutionContext* scriptExecutionContext() const final;
+
</ins><span class="cx">     // MediaProducer
</span><span class="cx">     MediaProducer::MediaStateFlags mediaState() const override;
</span><span class="cx">     void pageMutedStateDidChange() override;
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioNode.cpp (244898 => 244899)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioNode.cpp      2019-05-03 01:19:03 UTC (rev 244898)
+++ trunk/Source/WebCore/Modules/webaudio/AudioNode.cpp 2019-05-03 04:28:13 UTC (rev 244899)
</span><span class="lines">@@ -359,7 +359,7 @@
</span><span class="cx"> 
</span><span class="cx"> ScriptExecutionContext* AudioNode::scriptExecutionContext() const
</span><span class="cx"> {
</span><del>-    return const_cast<AudioNode*>(this)->context().scriptExecutionContext();
</del><ins>+    return static_cast<ActiveDOMObject&>(const_cast<AudioNode*>(this)->context()).scriptExecutionContext();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AudioNode::processIfNecessary(size_t framesToProcess)
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioNode.h (244898 => 244899)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioNode.h        2019-05-03 01:19:03 UTC (rev 244898)
+++ trunk/Source/WebCore/Modules/webaudio/AudioNode.h   2019-05-03 04:28:13 UTC (rev 244899)
</span><span class="lines">@@ -181,10 +181,6 @@
</span><span class="cx">     ChannelCountMode internalChannelCountMode() const { return m_channelCountMode; }
</span><span class="cx">     AudioBus::ChannelInterpretation internalChannelInterpretation() const { return m_channelInterpretation; }
</span><span class="cx"> 
</span><del>-    // EventTarget
-    EventTargetInterface eventTargetInterface() const override;
-    ScriptExecutionContext* scriptExecutionContext() const final;
-
</del><span class="cx"> protected:
</span><span class="cx">     // Inputs and outputs must be created before the AudioNode is initialized.
</span><span class="cx">     void addInput(std::unique_ptr<AudioNodeInput>);
</span><span class="lines">@@ -206,6 +202,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    // EventTarget
+    EventTargetInterface eventTargetInterface() const override;
+    ScriptExecutionContext* scriptExecutionContext() const final;
+
</ins><span class="cx">     volatile bool m_isInitialized;
</span><span class="cx">     NodeType m_nodeType;
</span><span class="cx">     Ref<AudioContext> m_context;
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioScheduledSourceNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp (244898 => 244899)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp       2019-05-03 01:19:03 UTC (rev 244898)
+++ trunk/Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp  2019-05-03 04:28:13 UTC (rev 244899)
</span><span class="lines">@@ -177,15 +177,9 @@
</span><span class="cx">     if (!m_hasEndedListener)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    auto* scriptExecutionContext = this->scriptExecutionContext();
-    if (!scriptExecutionContext)
-        return;
-
-    scriptExecutionContext->postTask([this, protectedThis = makeRef(*this)] (auto&) {
-        // Make sure ActiveDOMObjects have not been stopped after scheduling this task.
-        if (!this->scriptExecutionContext())
</del><ins>+    context().postTask([this, protectedThis = makeRef(*this)] {
+        if (context().isStopped())
</ins><span class="cx">             return;
</span><del>-
</del><span class="cx">         this->dispatchEvent(Event::create(eventNames().endedEvent, Event::CanBubble::No, Event::IsCancelable::No));
</span><span class="cx">     });
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioDefaultAudioDestinationNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp (244898 => 244899)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp    2019-05-03 01:19:03 UTC (rev 244898)
+++ trunk/Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp       2019-05-03 04:28:13 UTC (rev 244899)
</span><span class="lines">@@ -118,8 +118,7 @@
</span><span class="cx">     ASSERT(isInitialized());
</span><span class="cx">     if (isInitialized())
</span><span class="cx">         m_destination->start();
</span><del>-    if (auto scriptExecutionContext = context().scriptExecutionContext())
-        scriptExecutionContext->postTask(WTFMove(function));
</del><ins>+    context().postTask(WTFMove(function));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DefaultAudioDestinationNode::suspend(Function<void ()>&& function)
</span><span class="lines">@@ -127,8 +126,7 @@
</span><span class="cx">     ASSERT(isInitialized());
</span><span class="cx">     if (isInitialized())
</span><span class="cx">         m_destination->stop();
</span><del>-    if (auto scriptExecutionContext = context().scriptExecutionContext())
-        scriptExecutionContext->postTask(WTFMove(function));
</del><ins>+    context().postTask(WTFMove(function));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DefaultAudioDestinationNode::close(Function<void()>&& function)
</span><span class="lines">@@ -135,8 +133,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isInitialized());
</span><span class="cx">     uninitialize();
</span><del>-    if (auto scriptExecutionContext = context().scriptExecutionContext())
-        scriptExecutionContext->postTask(WTFMove(function));
</del><ins>+    context().postTask(WTFMove(function));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned DefaultAudioDestinationNode::maxChannelCount() const
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioMediaElementAudioSourceNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.cpp (244898 => 244899)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.cpp    2019-05-03 01:19:03 UTC (rev 244898)
+++ trunk/Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.cpp       2019-05-03 04:28:13 UTC (rev 244899)
</span><span class="lines">@@ -113,10 +113,8 @@
</span><span class="cx">     if (m_mediaElement->didPassCORSAccessCheck())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (auto* scriptExecutionContext = context().scriptExecutionContext()) {
-        if (auto* origin = scriptExecutionContext->securityOrigin())
-            return m_mediaElement->wouldTaintOrigin(*origin);
-    }
</del><ins>+    if (auto* origin = context().origin())
+        return m_mediaElement->wouldTaintOrigin(*origin);
</ins><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioMediaStreamAudioDestinationNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioDestinationNode.cpp (244898 => 244899)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioDestinationNode.cpp        2019-05-03 01:19:03 UTC (rev 244898)
+++ trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioDestinationNode.cpp   2019-05-03 04:28:13 UTC (rev 244899)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "AudioContext.h"
</span><span class="cx"> #include "AudioNodeInput.h"
</span><ins>+#include "Document.h"
</ins><span class="cx"> #include "MediaStream.h"
</span><span class="cx"> #include "MediaStreamAudioSource.h"
</span><span class="cx"> #include <wtf/IsoMallocInlines.h>
</span><span class="lines">@@ -46,7 +47,7 @@
</span><span class="cx"> MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode(AudioContext& context, size_t numberOfChannels)
</span><span class="cx">     : AudioBasicInspectorNode(context, context.sampleRate(), numberOfChannels)
</span><span class="cx">     , m_source(MediaStreamAudioSource::create(context.sampleRate()))
</span><del>-    , m_stream(MediaStream::create(*context.scriptExecutionContext(), MediaStreamPrivate::create(m_source.copyRef())))
</del><ins>+    , m_stream(MediaStream::create(*context.document(), MediaStreamPrivate::create(m_source.copyRef())))
</ins><span class="cx"> {
</span><span class="cx">     setNodeType(NodeTypeMediaStreamAudioDestination);
</span><span class="cx">     initialize();
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioScriptProcessorNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp (244898 => 244899)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp    2019-05-03 01:19:03 UTC (rev 244898)
+++ trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp       2019-05-03 04:28:13 UTC (rev 244899)
</span><span class="lines">@@ -222,7 +222,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // Avoid firing the event if the document has already gone away.
</span><del>-    if (context().scriptExecutionContext()) {
</del><ins>+    if (!context().isStopped()) {
</ins><span class="cx">         // Let the audio thread know we've gotten to the point where it's OK for it to make another request.
</span><span class="cx">         m_isRequestOutstanding = false;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>