<!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>[178172] 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/178172">178172</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-01-09 09:16:15 -0800 (Fri, 09 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[MSE] Implement Append Window support.
https://bugs.webkit.org/show_bug.cgi?id=139861

Patch by Bartlomiej Gajda &lt;b.gajda@samsung.com&gt; on 2015-01-09
Reviewed by Jer Noble.

Source/WebCore:

Implement Append Windows support for SourceBuffer as per spec.
Also change order in idl to match spec order.

Test: media/media-source/media-source-append-buffer-with-append-window.html

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::SourceBuffer):
(WebCore::SourceBuffer::appendWindowStart):
(WebCore::SourceBuffer::setAppendWindowStart):
(WebCore::SourceBuffer::appendWindowEnd):
(WebCore::SourceBuffer::setAppendWindowEnd):
(WebCore::SourceBuffer::abort):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBuffer.idl:

LayoutTests:

Added test which checks whether correct samples from contiguous range of samples are added
when manipulating appendWindow.

* media/media-source/media-source-append-buffer-with-append-window-expected.txt: Added.
* media/media-source/media-source-append-buffer-with-append-window.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="#trunkSourceWebCoreModulesmediasourceSourceBufferidl">trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmediamediasourcemediasourceappendbufferwithappendwindowexpectedtxt">trunk/LayoutTests/media/media-source/media-source-append-buffer-with-append-window-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediamediasourcemediasourceappendbufferwithappendwindowhtml">trunk/LayoutTests/media/media-source/media-source-append-buffer-with-append-window.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (178171 => 178172)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-01-09 15:29:09 UTC (rev 178171)
+++ trunk/LayoutTests/ChangeLog        2015-01-09 17:16:15 UTC (rev 178172)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-01-09  Bartlomiej Gajda  &lt;b.gajda@samsung.com&gt;
+
+        [MSE] Implement Append Window support.
+        https://bugs.webkit.org/show_bug.cgi?id=139861
+
+        Reviewed by Jer Noble.
+
+        Added test which checks whether correct samples from contiguous range of samples are added
+        when manipulating appendWindow.
+
+        * media/media-source/media-source-append-buffer-with-append-window-expected.txt: Added.
+        * media/media-source/media-source-append-buffer-with-append-window.html: Added.
+
</ins><span class="cx"> 2015-01-08  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         ASSERTION FAILED: !valueWithCalculation.calculation() in WebCore::CSSParser::validateCalculationUnit
</span></span></pre></div>
<a id="trunkLayoutTestsmediamediasourcemediasourceappendbufferwithappendwindowexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/media-source/media-source-append-buffer-with-append-window-expected.txt (0 => 178172)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/media-source/media-source-append-buffer-with-append-window-expected.txt                                (rev 0)
+++ trunk/LayoutTests/media/media-source/media-source-append-buffer-with-append-window-expected.txt        2015-01-09 17:16:15 UTC (rev 178172)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+
+RUN(video.src = URL.createObjectURL(source))
+EVENT(sourceopen)
+RUN(sourceBuffer = source.addSourceBuffer(&quot;video/mock; codecs=mock&quot;))
+EXPECTED (sourceBuffer.appendWindowStart == '0') OK
+EXPECTED (sourceBuffer.appendWindowEnd == 'Infinity') OK
+RUN(sourceBuffer.appendWindowEnd = 7.5)
+RUN(sourceBuffer.appendWindowStart = 3.5)
+RUN(sourceBuffer.appendBuffer(mediaSegment))
+EVENT(updateend)
+EXPECTED (sourceBuffer.buffered.start(0) == '4') OK
+EXPECTED (sourceBuffer.buffered.end(0) &lt; '7.5') OK
+RUN(sourceBuffer.appendWindowStart = 0)
+RUN(sourceBuffer.appendBuffer(mediaSegment))
+EVENT(updateend)
+EXPECTED (sourceBuffer.buffered.length == '1') OK
+EXPECTED (sourceBuffer.buffered.start(0) == '0') OK
+EXPECTED (sourceBuffer.buffered.end(0) &lt; '7.5') OK
+RUN(sourceBuffer.appendWindowEnd = 14.5)
+RUN(sourceBuffer.appendWindowStart = 11)
+RUN(sourceBuffer.appendBuffer(mediaSegment))
+EVENT(updateend)
+EXPECTED (sourceBuffer.buffered.length == '2') OK
+EXPECTED (sourceBuffer.buffered.start(1) == '12') OK
+EXPECTED (sourceBuffer.buffered.end(1) &lt; '14.5') OK
+END OF TEST
+
</ins></span></pre></div>
<a id="trunkLayoutTestsmediamediasourcemediasourceappendbufferwithappendwindowhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/media-source/media-source-append-buffer-with-append-window.html (0 => 178172)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/media-source/media-source-append-buffer-with-append-window.html                                (rev 0)
+++ trunk/LayoutTests/media/media-source/media-source-append-buffer-with-append-window.html        2015-01-09 17:16:15 UTC (rev 178172)
</span><span class="lines">@@ -0,0 +1,91 @@
</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 mediaSegment;
+
+    if (window.internals)
+        internals.initializeMockMediaSource();
+
+    function runTest() {
+        findMediaElement();
+
+        mediaSegment = concatenateSamples([
+            makeAInit(0, [makeATrack(1, 'mock', TRACK_KIND.VIDEO)])
+            , makeASample(0,  0,  1, 1, SAMPLE_FLAG.SYNC, 0)
+            , makeASample(1,  1,  1, 1, SAMPLE_FLAG.NONE, 0)
+            , makeASample(2,  2,  1, 1, SAMPLE_FLAG.NONE, 0)
+            , makeASample(3,  3,  1, 1, SAMPLE_FLAG.NONE, 0)
+            , makeASample(4,  4,  1, 1, SAMPLE_FLAG.SYNC, 0)
+            , makeASample(5,  5,  1, 1, SAMPLE_FLAG.NONE, 0)
+            , makeASample(6,  6,  1, 1, SAMPLE_FLAG.NONE, 0)
+            , makeASample(7,  7,  1, 1, SAMPLE_FLAG.NONE, 0)
+            , makeASample(8,  8,  1, 1, SAMPLE_FLAG.SYNC, 0)
+            , makeASample(9,  9,  1, 1, SAMPLE_FLAG.NONE, 0)
+            , makeASample(10, 10, 1, 1, SAMPLE_FLAG.NONE, 0)
+            , makeASample(11, 11, 1, 1, SAMPLE_FLAG.NONE, 0)
+            , makeASample(12, 12, 1, 1, SAMPLE_FLAG.SYNC, 0)
+            , makeASample(13, 13, 1, 1, SAMPLE_FLAG.NONE, 0)
+            , makeASample(14, 14, 1, 1, SAMPLE_FLAG.NONE, 0)
+            , makeASample(15, 15, 1, 1, SAMPLE_FLAG.NONE, 0)
+        ]);
+
+        source = new MediaSource();
+        waitForEventOn(source, 'sourceopen', sourceOpen, false, true);
+        run('video.src = URL.createObjectURL(source)');
+    }
+
+    function sourceOpen() {
+        run('sourceBuffer = source.addSourceBuffer(&quot;video/mock; codecs=mock&quot;)');
+
+        testExpected('sourceBuffer.appendWindowStart', 0);
+        testExpected('sourceBuffer.appendWindowEnd', Number.POSITIVE_INFINITY);
+
+
+        run('sourceBuffer.appendWindowEnd   = 7.5');
+        run('sourceBuffer.appendWindowStart = 3.5');
+
+        waitForEventOn(sourceBuffer, 'updateend', updateEnd1, false, true);
+        run('sourceBuffer.appendBuffer(mediaSegment)');
+    }
+
+    function updateEnd1() {
+        testExpected('sourceBuffer.buffered.start(0)', 4);
+        testExpected('sourceBuffer.buffered.end(0)'  , 7.5, &quot;&lt;&quot;); // because of microsecond added to buffered we don't use equality here
+        run('sourceBuffer.appendWindowStart = 0');
+
+        waitForEventOn(sourceBuffer, 'updateend', updateEnd2, false, true);
+        run('sourceBuffer.appendBuffer(mediaSegment)');
+    }
+
+    function updateEnd2() {
+        testExpected('sourceBuffer.buffered.length', 1);
+        testExpected('sourceBuffer.buffered.start(0)', 0);
+        testExpected('sourceBuffer.buffered.end(0)'  , 7.5, &quot;&lt;&quot;);
+
+        run('sourceBuffer.appendWindowEnd   = 14.5');
+        run('sourceBuffer.appendWindowStart = 11');
+
+        waitForEventOn(sourceBuffer, 'updateend', updateEnd3, false, true);
+        run('sourceBuffer.appendBuffer(mediaSegment)');
+    }
+
+    function updateEnd3() {
+        testExpected('sourceBuffer.buffered.length', 2);
+        testExpected('sourceBuffer.buffered.start(1)', 12);
+        testExpected('sourceBuffer.buffered.end(1)'  , 14.5, &quot;&lt;&quot;);
+        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 (178171 => 178172)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-09 15:29:09 UTC (rev 178171)
+++ trunk/Source/WebCore/ChangeLog        2015-01-09 17:16:15 UTC (rev 178172)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2015-01-09  Bartlomiej Gajda  &lt;b.gajda@samsung.com&gt;
+
+        [MSE] Implement Append Window support.
+        https://bugs.webkit.org/show_bug.cgi?id=139861
+
+        Reviewed by Jer Noble.
+
+        Implement Append Windows support for SourceBuffer as per spec.
+        Also change order in idl to match spec order.
+
+        Test: media/media-source/media-source-append-buffer-with-append-window.html
+
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::SourceBuffer::SourceBuffer):
+        (WebCore::SourceBuffer::appendWindowStart):
+        (WebCore::SourceBuffer::setAppendWindowStart):
+        (WebCore::SourceBuffer::appendWindowEnd):
+        (WebCore::SourceBuffer::setAppendWindowEnd):
+        (WebCore::SourceBuffer::abort):
+        (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
+        * Modules/mediasource/SourceBuffer.h:
+        * Modules/mediasource/SourceBuffer.idl:
+
</ins><span class="cx"> 2015-01-09  Chris Fleizach  &lt;cfleizach@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: Crash at -[WebAccessibilityObjectWrapperBase accessibilityTitle] + 31
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (178171 => 178172)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2015-01-09 15:29:09 UTC (rev 178171)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2015-01-09 17:16:15 UTC (rev 178172)
</span><span class="lines">@@ -123,6 +123,8 @@
</span><span class="cx">     , m_asyncEventQueue(*this)
</span><span class="cx">     , m_mode(segmentsKeyword())
</span><span class="cx">     , m_appendBufferTimer(*this, &amp;SourceBuffer::appendBufferTimerFired)
</span><ins>+    , m_appendWindowStart(MediaTime::zeroTime())
+    , m_appendWindowEnd(MediaTime::positiveInfiniteTime())
</ins><span class="cx">     , m_groupStartTimestamp(MediaTime::invalidTime())
</span><span class="cx">     , m_groupEndTimestamp(MediaTime::zeroTime())
</span><span class="cx">     , m_buffered(TimeRanges::create())
</span><span class="lines">@@ -211,6 +213,64 @@
</span><span class="cx">     m_timestampOffset = newTimestampOffset;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+double SourceBuffer::appendWindowStart() const
+{
+    return m_appendWindowStart.toDouble();
+};
+
+void SourceBuffer::setAppendWindowStart(double newValue, ExceptionCode&amp; ec)
+{
+    // Section 3.1 appendWindowStart attribute setter steps.
+    // http://www.w3.org/TR/media-source/#widl-SourceBuffer-appendWindowStart
+    // 1. If this object has been removed from the sourceBuffers attribute of the parent media source,
+    //    then throw an INVALID_STATE_ERR exception and abort these steps.
+    // 2. If the updating attribute equals true, then throw an INVALID_STATE_ERR exception and abort these steps.
+    if (isRemoved() || m_updating) {
+        ec = INVALID_STATE_ERR;
+        return;
+    }
+
+    // 3. If the new value is less than 0 or greater than or equal to appendWindowEnd then
+    //    throw an INVALID_ACCESS_ERR exception and abort these steps.
+    if (newValue &lt; 0 || newValue &gt;= m_appendWindowEnd.toDouble()) {
+        ec = INVALID_ACCESS_ERR;
+        return;
+    }
+
+    // 4. Update the attribute to the new value.
+    m_appendWindowStart = MediaTime::createWithDouble(newValue);
+}
+
+double SourceBuffer::appendWindowEnd() const
+{
+    return m_appendWindowEnd.toDouble();
+};
+
+void SourceBuffer::setAppendWindowEnd(double newValue, ExceptionCode&amp; ec)
+{
+    // Section 3.1 appendWindowEnd attribute setter steps.
+    // http://www.w3.org/TR/media-source/#widl-SourceBuffer-appendWindowEnd
+    // 1. If this object has been removed from the sourceBuffers attribute of the parent media source,
+    //    then throw an INVALID_STATE_ERR exception and abort these steps.
+    // 2. If the updating attribute equals true, then throw an INVALID_STATE_ERR exception and abort these steps.
+    if (isRemoved() || m_updating) {
+        ec = INVALID_STATE_ERR;
+        return;
+    }
+
+    // 3. If the new value equals NaN, then throw an INVALID_ACCESS_ERR and abort these steps.
+    // 4. If the new value is less than or equal to appendWindowStart then throw an INVALID_ACCESS_ERR exception
+    //    and abort these steps.
+    if (std::isnan(newValue) || newValue &lt;= m_appendWindowStart.toDouble()) {
+        ec = INVALID_ACCESS_ERR;
+        return;
+    }
+
+    // 5.. Update the attribute to the new value.
+    m_appendWindowEnd = MediaTime::createWithDouble(newValue);
+}
+
+
</ins><span class="cx"> void SourceBuffer::appendBuffer(PassRefPtr&lt;ArrayBuffer&gt; data, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     // Section 3.2 appendBuffer()
</span><span class="lines">@@ -283,7 +343,11 @@
</span><span class="cx">     // 4. Run the reset parser state algorithm.
</span><span class="cx">     resetParserState();
</span><span class="cx"> 
</span><del>-    // FIXME(229408) Add steps 5-6 update appendWindowStart &amp; appendWindowEnd.
</del><ins>+    // 5. Set appendWindowStart to the presentation start time.
+    m_appendWindowStart = MediaTime::zeroTime();
+
+    // 6. Set appendWindowEnd to positive Infinity.
+    m_appendWindowEnd = MediaTime::positiveInfiniteTime();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SourceBuffer::remove(double start, double end, ExceptionCode&amp; ec)
</span><span class="lines">@@ -1324,8 +1388,13 @@
</span><span class="cx">         // 1.9 If frame end timestamp is greater than appendWindowEnd, then set the need random access
</span><span class="cx">         // point flag to true, drop the coded frame, and jump to the top of the loop to start processing
</span><span class="cx">         // the next coded frame.
</span><del>-        // FIXME: implement append windows
</del><ins>+        if (presentationTimestamp &lt; m_appendWindowStart || frameEndTimestamp &gt; m_appendWindowEnd) {
+            trackBuffer.needRandomAccessFlag = true;
+            didDropSample();
+            return;
+        }
</ins><span class="cx"> 
</span><ins>+
</ins><span class="cx">         // 1.10 If the decode timestamp is less than the presentation start time, then run the end of stream
</span><span class="cx">         // algorithm with the error parameter set to &quot;decode&quot;, and abort these steps.
</span><span class="cx">         // NOTE: Until &lt;https://www.w3.org/Bugs/Public/show_bug.cgi?id=27487&gt; is resolved, we will only check
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h (178171 => 178172)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h        2015-01-09 15:29:09 UTC (rev 178171)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h        2015-01-09 17:16:15 UTC (rev 178172)
</span><span class="lines">@@ -74,6 +74,18 @@
</span><span class="cx">     const RefPtr&lt;TimeRanges&gt;&amp; buffered() const;
</span><span class="cx">     double timestampOffset() const;
</span><span class="cx">     void setTimestampOffset(double, ExceptionCode&amp;);
</span><ins>+
+#if ENABLE(VIDEO_TRACK)
+    VideoTrackList* videoTracks();
+    AudioTrackList* audioTracks();
+    TextTrackList* textTracks();
+#endif
+
+    double appendWindowStart() const;
+    void setAppendWindowStart(double, ExceptionCode&amp;);
+    double appendWindowEnd() const;
+    void setAppendWindowEnd(double, ExceptionCode&amp;);
+
</ins><span class="cx">     void appendBuffer(PassRefPtr&lt;ArrayBuffer&gt; data, ExceptionCode&amp;);
</span><span class="cx">     void appendBuffer(PassRefPtr&lt;ArrayBufferView&gt; data, ExceptionCode&amp;);
</span><span class="cx">     void abort(ExceptionCode&amp;);
</span><span class="lines">@@ -84,12 +96,6 @@
</span><span class="cx">     void removedFromMediaSource();
</span><span class="cx">     void seekToTime(const MediaTime&amp;);
</span><span class="cx"> 
</span><del>-#if ENABLE(VIDEO_TRACK)
-    VideoTrackList* videoTracks();
-    AudioTrackList* audioTracks();
-    TextTrackList* textTracks();
-#endif
-
</del><span class="cx">     bool hasCurrentTime() const;
</span><span class="cx">     bool hasFutureTime() const;
</span><span class="cx">     bool canPlayThrough();
</span><span class="lines">@@ -204,6 +210,9 @@
</span><span class="cx">     Vector&lt;AtomicString&gt; m_textCodecs;
</span><span class="cx"> 
</span><span class="cx">     MediaTime m_timestampOffset;
</span><ins>+    MediaTime m_appendWindowStart;
+    MediaTime m_appendWindowEnd;
+
</ins><span class="cx">     MediaTime m_groupStartTimestamp;
</span><span class="cx">     MediaTime m_groupEndTimestamp;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBufferidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl (178171 => 178172)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl        2015-01-09 15:29:09 UTC (rev 178171)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl        2015-01-09 17:16:15 UTC (rev 178172)
</span><span class="lines">@@ -52,6 +52,14 @@
</span><span class="cx">     // Applies an offset to media segment timestamps.
</span><span class="cx">     [SetterRaisesException] attribute unrestricted double timestampOffset;
</span><span class="cx"> 
</span><ins>+    // Track support
+    [Conditional=VIDEO_TRACK] readonly attribute AudioTrackList audioTracks;
+    [Conditional=VIDEO_TRACK] readonly attribute VideoTrackList videoTracks;
+    [Conditional=VIDEO_TRACK] readonly attribute TextTrackList textTracks;
+
+    [SetterRaisesException] attribute unrestricted double appendWindowStart;
+    [SetterRaisesException] attribute unrestricted double appendWindowEnd;
+
</ins><span class="cx">     // Append segment data.
</span><span class="cx">     [RaisesException] void appendBuffer(ArrayBuffer data);
</span><span class="cx">     [RaisesException] void appendBuffer(ArrayBufferView data);
</span><span class="lines">@@ -59,10 +67,5 @@
</span><span class="cx">     // Abort the current segment append sequence.
</span><span class="cx">     [RaisesException] void abort();
</span><span class="cx">     [RaisesException] void remove(unrestricted double start, unrestricted double end);
</span><del>-    
-    // Track support
-    [Conditional=VIDEO_TRACK] readonly attribute AudioTrackList audioTracks;
-    [Conditional=VIDEO_TRACK] readonly attribute VideoTrackList videoTracks;
-    [Conditional=VIDEO_TRACK] readonly attribute TextTrackList textTracks;
</del><span class="cx"> };
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>