Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(859)

Unified Diff: Source/modules/mediasource/SourceBuffer.cpp

Issue 754463008: MSE: Implement SourceBuffer.trackDefaults (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@Implement_TrackDefaultList_object
Patch Set: Use simpler TrackDefaultList::create() for initializing |m_trackDefaults| Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/mediasource/SourceBuffer.h ('k') | Source/modules/mediasource/SourceBuffer.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « Source/modules/mediasource/SourceBuffer.h ('k') | Source/modules/mediasource/SourceBuffer.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698