<!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>[206300] 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/206300">206300</a></dd>
<dt>Author</dt> <dd>jer.noble@apple.com</dd>
<dt>Date</dt> <dd>2016-09-23 08:28:42 -0700 (Fri, 23 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION (206001): Scrubbed video on Youtube stops playing
https://bugs.webkit.org/show_bug.cgi?id=162481
&lt;rdar://problem/28436707&gt;

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/media-source/media-source-seek-back.html

When re-enqueing samples after a seek, modified the algorithm for finding the first sample
to re-enqueue. Instead of finding a sample which contained the requested presentation time,
we searched for the first sample on-or-after the presentation time. This meant that if the
last buffered sample in that range started before the seek time, and ended after, it would
get skipped during re-enquing, and a far, far future sample would be enqueued instead. Now
revert to the old behavior (find the sample containing the requested time), and only adopt
the new behavior (find the next sample on-or-after the requested time) if the first failed.
In addition, bail out if the second check resulted in a sample whose presentation time was
greater than a &quot;fudge factor&quot; away from the requested time.

To test this behavior, add a new method onto Internals that returns a list of the enqueued
samples from a SourceBuffer.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::reenqueueMediaForTime):
(WebCore::SourceBuffer::enqueuedSamplesForTrackID):
* Modules/mediasource/SourceBuffer.h:
* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::seekToTime):
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::enqueuedSamplesForTrackID):
(WebCore::MockSourceBufferPrivate::enqueueSample):
* platform/mock/mediasource/MockSourceBufferPrivate.h:
* testing/Internals.cpp:
(WebCore::Internals::enqueuedSamplesForTrackID):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* media/media-source/media-source-seek-back-expected.txt: Added.
* media/media-source/media-source-seek-back.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceSourceBuffercpp">trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceSourceBufferh">trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockMediaSourcePrivatecpp">trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockSourceBufferPrivatecpp">trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockSourceBufferPrivateh">trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmediamediasourcemediasourceseekbackexpectedtxt">trunk/LayoutTests/media/media-source/media-source-seek-back-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediamediasourcemediasourceseekbackhtml">trunk/LayoutTests/media/media-source/media-source-seek-back.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (206299 => 206300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-09-23 14:16:57 UTC (rev 206299)
+++ trunk/LayoutTests/ChangeLog        2016-09-23 15:28:42 UTC (rev 206300)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-09-23  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        REGRESSION (206001): Scrubbed video on Youtube stops playing
+        https://bugs.webkit.org/show_bug.cgi?id=162481
+        &lt;rdar://problem/28436707&gt;
+
+        Reviewed by Eric Carlson.
+
+        * media/media-source/media-source-seek-back-expected.txt: Added.
+        * media/media-source/media-source-seek-back.html: Added.
+
</ins><span class="cx"> 2016-09-23  Per Arne Vollan  &lt;pvollan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Skip failing html/syntax web platform test on Windows.
</span></span></pre></div>
<a id="trunkLayoutTestsmediamediasourcemediasourceseekbackexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/media-source/media-source-seek-back-expected.txt (0 => 206300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/media-source/media-source-seek-back-expected.txt                                (rev 0)
+++ trunk/LayoutTests/media/media-source/media-source-seek-back-expected.txt        2016-09-23 15:28:42 UTC (rev 206300)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+
+EVENT(sourceopen)
+RUN(sourceBuffer = source.addSourceBuffer(&quot;video/mock; codecs=mock&quot;))
+RUN(sourceBuffer.appendBuffer(initSegment))
+EVENT(updateend)
+Append a sample from 10 -&gt; 11
+RUN(sourceBuffer.appendBuffer(samples))
+EVENT(updateend)
+RUN(video.currentTime = 0.5)
+EVENT(seeking)
+Append a sample from 0 -&gt; 1
+RUN(sourceBuffer.appendBuffer(samples))
+EVENT(seeked)
+EXPECTED (enqueuedSamples.length == '1') OK
+{PTS({0/1000, 0.000000}), DTS({0/1000, 0.000000}), duration({1000/1000, 1.000000}), flags(1), generation(0)}
+END OF TEST
+
</ins></span></pre></div>
<a id="trunkLayoutTestsmediamediasourcemediasourceseekbackhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/media-source/media-source-seek-back.html (0 => 206300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/media-source/media-source-seek-back.html                                (rev 0)
+++ trunk/LayoutTests/media/media-source/media-source-seek-back.html        2016-09-23 15:28:42 UTC (rev 206300)
</span><span class="lines">@@ -0,0 +1,74 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;title&gt;mock-media-source&lt;/title&gt;
+    &lt;script src=&quot;mock-media-source.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;../video-test.js&quot;&gt;&lt;/script&gt;
+    &lt;script&gt;
+    var source;
+    var sourceBuffer;
+    var initSegment;
+    var samples;
+
+    if (window.internals)
+        internals.initializeMockMediaSource();
+
+    function runTest()
+    {
+        findMediaElement();
+
+        source = new MediaSource();
+        waitForEventOn(source, 'sourceopen', sourceOpen);
+        var videoSource = document.createElement('source');
+        videoSource.type = 'video/mock; codecs=mock';
+        videoSource.src = URL.createObjectURL(source);
+        video.appendChild(videoSource);
+    }
+
+    function sourceOpen()
+    {
+        run('sourceBuffer = source.addSourceBuffer(&quot;video/mock; codecs=mock&quot;)');
+        waitForEventOn(sourceBuffer, 'updateend', loadSamples, false, true);
+        initSegment = makeAInit(8, [makeATrack(1, 'mock', TRACK_KIND.VIDEO)]);
+        run('sourceBuffer.appendBuffer(initSegment)');
+    }
+
+    function loadSamples()
+    {
+        samples = concatenateSamples([
+            makeASample(10, 10, 1, 1, SAMPLE_FLAG.SYNC),
+        ]);
+        consoleWrite('Append a sample from 10 -&gt; 11')
+        waitForEventOn(sourceBuffer, 'updateend', seek, false, true);
+        run('sourceBuffer.appendBuffer(samples)');
+    }
+
+    function seek()
+    {
+        waitForEvent('seeking', seeking);
+        run('video.currentTime = 0.5');
+    }
+
+    function seeking()
+    {
+        samples = concatenateSamples([
+            makeASample(0, 0, 1, 1, SAMPLE_FLAG.SYNC),
+        ]);
+        consoleWrite('Append a sample from 0 -&gt; 1')
+        waitForEvent('seeked', seeked);
+        run('sourceBuffer.appendBuffer(samples)');
+    }
+
+    function seeked()
+    {
+        enqueuedSamples = internals.enqueuedSamplesForTrackID(sourceBuffer, 1);
+        testExpected(&quot;enqueuedSamples.length&quot;, 1);
+        enqueuedSamples.forEach(consoleWrite);
+        endTest();
+    }
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;video&gt;&lt;/video&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206299 => 206300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-09-23 14:16:57 UTC (rev 206299)
+++ trunk/Source/WebCore/ChangeLog        2016-09-23 15:28:42 UTC (rev 206300)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2016-09-23  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        REGRESSION (206001): Scrubbed video on Youtube stops playing
+        https://bugs.webkit.org/show_bug.cgi?id=162481
+        &lt;rdar://problem/28436707&gt;
+
+        Reviewed by Eric Carlson.
+
+        Test: media/media-source/media-source-seek-back.html
+
+        When re-enqueing samples after a seek, modified the algorithm for finding the first sample
+        to re-enqueue. Instead of finding a sample which contained the requested presentation time,
+        we searched for the first sample on-or-after the presentation time. This meant that if the
+        last buffered sample in that range started before the seek time, and ended after, it would
+        get skipped during re-enquing, and a far, far future sample would be enqueued instead. Now
+        revert to the old behavior (find the sample containing the requested time), and only adopt
+        the new behavior (find the next sample on-or-after the requested time) if the first failed.
+        In addition, bail out if the second check resulted in a sample whose presentation time was
+        greater than a &quot;fudge factor&quot; away from the requested time.
+
+        To test this behavior, add a new method onto Internals that returns a list of the enqueued
+        samples from a SourceBuffer.
+
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::SourceBuffer::reenqueueMediaForTime):
+        (WebCore::SourceBuffer::enqueuedSamplesForTrackID):
+        * Modules/mediasource/SourceBuffer.h:
+        * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
+        (WebCore::MockMediaSourcePrivate::seekToTime):
+        * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
+        (WebCore::MockSourceBufferPrivate::enqueuedSamplesForTrackID):
+        (WebCore::MockSourceBufferPrivate::enqueueSample):
+        * platform/mock/mediasource/MockSourceBufferPrivate.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::enqueuedSamplesForTrackID):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
</ins><span class="cx"> 2016-09-22  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Replace redundant prepareForDestruction() call with RELEASE_ASSERT in Document::removedLastRef.
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (206299 => 206300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2016-09-23 14:16:57 UTC (rev 206299)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2016-09-23 15:28:42 UTC (rev 206300)
</span><span class="lines">@@ -1856,9 +1856,13 @@
</span><span class="cx"> void SourceBuffer::reenqueueMediaForTime(TrackBuffer&amp; trackBuffer, AtomicString trackID, const MediaTime&amp; time)
</span><span class="cx"> {
</span><span class="cx">     // Find the sample which contains the current presentation time.
</span><del>-    auto currentSamplePTSIterator = trackBuffer.samples.presentationOrder().findSampleOnOrAfterPresentationTime(time);
</del><ins>+    auto currentSamplePTSIterator = trackBuffer.samples.presentationOrder().findSampleContainingPresentationTime(time);
</ins><span class="cx"> 
</span><del>-    if (currentSamplePTSIterator == trackBuffer.samples.presentationOrder().end()) {
</del><ins>+    if (currentSamplePTSIterator == trackBuffer.samples.presentationOrder().end())
+        currentSamplePTSIterator = trackBuffer.samples.presentationOrder().findSampleOnOrAfterPresentationTime(time);
+
+    if (currentSamplePTSIterator == trackBuffer.samples.presentationOrder().end()
+        || (currentSamplePTSIterator-&gt;first - time) &gt; MediaSource::currentTimeFudgeFactor()) {
</ins><span class="cx">         trackBuffer.decodeQueue.clear();
</span><span class="cx">         m_private-&gt;flushAndEnqueueNonDisplayingSamples(Vector&lt;RefPtr&lt;MediaSample&gt;&gt;(), trackID);
</span><span class="cx">         return;
</span><span class="lines">@@ -2028,6 +2032,11 @@
</span><span class="cx">     return sampleDescriptions;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Vector&lt;String&gt; SourceBuffer::enqueuedSamplesForTrackID(const AtomicString&amp; trackID)
+{
+    return m_private-&gt;enqueuedSamplesForTrackID(trackID);
+}
+
</ins><span class="cx"> Document&amp; SourceBuffer::document() const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(scriptExecutionContext());
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h (206299 => 206300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h        2016-09-23 14:16:57 UTC (rev 206299)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h        2016-09-23 15:28:42 UTC (rev 206300)
</span><span class="lines">@@ -195,6 +195,7 @@
</span><span class="cx">     // Internals
</span><span class="cx">     friend class Internals;
</span><span class="cx">     WEBCORE_EXPORT Vector&lt;String&gt; bufferedSamplesForTrackID(const AtomicString&amp;);
</span><ins>+    WEBCORE_EXPORT Vector&lt;String&gt; enqueuedSamplesForTrackID(const AtomicString&amp;);
</ins><span class="cx"> 
</span><span class="cx">     Ref&lt;SourceBufferPrivate&gt; m_private;
</span><span class="cx">     MediaSource* m_source;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockMediaSourcePrivatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp (206299 => 206300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp        2016-09-23 14:16:57 UTC (rev 206299)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp        2016-09-23 15:28:42 UTC (rev 206300)
</span><span class="lines">@@ -167,8 +167,7 @@
</span><span class="cx"> 
</span><span class="cx"> void MockMediaSourcePrivate::seekToTime(const MediaTime&amp; time)
</span><span class="cx"> {
</span><del>-    for (auto it = m_activeSourceBuffers.begin(), end = m_activeSourceBuffers.end(); it != end; ++it)
-        (*it)-&gt;seekToTime(time);
</del><ins>+    m_client-&gt;seekToTime(time);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> MediaTime MockMediaSourcePrivate::seekToTime(const MediaTime&amp; targetTime, const MediaTime&amp; negativeThreshold, const MediaTime&amp; positiveThreshold)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockSourceBufferPrivatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp (206299 => 206300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp        2016-09-23 14:16:57 UTC (rev 206299)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp        2016-09-23 15:28:42 UTC (rev 206300)
</span><span class="lines">@@ -225,8 +225,14 @@
</span><span class="cx">         m_mediaSource-&gt;sourceBufferPrivateDidChangeActiveState(this, isActive);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MockSourceBufferPrivate::enqueueSample(PassRefPtr&lt;MediaSample&gt; sample, AtomicString)
</del><ins>+Vector&lt;String&gt; MockSourceBufferPrivate::enqueuedSamplesForTrackID(AtomicString)
</ins><span class="cx"> {
</span><ins>+    return m_enqueuedSamples;
+}
+
+void MockSourceBufferPrivate::enqueueSample(PassRefPtr&lt;MediaSample&gt; prpSample, AtomicString)
+{
+    RefPtr&lt;MediaSample&gt; sample = prpSample;
</ins><span class="cx">     if (!m_mediaSource || !sample)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -245,6 +251,8 @@
</span><span class="cx">         m_mediaSource-&gt;incrementDroppedFrames();
</span><span class="cx">     if (box-&gt;isDelayed())
</span><span class="cx">         m_mediaSource-&gt;incrementTotalFrameDelayBy(MediaTime(1, 1));
</span><ins>+
+    m_enqueuedSamples.append(toString(sample));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MockSourceBufferPrivate::hasVideo() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockSourceBufferPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h (206299 => 206300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h        2016-09-23 14:16:57 UTC (rev 206299)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h        2016-09-23 15:28:42 UTC (rev 206300)
</span><span class="lines">@@ -67,16 +67,19 @@
</span><span class="cx">     MediaPlayer::ReadyState readyState() const override;
</span><span class="cx">     void setReadyState(MediaPlayer::ReadyState) override;
</span><span class="cx"> 
</span><del>-    void flushAndEnqueueNonDisplayingSamples(Vector&lt;RefPtr&lt;MediaSample&gt;&gt;, AtomicString) override { }
</del><ins>+    void flushAndEnqueueNonDisplayingSamples(Vector&lt;RefPtr&lt;MediaSample&gt;&gt;, AtomicString) override { m_enqueuedSamples.clear(); }
</ins><span class="cx">     void enqueueSample(PassRefPtr&lt;MediaSample&gt;, AtomicString) override;
</span><span class="cx">     bool isReadyForMoreSamples(AtomicString) override { return true; }
</span><span class="cx">     void setActive(bool) override;
</span><span class="cx"> 
</span><ins>+    Vector&lt;String&gt; enqueuedSamplesForTrackID(AtomicString) override;
+
</ins><span class="cx">     void didReceiveInitializationSegment(const MockInitializationBox&amp;);
</span><span class="cx">     void didReceiveSample(const MockSampleBox&amp;);
</span><span class="cx"> 
</span><span class="cx">     MockMediaSourcePrivate* m_mediaSource;
</span><span class="cx">     SourceBufferPrivateClient* m_client;
</span><ins>+    Vector&lt;String&gt; m_enqueuedSamples;
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;char&gt; m_inputBuffer;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (206299 => 206300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2016-09-23 14:16:57 UTC (rev 206299)
+++ trunk/Source/WebCore/testing/Internals.cpp        2016-09-23 15:28:42 UTC (rev 206300)
</span><span class="lines">@@ -2764,6 +2764,11 @@
</span><span class="cx">     return buffer.bufferedSamplesForTrackID(trackID);
</span><span class="cx"> }
</span><span class="cx">     
</span><ins>+Vector&lt;String&gt; Internals::enqueuedSamplesForTrackID(SourceBuffer&amp; buffer, const AtomicString&amp; trackID)
+{
+    return buffer.enqueuedSamplesForTrackID(trackID);
+}
+
</ins><span class="cx"> void Internals::setShouldGenerateTimestamps(SourceBuffer&amp; buffer, bool flag)
</span><span class="cx"> {
</span><span class="cx">     buffer.setShouldGenerateTimestamps(flag);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (206299 => 206300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2016-09-23 14:16:57 UTC (rev 206299)
+++ trunk/Source/WebCore/testing/Internals.h        2016-09-23 15:28:42 UTC (rev 206300)
</span><span class="lines">@@ -401,6 +401,7 @@
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><span class="cx">     WEBCORE_TESTSUPPORT_EXPORT void initializeMockMediaSource();
</span><span class="cx">     Vector&lt;String&gt; bufferedSamplesForTrackID(SourceBuffer&amp;, const AtomicString&amp;);
</span><ins>+    Vector&lt;String&gt; enqueuedSamplesForTrackID(SourceBuffer&amp;, const AtomicString&amp;);
</ins><span class="cx">     void setShouldGenerateTimestamps(SourceBuffer&amp;, bool);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (206299 => 206300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2016-09-23 14:16:57 UTC (rev 206299)
+++ trunk/Source/WebCore/testing/Internals.idl        2016-09-23 15:28:42 UTC (rev 206300)
</span><span class="lines">@@ -392,6 +392,7 @@
</span><span class="cx"> 
</span><span class="cx">     [Conditional=MEDIA_SOURCE] void initializeMockMediaSource();
</span><span class="cx">     [Conditional=MEDIA_SOURCE] sequence&lt;DOMString&gt; bufferedSamplesForTrackID(SourceBuffer buffer, DOMString trackID);
</span><ins>+    [Conditional=MEDIA_SOURCE] sequence&lt;DOMString&gt; enqueuedSamplesForTrackID(SourceBuffer buffer, DOMString trackID);
</ins><span class="cx">     [Conditional=MEDIA_SOURCE] void setShouldGenerateTimestamps(SourceBuffer buffer, boolean flag);
</span><span class="cx"> 
</span><span class="cx">     [Conditional=VIDEO, RaisesException] void beginMediaSessionInterruption(DOMString interruptionType);
</span></span></pre>
</div>
</div>

</body>
</html>