Chromium Code Reviews| Index: Source/modules/mediasource/SourceBuffer.cpp |
| diff --git a/Source/modules/mediasource/SourceBuffer.cpp b/Source/modules/mediasource/SourceBuffer.cpp |
| index e44acdd05d626cece4f1c5cec1854f1354e93d36..d8572d8dd93e390f1cf37aa8e2e79cc17009a15f 100644 |
| --- a/Source/modules/mediasource/SourceBuffer.cpp |
| +++ b/Source/modules/mediasource/SourceBuffer.cpp |
| @@ -83,6 +83,7 @@ SourceBuffer::SourceBuffer(PassOwnPtr<WebSourceBuffer> webSourceBuffer, MediaSou |
| : ActiveDOMObject(source->executionContext()) |
| , m_webSourceBuffer(webSourceBuffer) |
| , m_source(source) |
| + , m_trackDefaults(TrackDefaultList::create()) |
|
haraken
2014/12/16 01:16:16
Do we need to create an empty vector? Can we just
sof
2014/12/16 07:24:36
Don't think the IDL allows for that in practice, a
philipj_slow
2014/12/16 09:55:48
Right, that is the topic of the spec bug Matthew f
|
| , m_asyncEventQueue(asyncEventQueue) |
| , m_mode(segmentsKeyword()) |
| , m_updating(false) |
| @@ -366,6 +367,22 @@ void SourceBuffer::remove(double start, double end, ExceptionState& exceptionSta |
| m_removeAsyncPartRunner.runAsync(); |
| } |
| +void SourceBuffer::setTrackDefaults(TrackDefaultList* trackDefaults, ExceptionState& exceptionState) |
| +{ |
| + // Per 02 Dec 2014 Editor's Draft |
| + // http://w3c.github.io/media-source/#widl-SourceBuffer-trackDefaults |
| + // 1. If this object has been removed from the sourceBuffers attribute of |
| + // the parent media source, then throw an InvalidStateError exception |
| + // and abort these steps. |
| + // 2. If the updating attribute equals true, then throw an InvalidStateError |
| + // exception and abort these steps. |
| + if (throwExceptionIfRemovedOrUpdating(isRemoved(), m_updating, exceptionState)) |
| + return; |
| + |
| + // 3. Update the attribute to the new value. |
| + m_trackDefaults = trackDefaults; |
| +} |
| + |
| void SourceBuffer::abortIfUpdating() |
| { |
| // Section 3.2 abort() method step 3 substeps. |
| @@ -746,6 +763,7 @@ void SourceBuffer::trace(Visitor* visitor) |
| { |
| visitor->trace(m_source); |
| visitor->trace(m_stream); |
| + visitor->trace(m_trackDefaults); |
| visitor->trace(m_asyncEventQueue); |
| EventTargetWithInlineData::trace(visitor); |
| } |