<!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>[200198] 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/200198">200198</a></dd>
<dt>Author</dt> <dd>youenn.fablet@crf.canon.fr</dd>
<dt>Date</dt> <dd>2016-04-28 10:36:33 -0700 (Thu, 28 Apr 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Drop [UsePointersEvenForNonNullableObjectArguments] from MediaSource interfaces
https://bugs.webkit.org/show_bug.cgi?id=156904
Reviewed by Darin Adler.
Source/WebCore:
MediaSource::addSourceBuffer will now throw a TypeError if a null parameter is passed.
MediaSource::removeSourceBuffer will now throw a TypeError if a null parameter is passed.
SourceBuffer::appendBuffer will now throw a TypeError if a null parameter is passed.
Did some refactoring to use more references.
Covered by updated test.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::endOfStream):
(WebCore::MediaSource::addSourceBuffer):
(WebCore::MediaSource::removeSourceBuffer):
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/MediaSource.idl:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBuffer):
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBuffer.idl:
* Modules/mediasource/SourceBufferList.cpp:
(WebCore::SourceBufferList::add):
(WebCore::SourceBufferList::remove):
* Modules/mediasource/SourceBufferList.h:
LayoutTests:
* http/tests/media/media-source/mediasource-addsourcebuffer.html: Changing expected exception to TypeError.
* http/tests/media/media-source/mediasource-append-buffer-expected.txt:
* http/tests/media/media-source/mediasource-append-buffer.html: Checking passing null or undefined to
appendBuffer, addSourceBuffer and removeSourceBuffer.
* media/media-source/media-source-addsourcebuffer-expected.txt:
* media/media-source/media-source-addsourcebuffer.html: Removing redundant test.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestsmediamediasourcemediasourceaddsourcebufferhtml">trunk/LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer.html</a></li>
<li><a href="#trunkLayoutTestshttptestsmediamediasourcemediasourceappendbufferexpectedtxt">trunk/LayoutTests/http/tests/media/media-source/mediasource-append-buffer-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsmediamediasourcemediasourceappendbufferhtml">trunk/LayoutTests/http/tests/media/media-source/mediasource-append-buffer.html</a></li>
<li><a href="#trunkLayoutTestsmediamediasourcemediasourceaddsourcebufferexpectedtxt">trunk/LayoutTests/media/media-source/media-source-addsourcebuffer-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediamediasourcemediasourceaddsourcebufferhtml">trunk/LayoutTests/media/media-source/media-source-addsourcebuffer.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceMediaSourcecpp">trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceMediaSourceh">trunk/Source/WebCore/Modules/mediasource/MediaSource.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceMediaSourceidl">trunk/Source/WebCore/Modules/mediasource/MediaSource.idl</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>
<li><a href="#trunkSourceWebCoreModulesmediasourceSourceBufferListcpp">trunk/Source/WebCore/Modules/mediasource/SourceBufferList.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceSourceBufferListh">trunk/Source/WebCore/Modules/mediasource/SourceBufferList.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (200197 => 200198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-28 17:35:45 UTC (rev 200197)
+++ trunk/LayoutTests/ChangeLog        2016-04-28 17:36:33 UTC (rev 200198)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-04-28 Youenn Fablet <youenn.fablet@crf.canon.fr>
+
+ Drop [UsePointersEvenForNonNullableObjectArguments] from MediaSource interfaces
+ https://bugs.webkit.org/show_bug.cgi?id=156904
+
+ Reviewed by Darin Adler.
+
+ * http/tests/media/media-source/mediasource-addsourcebuffer.html: Changing expected exception to TypeError.
+ * http/tests/media/media-source/mediasource-append-buffer-expected.txt:
+ * http/tests/media/media-source/mediasource-append-buffer.html: Checking passing null or undefined to
+ appendBuffer, addSourceBuffer and removeSourceBuffer.
+ * media/media-source/media-source-addsourcebuffer-expected.txt:
+ * media/media-source/media-source-addsourcebuffer.html: Removing redundant test.
+
+
</ins><span class="cx"> 2016-04-27 Ada Chan <adachan@apple.com>
</span><span class="cx">
</span><span class="cx"> Set overflow: hidden on ::-webkit-media-controls in mediaControlsApple.css
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsmediamediasourcemediasourceaddsourcebufferhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer.html (200197 => 200198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer.html        2016-04-28 17:35:45 UTC (rev 200197)
+++ trunk/LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer.html        2016-04-28 17:36:33 UTC (rev 200198)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx"> <script>
</span><span class="cx"> mediasource_test(function(test, mediaElement, mediaSource)
</span><span class="cx"> {
</span><del>- assert_throws("InvalidAccessError",
</del><ins>+ assert_throws(new TypeError(),
</ins><span class="cx"> function() { mediaSource.addSourceBuffer(""); },
</span><span class="cx"> "addSourceBuffer() threw an exception when passed an empty string.");
</span><span class="cx"> test.done();
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsmediamediasourcemediasourceappendbufferexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/media/media-source/mediasource-append-buffer-expected.txt (200197 => 200198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/media/media-source/mediasource-append-buffer-expected.txt        2016-04-28 17:35:45 UTC (rev 200197)
+++ trunk/LayoutTests/http/tests/media/media-source/mediasource-append-buffer-expected.txt        2016-04-28 17:36:33 UTC (rev 200198)
</span><span class="lines">@@ -9,4 +9,5 @@
</span><span class="cx"> PASS Test set SourceBuffer.timestampOffset during a pending appendBuffer().
</span><span class="cx"> PASS Test appending an empty ArrayBufferView.
</span><span class="cx"> PASS Test appending an empty ArrayBuffer.
</span><ins>+PASS Test passing null or undefined to some MediaSource and SourceBuffer API methods.
</ins><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsmediamediasourcemediasourceappendbufferhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/media/media-source/mediasource-append-buffer.html (200197 => 200198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/media/media-source/mediasource-append-buffer.html        2016-04-28 17:35:45 UTC (rev 200197)
+++ trunk/LayoutTests/http/tests/media/media-source/mediasource-append-buffer.html        2016-04-28 17:36:33 UTC (rev 200198)
</span><span class="lines">@@ -245,6 +245,18 @@
</span><span class="cx"> });
</span><span class="cx"> }, "Test appending an empty ArrayBuffer.");
</span><span class="cx">
</span><ins>+ mediasource_test(function(test, mediaElement, mediaSource)
+ {
+ assert_throws(new TypeError(), function() { mediaSource.addSourceBuffer(MediaSourceUtil.VIDEO_ONLY_TYPE).appendBufer(null); });
+ assert_throws(new TypeError(), function() { mediaSource.addSourceBuffer(MediaSourceUtil.VIDEO_ONLY_TYPE).appendBufer(undefined); });
+ assert_throws(new TypeError(), function() { mediaSource.removeSourceBuffer(null); });
+ assert_throws(new TypeError(), function() { mediaSource.removeSourceBuffer(undefined); });
+ assert_throws(new TypeError(), function() { mediaSource.addSourceBuffer(null); });
+ assert_throws(new TypeError(), function() { mediaSource.addSourceBuffer(undefined); });
+
+ test.done();
+ }, "Test passing null or undefined to some MediaSource and SourceBuffer API methods.");
+
</ins><span class="cx"> </script>
</span><span class="cx"> </body>
</span><span class="cx"> </html>
</span></span></pre></div>
<a id="trunkLayoutTestsmediamediasourcemediasourceaddsourcebufferexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/media-source/media-source-addsourcebuffer-expected.txt (200197 => 200198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/media-source/media-source-addsourcebuffer-expected.txt        2016-04-28 17:35:45 UTC (rev 200197)
+++ trunk/LayoutTests/media/media-source/media-source-addsourcebuffer-expected.txt        2016-04-28 17:36:33 UTC (rev 200198)
</span><span class="lines">@@ -1,6 +1,5 @@
</span><span class="cx">
</span><span class="cx"> TEST(source.addSourceBuffer("invalid")) THROWS(DOMException.NOT_SUPPORTED_ERR) OK
</span><del>-TEST(source.addSourceBuffer("")) THROWS(DOMException.INVALID_ACCESS_ERR) OK
</del><span class="cx"> EXPECTED (MediaSource.isTypeSupported("invalid") == 'false') OK
</span><span class="cx"> EXPECTED (MediaSource.isTypeSupported("video/mock; codecs=mock") == 'true') OK
</span><span class="cx"> RUN(video.src = URL.createObjectURL(source))
</span></span></pre></div>
<a id="trunkLayoutTestsmediamediasourcemediasourceaddsourcebufferhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/media-source/media-source-addsourcebuffer.html (200197 => 200198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/media-source/media-source-addsourcebuffer.html        2016-04-28 17:35:45 UTC (rev 200197)
+++ trunk/LayoutTests/media/media-source/media-source-addsourcebuffer.html        2016-04-28 17:36:33 UTC (rev 200198)
</span><span class="lines">@@ -16,7 +16,6 @@
</span><span class="cx">
</span><span class="cx"> source = new MediaSource();
</span><span class="cx"> testDOMException('source.addSourceBuffer("invalid")', 'DOMException.NOT_SUPPORTED_ERR');
</span><del>- testDOMException('source.addSourceBuffer("")', 'DOMException.INVALID_ACCESS_ERR');
</del><span class="cx"> testExpected('MediaSource.isTypeSupported("invalid")', false);
</span><span class="cx"> testExpected('MediaSource.isTypeSupported("video/mock; codecs=mock")', true);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200197 => 200198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-28 17:35:45 UTC (rev 200197)
+++ trunk/Source/WebCore/ChangeLog        2016-04-28 17:36:33 UTC (rev 200198)
</span><span class="lines">@@ -1,5 +1,35 @@
</span><span class="cx"> 2016-04-28 Youenn Fablet <youenn.fablet@crf.canon.fr>
</span><span class="cx">
</span><ins>+ Drop [UsePointersEvenForNonNullableObjectArguments] from MediaSource interfaces
+ https://bugs.webkit.org/show_bug.cgi?id=156904
+
+ Reviewed by Darin Adler.
+
+ MediaSource::addSourceBuffer will now throw a TypeError if a null parameter is passed.
+ MediaSource::removeSourceBuffer will now throw a TypeError if a null parameter is passed.
+ SourceBuffer::appendBuffer will now throw a TypeError if a null parameter is passed.
+
+ Did some refactoring to use more references.
+
+ Covered by updated test.
+
+ * Modules/mediasource/MediaSource.cpp:
+ (WebCore::MediaSource::endOfStream):
+ (WebCore::MediaSource::addSourceBuffer):
+ (WebCore::MediaSource::removeSourceBuffer):
+ * Modules/mediasource/MediaSource.h:
+ * Modules/mediasource/MediaSource.idl:
+ * Modules/mediasource/SourceBuffer.cpp:
+ (WebCore::SourceBuffer::appendBuffer):
+ * Modules/mediasource/SourceBuffer.h:
+ * Modules/mediasource/SourceBuffer.idl:
+ * Modules/mediasource/SourceBufferList.cpp:
+ (WebCore::SourceBufferList::add):
+ (WebCore::SourceBufferList::remove):
+ * Modules/mediasource/SourceBufferList.h:
+
+2016-04-28 Youenn Fablet <youenn.fablet@crf.canon.fr>
+
</ins><span class="cx"> Drop [UsePointersEvenForNonNullableObjectArguments] from Node
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=156978
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceMediaSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp (200197 => 200198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp        2016-04-28 17:35:45 UTC (rev 200197)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp        2016-04-28 17:36:33 UTC (rev 200198)
</span><span class="lines">@@ -414,11 +414,6 @@
</span><span class="cx"> onReadyStateChange(oldState, state);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool SourceBufferIsUpdating(RefPtr<SourceBuffer>& sourceBuffer)
-{
- return sourceBuffer->updating();
-}
-
</del><span class="cx"> void MediaSource::endOfStream(ExceptionCode& ec)
</span><span class="cx"> {
</span><span class="cx"> endOfStream(emptyAtom, ec);
</span><span class="lines">@@ -436,7 +431,7 @@
</span><span class="cx">
</span><span class="cx"> // 2. If the updating attribute equals true on any SourceBuffer in sourceBuffers, then throw an
</span><span class="cx"> // INVALID_STATE_ERR exception and abort these steps.
</span><del>- if (std::any_of(m_sourceBuffers->begin(), m_sourceBuffers->end(), SourceBufferIsUpdating)) {
</del><ins>+ if (std::any_of(m_sourceBuffers->begin(), m_sourceBuffers->end(), [](RefPtr<SourceBuffer>& sourceBuffer) { return sourceBuffer->updating(); })) {
</ins><span class="cx"> ec = INVALID_STATE_ERR;
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -519,10 +514,9 @@
</span><span class="cx"> // 2.2 http://www.w3.org/TR/media-source/#widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type
</span><span class="cx"> // When this method is invoked, the user agent must run the following steps:
</span><span class="cx">
</span><del>- // 1. If type is null or an empty then throw an INVALID_ACCESS_ERR exception and
- // abort these steps.
- if (type.isNull() || type.isEmpty()) {
- ec = INVALID_ACCESS_ERR;
</del><ins>+ // 1. If type is an empty string then throw a TypeError exception and abort these steps.
+ if (type.isEmpty()) {
+ ec = TypeError;
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -551,7 +545,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RefPtr<SourceBuffer> buffer = SourceBuffer::create(sourceBufferPrivate.releaseNonNull(), this);
</del><ins>+ Ref<SourceBuffer> buffer = SourceBuffer::create(sourceBufferPrivate.releaseNonNull(), this);
</ins><span class="cx">
</span><span class="cx"> // 6. Set the generate timestamps flag on the new object to the value in the "Generate Timestamps Flag"
</span><span class="cx"> // column of the byte stream format registry [MSE-REGISTRY] entry that is associated with type.
</span><span class="lines">@@ -566,27 +560,21 @@
</span><span class="cx"> // ↳ Set the mode attribute on the new object to "segments".
</span><span class="cx"> buffer->setMode(shouldGenerateTimestamps ? SourceBuffer::sequenceKeyword() : SourceBuffer::segmentsKeyword(), IGNORE_EXCEPTION);
</span><span class="cx">
</span><ins>+ SourceBuffer* result = buffer.ptr();
+
</ins><span class="cx"> // 8. Add the new object to sourceBuffers and fire a addsourcebuffer on that object.
</span><del>- m_sourceBuffers->add(buffer);
</del><ins>+ m_sourceBuffers->add(WTFMove(buffer));
</ins><span class="cx"> regenerateActiveSourceBuffers();
</span><span class="cx">
</span><span class="cx"> // 9. Return the new object to the caller.
</span><del>- return buffer.get();
</del><ins>+ return result;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaSource::removeSourceBuffer(SourceBuffer* buffer, ExceptionCode& ec)
</del><ins>+void MediaSource::removeSourceBuffer(SourceBuffer& buffer, ExceptionCode& ec)
</ins><span class="cx"> {
</span><span class="cx"> LOG(MediaSource, "MediaSource::removeSourceBuffer() %p", this);
</span><del>- RefPtr<SourceBuffer> protect(buffer);
</del><ins>+ Ref<SourceBuffer> protect(buffer);
</ins><span class="cx">
</span><del>- // 2.2 https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#widl-MediaSource-removeSourceBuffer-void-SourceBuffer-sourceBuffer
- // 1. If sourceBuffer is null then throw an INVALID_ACCESS_ERR exception and
- // abort these steps.
- if (!buffer) {
- ec = INVALID_ACCESS_ERR;
- return;
- }
-
</del><span class="cx"> // 2. If sourceBuffer specifies an object that is not in sourceBuffers then
</span><span class="cx"> // throw a NOT_FOUND_ERR exception and abort these steps.
</span><span class="cx"> if (!m_sourceBuffers->length() || !m_sourceBuffers->contains(buffer)) {
</span><span class="lines">@@ -595,10 +583,10 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // 3. If the sourceBuffer.updating attribute equals true, then run the following steps: ...
</span><del>- buffer->abortIfUpdating();
</del><ins>+ buffer.abortIfUpdating();
</ins><span class="cx">
</span><span class="cx"> // 4. Let SourceBuffer audioTracks list equal the AudioTrackList object returned by sourceBuffer.audioTracks.
</span><del>- RefPtr<AudioTrackList> audioTracks = buffer->audioTracks();
</del><ins>+ RefPtr<AudioTrackList> audioTracks = buffer.audioTracks();
</ins><span class="cx">
</span><span class="cx"> // 5. If the SourceBuffer audioTracks list is not empty, then run the following steps:
</span><span class="cx"> if (audioTracks->length()) {
</span><span class="lines">@@ -638,7 +626,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // 6. Let SourceBuffer videoTracks list equal the VideoTrackList object returned by sourceBuffer.videoTracks.
</span><del>- RefPtr<VideoTrackList> videoTracks = buffer->videoTracks();
</del><ins>+ RefPtr<VideoTrackList> videoTracks = buffer.videoTracks();
</ins><span class="cx">
</span><span class="cx"> // 7. If the SourceBuffer videoTracks list is not empty, then run the following steps:
</span><span class="cx"> if (videoTracks->length()) {
</span><span class="lines">@@ -678,7 +666,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // 8. Let SourceBuffer textTracks list equal the TextTrackList object returned by sourceBuffer.textTracks.
</span><del>- RefPtr<TextTrackList> textTracks = buffer->textTracks();
</del><ins>+ RefPtr<TextTrackList> textTracks = buffer.textTracks();
</ins><span class="cx">
</span><span class="cx"> // 9. If the SourceBuffer textTracks list is not empty, then run the following steps:
</span><span class="cx"> if (textTracks->length()) {
</span><span class="lines">@@ -726,7 +714,7 @@
</span><span class="cx"> m_sourceBuffers->remove(buffer);
</span><span class="cx">
</span><span class="cx"> // 12. Destroy all resources for sourceBuffer.
</span><del>- buffer->removedFromMediaSource();
</del><ins>+ buffer.removedFromMediaSource();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool MediaSource::isTypeSupported(const String& type)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceMediaSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.h (200197 => 200198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/MediaSource.h        2016-04-28 17:35:45 UTC (rev 200197)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.h        2016-04-28 17:36:33 UTC (rev 200198)
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx"> SourceBufferList* sourceBuffers() { return m_sourceBuffers.get(); }
</span><span class="cx"> SourceBufferList* activeSourceBuffers() { return m_activeSourceBuffers.get(); }
</span><span class="cx"> SourceBuffer* addSourceBuffer(const String& type, ExceptionCode&);
</span><del>- void removeSourceBuffer(SourceBuffer*, ExceptionCode&);
</del><ins>+ void removeSourceBuffer(SourceBuffer&, ExceptionCode&);
</ins><span class="cx"> static bool isTypeSupported(const String& type);
</span><span class="cx">
</span><span class="cx"> // EventTarget interface
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceMediaSourceidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.idl (200197 => 200198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/MediaSource.idl        2016-04-28 17:35:45 UTC (rev 200197)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.idl        2016-04-28 17:36:33 UTC (rev 200198)
</span><span class="lines">@@ -34,12 +34,11 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> [
</span><ins>+ ActiveDOMObject,
</ins><span class="cx"> Conditional=MEDIA_SOURCE,
</span><del>- ActiveDOMObject,
- EnabledBySetting=MediaSource,
</del><span class="cx"> Constructor,
</span><span class="cx"> ConstructorCallWith=ScriptExecutionContext,
</span><del>- UsePointersEvenForNonNullableObjectArguments,
</del><ins>+ EnabledBySetting=MediaSource,
</ins><span class="cx"> ] interface MediaSource : EventTarget {
</span><span class="cx"> // All the source buffers created by this object.
</span><span class="cx"> readonly attribute SourceBufferList sourceBuffers;
</span><span class="lines">@@ -49,7 +48,8 @@
</span><span class="cx">
</span><span class="cx"> [SetterRaisesException] attribute unrestricted double duration;
</span><span class="cx">
</span><del>- [RaisesException] SourceBuffer addSourceBuffer(DOMString type);
</del><ins>+ // FIXME: type should not be nullable.
+ [RaisesException] SourceBuffer addSourceBuffer(DOMString? type);
</ins><span class="cx"> [RaisesException] void removeSourceBuffer(SourceBuffer buffer);
</span><span class="cx">
</span><span class="cx"> readonly attribute DOMString readyState;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (200197 => 200198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2016-04-28 17:35:45 UTC (rev 200197)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2016-04-28 17:36:33 UTC (rev 200198)
</span><span class="lines">@@ -271,26 +271,15 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><del>-void SourceBuffer::appendBuffer(PassRefPtr<ArrayBuffer> data, ExceptionCode& ec)
</del><ins>+void SourceBuffer::appendBuffer(ArrayBuffer& data, ExceptionCode& ec)
</ins><span class="cx"> {
</span><del>- // Section 3.2 appendBuffer()
- // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data
- // 1. If data is null then throw an INVALID_ACCESS_ERR exception and abort these steps.
- if (!data) {
- ec = INVALID_ACCESS_ERR;
- return;
- }
-
- appendBufferInternal(static_cast<unsigned char*>(data->data()), data->byteLength(), ec);
</del><ins>+ appendBufferInternal(static_cast<unsigned char*>(data.data()), data.byteLength(), ec);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void SourceBuffer::appendBuffer(PassRefPtr<ArrayBufferView> data, ExceptionCode& ec)
</del><ins>+void SourceBuffer::appendBuffer(ArrayBufferView* data, ExceptionCode& ec)
</ins><span class="cx"> {
</span><del>- // Section 3.2 appendBuffer()
- // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data
- // 1. If data is null then throw an INVALID_ACCESS_ERR exception and abort these steps.
</del><span class="cx"> if (!data) {
</span><del>- ec = INVALID_ACCESS_ERR;
</del><ins>+ ec = TypeError;
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h (200197 => 200198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h        2016-04-28 17:35:45 UTC (rev 200197)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h        2016-04-28 17:36:33 UTC (rev 200198)
</span><span class="lines">@@ -86,8 +86,8 @@
</span><span class="cx"> double appendWindowEnd() const;
</span><span class="cx"> void setAppendWindowEnd(double, ExceptionCode&);
</span><span class="cx">
</span><del>- void appendBuffer(PassRefPtr<ArrayBuffer> data, ExceptionCode&);
- void appendBuffer(PassRefPtr<ArrayBufferView> data, ExceptionCode&);
</del><ins>+ void appendBuffer(ArrayBuffer&, ExceptionCode&);
+ void appendBuffer(ArrayBufferView*, ExceptionCode&);
</ins><span class="cx"> void abort(ExceptionCode&);
</span><span class="cx"> void remove(double start, double end, ExceptionCode&);
</span><span class="cx"> void remove(const MediaTime&, const MediaTime&, ExceptionCode&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBufferidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl (200197 => 200198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl        2016-04-28 17:35:45 UTC (rev 200197)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl        2016-04-28 17:36:33 UTC (rev 200198)
</span><span class="lines">@@ -34,11 +34,10 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> [
</span><del>- Conditional=MEDIA_SOURCE,
- NoInterfaceObject,
</del><span class="cx"> ActiveDOMObject,
</span><del>- UsePointersEvenForNonNullableObjectArguments,
</del><ins>+ Conditional=MEDIA_SOURCE,
</ins><span class="cx"> ExportMacro=WEBCORE_EXPORT,
</span><ins>+ NoInterfaceObject,
</ins><span class="cx"> ] interface SourceBuffer : EventTarget {
</span><span class="cx">
</span><span class="cx"> [SetterRaisesException] attribute AppendMode mode;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBufferListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBufferList.cpp (200197 => 200198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBufferList.cpp        2016-04-28 17:35:45 UTC (rev 200197)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBufferList.cpp        2016-04-28 17:36:33 UTC (rev 200198)
</span><span class="lines">@@ -49,15 +49,15 @@
</span><span class="cx"> ASSERT(m_list.isEmpty());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SourceBufferList::add(PassRefPtr<SourceBuffer> buffer)
</del><ins>+void SourceBufferList::add(Ref<SourceBuffer>&& buffer)
</ins><span class="cx"> {
</span><del>- m_list.append(buffer);
</del><ins>+ m_list.append(WTFMove(buffer));
</ins><span class="cx"> scheduleEvent(eventNames().addsourcebufferEvent);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SourceBufferList::remove(SourceBuffer* buffer)
</del><ins>+void SourceBufferList::remove(SourceBuffer& buffer)
</ins><span class="cx"> {
</span><del>- size_t index = m_list.find(buffer);
</del><ins>+ size_t index = m_list.find(&buffer);
</ins><span class="cx"> if (index == notFound)
</span><span class="cx"> return;
</span><span class="cx"> m_list.remove(index);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBufferListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBufferList.h (200197 => 200198)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBufferList.h        2016-04-28 17:35:45 UTC (rev 200197)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBufferList.h        2016-04-28 17:36:33 UTC (rev 200198)
</span><span class="lines">@@ -52,11 +52,11 @@
</span><span class="cx"> virtual ~SourceBufferList();
</span><span class="cx">
</span><span class="cx"> unsigned long length() const { return m_list.size(); }
</span><del>- SourceBuffer* item(unsigned long index) const { return (index < m_list.size()) ? m_list[index].get() : 0; }
</del><ins>+ SourceBuffer* item(unsigned long index) const { return (index < m_list.size()) ? m_list[index].get() : nullptr; }
</ins><span class="cx">
</span><del>- void add(PassRefPtr<SourceBuffer>);
- void remove(SourceBuffer*);
- bool contains(SourceBuffer* buffer) { return m_list.find(buffer) != notFound; }
</del><ins>+ void add(Ref<SourceBuffer>&&);
+ void remove(SourceBuffer&);
+ bool contains(SourceBuffer& buffer) { return m_list.find(&buffer) != notFound; }
</ins><span class="cx"> void clear();
</span><span class="cx"> void swap(Vector<RefPtr<SourceBuffer>>&);
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>