| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data | 286 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data |
| 287 // 1. If data is null then throw an InvalidAccessError exception and abort t
hese steps. | 287 // 1. If data is null then throw an InvalidAccessError exception and abort t
hese steps. |
| 288 if (!data) { | 288 if (!data) { |
| 289 exceptionState.throwDOMException(InvalidAccessError, "The ArrayBuffer pr
ovided is invalid."); | 289 exceptionState.throwDOMException(InvalidAccessError, "The ArrayBuffer pr
ovided is invalid."); |
| 290 return; | 290 return; |
| 291 } | 291 } |
| 292 | 292 |
| 293 appendBufferInternal(static_cast<const unsigned char*>(data->baseAddress()),
data->byteLength(), exceptionState); | 293 appendBufferInternal(static_cast<const unsigned char*>(data->baseAddress()),
data->byteLength(), exceptionState); |
| 294 } | 294 } |
| 295 | 295 |
| 296 void SourceBuffer::appendStream(PassRefPtr<Stream> stream, ExceptionState& excep
tionState) | 296 void SourceBuffer::appendStream(PassRefPtrWillBeRawPtr<Stream> stream, Exception
State& exceptionState) |
| 297 { | 297 { |
| 298 m_streamMaxSizeValid = false; | 298 m_streamMaxSizeValid = false; |
| 299 appendStreamInternal(stream, exceptionState); | 299 appendStreamInternal(stream, exceptionState); |
| 300 } | 300 } |
| 301 | 301 |
| 302 void SourceBuffer::appendStream(PassRefPtr<Stream> stream, unsigned long long ma
xSize, ExceptionState& exceptionState) | 302 void SourceBuffer::appendStream(PassRefPtrWillBeRawPtr<Stream> stream, unsigned
long long maxSize, ExceptionState& exceptionState) |
| 303 { | 303 { |
| 304 m_streamMaxSizeValid = maxSize > 0; | 304 m_streamMaxSizeValid = maxSize > 0; |
| 305 if (m_streamMaxSizeValid) | 305 if (m_streamMaxSizeValid) |
| 306 m_streamMaxSize = maxSize; | 306 m_streamMaxSize = maxSize; |
| 307 appendStreamInternal(stream, exceptionState); | 307 appendStreamInternal(stream, exceptionState); |
| 308 } | 308 } |
| 309 | 309 |
| 310 void SourceBuffer::abort(ExceptionState& exceptionState) | 310 void SourceBuffer::abort(ExceptionState& exceptionState) |
| 311 { | 311 { |
| 312 // Section 3.2 abort() method steps. | 312 // Section 3.2 abort() method steps. |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 m_pendingRemoveStart = -1; | 565 m_pendingRemoveStart = -1; |
| 566 m_pendingRemoveEnd = -1; | 566 m_pendingRemoveEnd = -1; |
| 567 | 567 |
| 568 // 11. Queue a task to fire a simple event named update at this SourceBuffer
object. | 568 // 11. Queue a task to fire a simple event named update at this SourceBuffer
object. |
| 569 scheduleEvent(EventTypeNames::update); | 569 scheduleEvent(EventTypeNames::update); |
| 570 | 570 |
| 571 // 12. Queue a task to fire a simple event named updateend at this SourceBuf
fer object. | 571 // 12. Queue a task to fire a simple event named updateend at this SourceBuf
fer object. |
| 572 scheduleEvent(EventTypeNames::updateend); | 572 scheduleEvent(EventTypeNames::updateend); |
| 573 } | 573 } |
| 574 | 574 |
| 575 void SourceBuffer::appendStreamInternal(PassRefPtr<Stream> stream, ExceptionStat
e& exceptionState) | 575 void SourceBuffer::appendStreamInternal(PassRefPtrWillBeRawPtr<Stream> stream, E
xceptionState& exceptionState) |
| 576 { | 576 { |
| 577 // Section 3.2 appendStream() | 577 // Section 3.2 appendStream() |
| 578 // 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 | 578 // 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 |
| 579 // 1. If stream is null then throw an InvalidAccessError exception and abort
these steps. | 579 // 1. If stream is null then throw an InvalidAccessError exception and abort
these steps. |
| 580 if (!stream || stream->isNeutered()) { | 580 if (!stream || stream->isNeutered()) { |
| 581 exceptionState.throwDOMException(InvalidAccessError, stream ? "The strea
m provided has been neutered." : "The stream provided is invalid."); | 581 exceptionState.throwDOMException(InvalidAccessError, stream ? "The strea
m provided has been neutered." : "The stream provided is invalid."); |
| 582 return; | 582 return; |
| 583 } | 583 } |
| 584 | 584 |
| 585 // 2. Run the prepare append algorithm. | 585 // 2. Run the prepare append algorithm. |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 | 699 |
| 700 void SourceBuffer::didFail(FileError::ErrorCode errorCode) | 700 void SourceBuffer::didFail(FileError::ErrorCode errorCode) |
| 701 { | 701 { |
| 702 WTF_LOG(Media, "SourceBuffer::didFail(%d) %p", errorCode, this); | 702 WTF_LOG(Media, "SourceBuffer::didFail(%d) %p", errorCode, this); |
| 703 appendStreamDone(false); | 703 appendStreamDone(false); |
| 704 } | 704 } |
| 705 | 705 |
| 706 void SourceBuffer::trace(Visitor* visitor) | 706 void SourceBuffer::trace(Visitor* visitor) |
| 707 { | 707 { |
| 708 visitor->trace(m_source); | 708 visitor->trace(m_source); |
| 709 visitor->trace(m_stream); |
| 709 } | 710 } |
| 710 | 711 |
| 711 } // namespace WebCore | 712 } // namespace WebCore |
| OLD | NEW |