OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data | 288 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data |
289 // 1. If data is null then throw an InvalidAccessError exception and abort t
hese steps. | 289 // 1. If data is null then throw an InvalidAccessError exception and abort t
hese steps. |
290 if (!data) { | 290 if (!data) { |
291 exceptionState.throwDOMException(InvalidAccessError, "The ArrayBuffer pr
ovided is invalid."); | 291 exceptionState.throwDOMException(InvalidAccessError, "The ArrayBuffer pr
ovided is invalid."); |
292 return; | 292 return; |
293 } | 293 } |
294 | 294 |
295 appendBufferInternal(static_cast<const unsigned char*>(data->baseAddress()),
data->byteLength(), exceptionState); | 295 appendBufferInternal(static_cast<const unsigned char*>(data->baseAddress()),
data->byteLength(), exceptionState); |
296 } | 296 } |
297 | 297 |
298 void SourceBuffer::appendStream(PassRefPtr<Stream> stream, ExceptionState& excep
tionState) | 298 void SourceBuffer::appendStream(PassRefPtrWillBeRawPtr<Stream> stream, Exception
State& exceptionState) |
299 { | 299 { |
300 m_streamMaxSizeValid = false; | 300 m_streamMaxSizeValid = false; |
301 appendStreamInternal(stream, exceptionState); | 301 appendStreamInternal(stream, exceptionState); |
302 } | 302 } |
303 | 303 |
304 void SourceBuffer::appendStream(PassRefPtr<Stream> stream, unsigned long long ma
xSize, ExceptionState& exceptionState) | 304 void SourceBuffer::appendStream(PassRefPtrWillBeRawPtr<Stream> stream, unsigned
long long maxSize, ExceptionState& exceptionState) |
305 { | 305 { |
306 m_streamMaxSizeValid = maxSize > 0; | 306 m_streamMaxSizeValid = maxSize > 0; |
307 if (m_streamMaxSizeValid) | 307 if (m_streamMaxSizeValid) |
308 m_streamMaxSize = maxSize; | 308 m_streamMaxSize = maxSize; |
309 appendStreamInternal(stream, exceptionState); | 309 appendStreamInternal(stream, exceptionState); |
310 } | 310 } |
311 | 311 |
312 void SourceBuffer::abort(ExceptionState& exceptionState) | 312 void SourceBuffer::abort(ExceptionState& exceptionState) |
313 { | 313 { |
314 // Section 3.2 abort() method steps. | 314 // Section 3.2 abort() method steps. |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 m_pendingRemoveStart = -1; | 567 m_pendingRemoveStart = -1; |
568 m_pendingRemoveEnd = -1; | 568 m_pendingRemoveEnd = -1; |
569 | 569 |
570 // 11. Queue a task to fire a simple event named update at this SourceBuffer
object. | 570 // 11. Queue a task to fire a simple event named update at this SourceBuffer
object. |
571 scheduleEvent(EventTypeNames::update); | 571 scheduleEvent(EventTypeNames::update); |
572 | 572 |
573 // 12. Queue a task to fire a simple event named updateend at this SourceBuf
fer object. | 573 // 12. Queue a task to fire a simple event named updateend at this SourceBuf
fer object. |
574 scheduleEvent(EventTypeNames::updateend); | 574 scheduleEvent(EventTypeNames::updateend); |
575 } | 575 } |
576 | 576 |
577 void SourceBuffer::appendStreamInternal(PassRefPtr<Stream> stream, ExceptionStat
e& exceptionState) | 577 void SourceBuffer::appendStreamInternal(PassRefPtrWillBeRawPtr<Stream> stream, E
xceptionState& exceptionState) |
578 { | 578 { |
579 // Section 3.2 appendStream() | 579 // Section 3.2 appendStream() |
580 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#widl-SourceBuffer-appendStream-void-Stream-stream-unsigned-long-long-ma
xSize | 580 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#widl-SourceBuffer-appendStream-void-Stream-stream-unsigned-long-long-ma
xSize |
581 // 1. If stream is null then throw an InvalidAccessError exception and abort
these steps. | 581 // 1. If stream is null then throw an InvalidAccessError exception and abort
these steps. |
582 if (!stream || stream->isNeutered()) { | 582 if (!stream || stream->isNeutered()) { |
583 exceptionState.throwDOMException(InvalidAccessError, stream ? "The strea
m provided has been neutered." : "The stream provided is invalid."); | 583 exceptionState.throwDOMException(InvalidAccessError, stream ? "The strea
m provided has been neutered." : "The stream provided is invalid."); |
584 return; | 584 return; |
585 } | 585 } |
586 | 586 |
587 // 2. Run the prepare append algorithm. | 587 // 2. Run the prepare append algorithm. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 | 702 |
703 void SourceBuffer::didFail(FileError::ErrorCode errorCode) | 703 void SourceBuffer::didFail(FileError::ErrorCode errorCode) |
704 { | 704 { |
705 WTF_LOG(Media, "SourceBuffer::didFail(%d) %p", errorCode, this); | 705 WTF_LOG(Media, "SourceBuffer::didFail(%d) %p", errorCode, this); |
706 appendStreamDone(false); | 706 appendStreamDone(false); |
707 } | 707 } |
708 | 708 |
709 void SourceBuffer::trace(Visitor* visitor) | 709 void SourceBuffer::trace(Visitor* visitor) |
710 { | 710 { |
711 visitor->trace(m_source); | 711 visitor->trace(m_source); |
| 712 visitor->trace(m_stream); |
712 } | 713 } |
713 | 714 |
714 } // namespace WebCore | 715 } // namespace WebCore |
OLD | NEW |