namespace WebCore {
-PassRefPtr<SourceBuffer> SourceBuffer::create(PassOwnPtr<WebSourceBuffer> webSourceBuffer, MediaSource* source, GenericEventQueue* asyncEventQueue)
+DEFINE_GC_INFO(SourceBuffer);
+
+PassRefPtrWillBeRawPtr<SourceBuffer> SourceBuffer::create(PassOwnPtr<WebSourceBuffer> webSourceBuffer, MediaSource* source, GenericEventQueue* asyncEventQueue)
{
- RefPtr<SourceBuffer> sourceBuffer(adoptRef(new SourceBuffer(webSourceBuffer, source, asyncEventQueue)));
+ RefPtrWillBeRawPtr<SourceBuffer> sourceBuffer(adoptRefCountedWillBeRefCountedGarbageCollected(new SourceBuffer(webSourceBuffer, source, asyncEventQueue)));
sourceBuffer->suspendIfNeeded();
return sourceBuffer.release();
}
// 1. Let new mode equal the new value being assigned to this attribute.
// 2. If new mode does not equal "segments" or "sequence", then throw an INVALID_ACCESS_ERR exception and abort
// these steps.
- if (newMode != segmentsKeyword() && newMode != sequenceKeyword()) {
- exceptionState.throwUninformativeAndGenericDOMException(InvalidAccessError);
- return;
- }
-
+ // Step 2 is unnecessary: IDL enforcement prevents this case and should just return immediately to script
+ // without calling this method in this case.
// 3. 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.
// 4. If the updating attribute equals true, then throw an INVALID_STATE_ERR exception and abort these steps.
appendStreamDone(false);
}
+void SourceBuffer::trace(Visitor* visitor)
+{
+ visitor->trace(m_source);
+}
+
} // namespace WebCore