| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 ASSERT(!m_loader); | 85 ASSERT(!m_loader); |
| 86 ASSERT(!m_stream); | 86 ASSERT(!m_stream); |
| 87 } | 87 } |
| 88 | 88 |
| 89 PassRefPtr<TimeRanges> SourceBuffer::buffered(ExceptionState& es) const | 89 PassRefPtr<TimeRanges> SourceBuffer::buffered(ExceptionState& es) const |
| 90 { | 90 { |
| 91 // Section 3.1 buffered attribute steps. | 91 // Section 3.1 buffered attribute steps. |
| 92 // 1. If this object has been removed from the sourceBuffers attribute of th
e parent media source then throw an | 92 // 1. If this object has been removed from the sourceBuffers attribute of th
e parent media source then throw an |
| 93 // InvalidStateError exception and abort these steps. | 93 // InvalidStateError exception and abort these steps. |
| 94 if (isRemoved()) { | 94 if (isRemoved()) { |
| 95 es.throwDOMException(InvalidStateError); | 95 es.throwUninformativeAndGenericDOMException(InvalidStateError); |
| 96 return 0; | 96 return 0; |
| 97 } | 97 } |
| 98 | 98 |
| 99 // 2. Return a new static normalized TimeRanges object for the media segment
s buffered. | 99 // 2. Return a new static normalized TimeRanges object for the media segment
s buffered. |
| 100 return m_private->buffered(); | 100 return m_private->buffered(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 double SourceBuffer::timestampOffset() const | 103 double SourceBuffer::timestampOffset() const |
| 104 { | 104 { |
| 105 return m_timestampOffset; | 105 return m_timestampOffset; |
| 106 } | 106 } |
| 107 | 107 |
| 108 void SourceBuffer::setTimestampOffset(double offset, ExceptionState& es) | 108 void SourceBuffer::setTimestampOffset(double offset, ExceptionState& es) |
| 109 { | 109 { |
| 110 // Section 3.1 timestampOffset attribute setter steps. | 110 // Section 3.1 timestampOffset attribute setter steps. |
| 111 // 1. Let new timestamp offset equal the new value being assigned to this at
tribute. | 111 // 1. Let new timestamp offset equal the new value being assigned to this at
tribute. |
| 112 // 2. If this object has been removed from the sourceBuffers attribute of th
e parent media source, then throw an | 112 // 2. If this object has been removed from the sourceBuffers attribute of th
e parent media source, then throw an |
| 113 // InvalidStateError exception and abort these steps. | 113 // InvalidStateError exception and abort these steps. |
| 114 // 3. If the updating attribute equals true, then throw an InvalidStateError
exception and abort these steps. | 114 // 3. If the updating attribute equals true, then throw an InvalidStateError
exception and abort these steps. |
| 115 if (isRemoved() || m_updating) { | 115 if (isRemoved() || m_updating) { |
| 116 es.throwDOMException(InvalidStateError); | 116 es.throwUninformativeAndGenericDOMException(InvalidStateError); |
| 117 return; | 117 return; |
| 118 } | 118 } |
| 119 | 119 |
| 120 // 4. If the readyState attribute of the parent media source is in the "ende
d" state then run the following steps: | 120 // 4. If the readyState attribute of the parent media source is in the "ende
d" state then run the following steps: |
| 121 // 4.1 Set the readyState attribute of the parent media source to "open" | 121 // 4.1 Set the readyState attribute of the parent media source to "open" |
| 122 // 4.2 Queue a task to fire a simple event named sourceopen at the parent me
dia source. | 122 // 4.2 Queue a task to fire a simple event named sourceopen at the parent me
dia source. |
| 123 m_source->openIfInEndedState(); | 123 m_source->openIfInEndedState(); |
| 124 | 124 |
| 125 // 5. If this object is waiting for the end of a media segment to be appende
d, then throw an InvalidStateError | 125 // 5. If this object is waiting for the end of a media segment to be appende
d, then throw an InvalidStateError |
| 126 // and abort these steps. | 126 // and abort these steps. |
| 127 // | 127 // |
| 128 // FIXME: Add step 6 text when mode attribute is implemented. | 128 // FIXME: Add step 6 text when mode attribute is implemented. |
| 129 if (!m_private->setTimestampOffset(offset)) { | 129 if (!m_private->setTimestampOffset(offset)) { |
| 130 es.throwDOMException(InvalidStateError); | 130 es.throwUninformativeAndGenericDOMException(InvalidStateError); |
| 131 return; | 131 return; |
| 132 } | 132 } |
| 133 | 133 |
| 134 // 7. Update the attribute to new timestamp offset. | 134 // 7. Update the attribute to new timestamp offset. |
| 135 m_timestampOffset = offset; | 135 m_timestampOffset = offset; |
| 136 } | 136 } |
| 137 | 137 |
| 138 double SourceBuffer::appendWindowStart() const | 138 double SourceBuffer::appendWindowStart() const |
| 139 { | 139 { |
| 140 return m_appendWindowStart; | 140 return m_appendWindowStart; |
| 141 } | 141 } |
| 142 | 142 |
| 143 void SourceBuffer::setAppendWindowStart(double start, ExceptionState& es) | 143 void SourceBuffer::setAppendWindowStart(double start, ExceptionState& es) |
| 144 { | 144 { |
| 145 // Enforce throwing an exception on restricted double values. | 145 // Enforce throwing an exception on restricted double values. |
| 146 if (std::isnan(start) | 146 if (std::isnan(start) |
| 147 || start == std::numeric_limits<double>::infinity() | 147 || start == std::numeric_limits<double>::infinity() |
| 148 || start == -std::numeric_limits<double>::infinity()) { | 148 || start == -std::numeric_limits<double>::infinity()) { |
| 149 es.throwDOMException(TypeMismatchError); | 149 es.throwUninformativeAndGenericDOMException(TypeMismatchError); |
| 150 return; | 150 return; |
| 151 } | 151 } |
| 152 | 152 |
| 153 // Section 3.1 appendWindowStart attribute setter steps. | 153 // Section 3.1 appendWindowStart attribute setter steps. |
| 154 // 1. If this object has been removed from the sourceBuffers attribute of th
e parent media source then throw an | 154 // 1. If this object has been removed from the sourceBuffers attribute of th
e parent media source then throw an |
| 155 // InvalidStateError exception and abort these steps. | 155 // InvalidStateError exception and abort these steps. |
| 156 // 2. If the updating attribute equals true, then throw an InvalidStateError
exception and abort these steps. | 156 // 2. If the updating attribute equals true, then throw an InvalidStateError
exception and abort these steps. |
| 157 if (isRemoved() || m_updating) { | 157 if (isRemoved() || m_updating) { |
| 158 es.throwDOMException(InvalidStateError); | 158 es.throwUninformativeAndGenericDOMException(InvalidStateError); |
| 159 return; | 159 return; |
| 160 } | 160 } |
| 161 | 161 |
| 162 // 3. If the new value is less than 0 or greater than or equal to appendWind
owEnd then throw an InvalidAccessError | 162 // 3. If the new value is less than 0 or greater than or equal to appendWind
owEnd then throw an InvalidAccessError |
| 163 // exception and abort these steps. | 163 // exception and abort these steps. |
| 164 if (start < 0 || start >= m_appendWindowEnd) { | 164 if (start < 0 || start >= m_appendWindowEnd) { |
| 165 es.throwDOMException(InvalidAccessError); | 165 es.throwUninformativeAndGenericDOMException(InvalidAccessError); |
| 166 return; | 166 return; |
| 167 } | 167 } |
| 168 | 168 |
| 169 m_private->setAppendWindowStart(start); | 169 m_private->setAppendWindowStart(start); |
| 170 | 170 |
| 171 // 4. Update the attribute to the new value. | 171 // 4. Update the attribute to the new value. |
| 172 m_appendWindowStart = start; | 172 m_appendWindowStart = start; |
| 173 } | 173 } |
| 174 | 174 |
| 175 double SourceBuffer::appendWindowEnd() const | 175 double SourceBuffer::appendWindowEnd() const |
| 176 { | 176 { |
| 177 return m_appendWindowEnd; | 177 return m_appendWindowEnd; |
| 178 } | 178 } |
| 179 | 179 |
| 180 void SourceBuffer::setAppendWindowEnd(double end, ExceptionState& es) | 180 void SourceBuffer::setAppendWindowEnd(double end, ExceptionState& es) |
| 181 { | 181 { |
| 182 // Section 3.1 appendWindowEnd attribute setter steps. | 182 // Section 3.1 appendWindowEnd attribute setter steps. |
| 183 // 1. If this object has been removed from the sourceBuffers attribute of th
e parent media source then throw an | 183 // 1. If this object has been removed from the sourceBuffers attribute of th
e parent media source then throw an |
| 184 // InvalidStateError exception and abort these steps. | 184 // InvalidStateError exception and abort these steps. |
| 185 // 2. If the updating attribute equals true, then throw an InvalidStateError
exception and abort these steps. | 185 // 2. If the updating attribute equals true, then throw an InvalidStateError
exception and abort these steps. |
| 186 if (isRemoved() || m_updating) { | 186 if (isRemoved() || m_updating) { |
| 187 es.throwDOMException(InvalidStateError); | 187 es.throwUninformativeAndGenericDOMException(InvalidStateError); |
| 188 return; | 188 return; |
| 189 } | 189 } |
| 190 | 190 |
| 191 // 3. If the new value equals NaN, then throw an InvalidAccessError and abor
t these steps. | 191 // 3. If the new value equals NaN, then throw an InvalidAccessError and abor
t these steps. |
| 192 // 4. If the new value is less than or equal to appendWindowStart then throw
an InvalidAccessError | 192 // 4. If the new value is less than or equal to appendWindowStart then throw
an InvalidAccessError |
| 193 // exception and abort these steps. | 193 // exception and abort these steps. |
| 194 if (std::isnan(end) || end <= m_appendWindowStart) { | 194 if (std::isnan(end) || end <= m_appendWindowStart) { |
| 195 es.throwDOMException(InvalidAccessError); | 195 es.throwUninformativeAndGenericDOMException(InvalidAccessError); |
| 196 return; | 196 return; |
| 197 } | 197 } |
| 198 | 198 |
| 199 m_private->setAppendWindowEnd(end); | 199 m_private->setAppendWindowEnd(end); |
| 200 | 200 |
| 201 // 5. Update the attribute to the new value. | 201 // 5. Update the attribute to the new value. |
| 202 m_appendWindowEnd = end; | 202 m_appendWindowEnd = end; |
| 203 } | 203 } |
| 204 | 204 |
| 205 void SourceBuffer::appendBuffer(PassRefPtr<ArrayBuffer> data, ExceptionState& es
) | 205 void SourceBuffer::appendBuffer(PassRefPtr<ArrayBuffer> data, ExceptionState& es
) |
| 206 { | 206 { |
| 207 // Section 3.2 appendBuffer() | 207 // Section 3.2 appendBuffer() |
| 208 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data | 208 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data |
| 209 // 1. If data is null then throw an InvalidAccessError exception and abort t
hese steps. | 209 // 1. If data is null then throw an InvalidAccessError exception and abort t
hese steps. |
| 210 if (!data) { | 210 if (!data) { |
| 211 es.throwDOMException(InvalidAccessError); | 211 es.throwUninformativeAndGenericDOMException(InvalidAccessError); |
| 212 return; | 212 return; |
| 213 } | 213 } |
| 214 | 214 |
| 215 appendBufferInternal(static_cast<const unsigned char*>(data->data()), data->
byteLength(), es); | 215 appendBufferInternal(static_cast<const unsigned char*>(data->data()), data->
byteLength(), es); |
| 216 } | 216 } |
| 217 | 217 |
| 218 void SourceBuffer::appendBuffer(PassRefPtr<ArrayBufferView> data, ExceptionState
& es) | 218 void SourceBuffer::appendBuffer(PassRefPtr<ArrayBufferView> data, ExceptionState
& es) |
| 219 { | 219 { |
| 220 // Section 3.2 appendBuffer() | 220 // Section 3.2 appendBuffer() |
| 221 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data | 221 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data |
| 222 // 1. If data is null then throw an InvalidAccessError exception and abort t
hese steps. | 222 // 1. If data is null then throw an InvalidAccessError exception and abort t
hese steps. |
| 223 if (!data) { | 223 if (!data) { |
| 224 es.throwDOMException(InvalidAccessError); | 224 es.throwUninformativeAndGenericDOMException(InvalidAccessError); |
| 225 return; | 225 return; |
| 226 } | 226 } |
| 227 | 227 |
| 228 appendBufferInternal(static_cast<const unsigned char*>(data->baseAddress()),
data->byteLength(), es); | 228 appendBufferInternal(static_cast<const unsigned char*>(data->baseAddress()),
data->byteLength(), es); |
| 229 } | 229 } |
| 230 | 230 |
| 231 void SourceBuffer::appendStream(PassRefPtr<Stream> stream, ExceptionState& es) | 231 void SourceBuffer::appendStream(PassRefPtr<Stream> stream, ExceptionState& es) |
| 232 { | 232 { |
| 233 m_streamMaxSizeValid = false; | 233 m_streamMaxSizeValid = false; |
| 234 appendStreamInternal(stream, es); | 234 appendStreamInternal(stream, es); |
| 235 } | 235 } |
| 236 | 236 |
| 237 void SourceBuffer::appendStream(PassRefPtr<Stream> stream, unsigned long long ma
xSize, ExceptionState& es) | 237 void SourceBuffer::appendStream(PassRefPtr<Stream> stream, unsigned long long ma
xSize, ExceptionState& es) |
| 238 { | 238 { |
| 239 m_streamMaxSizeValid = maxSize > 0; | 239 m_streamMaxSizeValid = maxSize > 0; |
| 240 if (m_streamMaxSizeValid) | 240 if (m_streamMaxSizeValid) |
| 241 m_streamMaxSize = maxSize; | 241 m_streamMaxSize = maxSize; |
| 242 appendStreamInternal(stream, es); | 242 appendStreamInternal(stream, es); |
| 243 } | 243 } |
| 244 | 244 |
| 245 void SourceBuffer::abort(ExceptionState& es) | 245 void SourceBuffer::abort(ExceptionState& es) |
| 246 { | 246 { |
| 247 // Section 3.2 abort() method steps. | 247 // Section 3.2 abort() method steps. |
| 248 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#widl-SourceBuffer-abort-void | 248 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#widl-SourceBuffer-abort-void |
| 249 // 1. If this object has been removed from the sourceBuffers attribute of th
e parent media source | 249 // 1. If this object has been removed from the sourceBuffers attribute of th
e parent media source |
| 250 // then throw an InvalidStateError exception and abort these steps. | 250 // then throw an InvalidStateError exception and abort these steps. |
| 251 // 2. If the readyState attribute of the parent media source is not in the "
open" state | 251 // 2. If the readyState attribute of the parent media source is not in the "
open" state |
| 252 // then throw an InvalidStateError exception and abort these steps. | 252 // then throw an InvalidStateError exception and abort these steps. |
| 253 if (isRemoved() || !m_source->isOpen()) { | 253 if (isRemoved() || !m_source->isOpen()) { |
| 254 es.throwDOMException(InvalidStateError); | 254 es.throwUninformativeAndGenericDOMException(InvalidStateError); |
| 255 return; | 255 return; |
| 256 } | 256 } |
| 257 | 257 |
| 258 // 3. If the sourceBuffer.updating attribute equals true, then run the follo
wing steps: ... | 258 // 3. If the sourceBuffer.updating attribute equals true, then run the follo
wing steps: ... |
| 259 abortIfUpdating(); | 259 abortIfUpdating(); |
| 260 | 260 |
| 261 // 4. Run the reset parser state algorithm. | 261 // 4. Run the reset parser state algorithm. |
| 262 m_private->abort(); | 262 m_private->abort(); |
| 263 | 263 |
| 264 // 5. Set appendWindowStart to 0. | 264 // 5. Set appendWindowStart to 0. |
| 265 setAppendWindowStart(0, es); | 265 setAppendWindowStart(0, es); |
| 266 | 266 |
| 267 // 6. Set appendWindowEnd to positive Infinity. | 267 // 6. Set appendWindowEnd to positive Infinity. |
| 268 setAppendWindowEnd(std::numeric_limits<double>::infinity(), es); | 268 setAppendWindowEnd(std::numeric_limits<double>::infinity(), es); |
| 269 } | 269 } |
| 270 | 270 |
| 271 void SourceBuffer::remove(double start, double end, ExceptionState& es) | 271 void SourceBuffer::remove(double start, double end, ExceptionState& es) |
| 272 { | 272 { |
| 273 // Section 3.2 remove() method steps. | 273 // Section 3.2 remove() method steps. |
| 274 // 1. If start is negative or greater than duration, then throw an InvalidAc
cessError exception and abort these steps. | 274 // 1. If start is negative or greater than duration, then throw an InvalidAc
cessError exception and abort these steps. |
| 275 // 2. If end is less than or equal to start, then throw an InvalidAccessErro
r exception and abort these steps. | 275 // 2. If end is less than or equal to start, then throw an InvalidAccessErro
r exception and abort these steps. |
| 276 if (start < 0 || (m_source && (std::isnan(m_source->duration()) || start > m
_source->duration())) || end <= start) { | 276 if (start < 0 || (m_source && (std::isnan(m_source->duration()) || start > m
_source->duration())) || end <= start) { |
| 277 es.throwDOMException(InvalidAccessError); | 277 es.throwUninformativeAndGenericDOMException(InvalidAccessError); |
| 278 return; | 278 return; |
| 279 } | 279 } |
| 280 | 280 |
| 281 // 3. If this object has been removed from the sourceBuffers attribute of th
e parent media source then throw an | 281 // 3. If this object has been removed from the sourceBuffers attribute of th
e parent media source then throw an |
| 282 // InvalidStateError exception and abort these steps. | 282 // InvalidStateError exception and abort these steps. |
| 283 // 4. If the updating attribute equals true, then throw an InvalidStateError
exception and abort these steps. | 283 // 4. If the updating attribute equals true, then throw an InvalidStateError
exception and abort these steps. |
| 284 if (isRemoved() || m_updating) { | 284 if (isRemoved() || m_updating) { |
| 285 es.throwDOMException(InvalidStateError); | 285 es.throwUninformativeAndGenericDOMException(InvalidStateError); |
| 286 return; | 286 return; |
| 287 } | 287 } |
| 288 | 288 |
| 289 // 5. If the readyState attribute of the parent media source is in the "ende
d" state then run the following steps: | 289 // 5. If the readyState attribute of the parent media source is in the "ende
d" state then run the following steps: |
| 290 // 5.1. Set the readyState attribute of the parent media source to "open" | 290 // 5.1. Set the readyState attribute of the parent media source to "open" |
| 291 // 5.2. Queue a task to fire a simple event named sourceopen at the parent m
edia source . | 291 // 5.2. Queue a task to fire a simple event named sourceopen at the parent m
edia source . |
| 292 m_source->openIfInEndedState(); | 292 m_source->openIfInEndedState(); |
| 293 | 293 |
| 294 // 6. Set the updating attribute to true. | 294 // 6. Set the updating attribute to true. |
| 295 m_updating = true; | 295 m_updating = true; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 | 393 |
| 394 void SourceBuffer::appendBufferInternal(const unsigned char* data, unsigned size
, ExceptionState& es) | 394 void SourceBuffer::appendBufferInternal(const unsigned char* data, unsigned size
, ExceptionState& es) |
| 395 { | 395 { |
| 396 // Section 3.2 appendBuffer() | 396 // Section 3.2 appendBuffer() |
| 397 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data | 397 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data |
| 398 | 398 |
| 399 // Step 1 is enforced by the caller. | 399 // Step 1 is enforced by the caller. |
| 400 // 2. If this object has been removed from the sourceBuffers attribute of th
e parent media source then throw an InvalidStateError exception and abort these
steps. | 400 // 2. If this object has been removed from the sourceBuffers attribute of th
e parent media source then throw an InvalidStateError exception and abort these
steps. |
| 401 // 3. If the updating attribute equals true, then throw an InvalidStateError
exception and abort these steps. | 401 // 3. If the updating attribute equals true, then throw an InvalidStateError
exception and abort these steps. |
| 402 if (isRemoved() || m_updating) { | 402 if (isRemoved() || m_updating) { |
| 403 es.throwDOMException(InvalidStateError); | 403 es.throwUninformativeAndGenericDOMException(InvalidStateError); |
| 404 return; | 404 return; |
| 405 } | 405 } |
| 406 | 406 |
| 407 // 4. If the readyState attribute of the parent media source is in the "ende
d" state then run the following steps: ... | 407 // 4. If the readyState attribute of the parent media source is in the "ende
d" state then run the following steps: ... |
| 408 m_source->openIfInEndedState(); | 408 m_source->openIfInEndedState(); |
| 409 | 409 |
| 410 // Steps 5-6 | 410 // Steps 5-6 |
| 411 | 411 |
| 412 // 7. Add data to the end of the input buffer. | 412 // 7. Add data to the end of the input buffer. |
| 413 m_pendingAppendData.append(data, size); | 413 m_pendingAppendData.append(data, size); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 // 12. Queue a task to fire a simple event named updateend at this SourceBuf
fer object. | 474 // 12. Queue a task to fire a simple event named updateend at this SourceBuf
fer object. |
| 475 scheduleEvent(eventNames().updateendEvent); | 475 scheduleEvent(eventNames().updateendEvent); |
| 476 } | 476 } |
| 477 | 477 |
| 478 void SourceBuffer::appendStreamInternal(PassRefPtr<Stream> stream, ExceptionStat
e& es) | 478 void SourceBuffer::appendStreamInternal(PassRefPtr<Stream> stream, ExceptionStat
e& es) |
| 479 { | 479 { |
| 480 // Section 3.2 appendStream() | 480 // Section 3.2 appendStream() |
| 481 // 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 | 481 // 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 |
| 482 // 1. If stream is null then throw an InvalidAccessError exception and abort
these steps. | 482 // 1. If stream is null then throw an InvalidAccessError exception and abort
these steps. |
| 483 if (!stream || stream->isNeutered()) { | 483 if (!stream || stream->isNeutered()) { |
| 484 es.throwDOMException(InvalidAccessError); | 484 es.throwUninformativeAndGenericDOMException(InvalidAccessError); |
| 485 return; | 485 return; |
| 486 } | 486 } |
| 487 | 487 |
| 488 // 2. Run the prepare append algorithm. | 488 // 2. Run the prepare append algorithm. |
| 489 // Section 3.5.4 Prepare Append Algorithm. | 489 // Section 3.5.4 Prepare Append Algorithm. |
| 490 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-so
urce.html#sourcebuffer-prepare-append | 490 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-so
urce.html#sourcebuffer-prepare-append |
| 491 // 1. If this object has been removed from the sourceBuffers attribute of t
he parent media source then throw an InvalidStateError exception and abort these
steps. | 491 // 1. If this object has been removed from the sourceBuffers attribute of t
he parent media source then throw an InvalidStateError exception and abort these
steps. |
| 492 // 2. If the updating attribute equals true, then throw an InvalidStateErro
r exception and abort these steps. | 492 // 2. If the updating attribute equals true, then throw an InvalidStateErro
r exception and abort these steps. |
| 493 if (isRemoved() || m_updating) { | 493 if (isRemoved() || m_updating) { |
| 494 es.throwDOMException(InvalidStateError); | 494 es.throwUninformativeAndGenericDOMException(InvalidStateError); |
| 495 return; | 495 return; |
| 496 } | 496 } |
| 497 | 497 |
| 498 // 3. If the readyState attribute of the parent media source is in the "end
ed" state then run the following steps: ... | 498 // 3. If the readyState attribute of the parent media source is in the "end
ed" state then run the following steps: ... |
| 499 m_source->openIfInEndedState(); | 499 m_source->openIfInEndedState(); |
| 500 | 500 |
| 501 // Steps 4-5 of the prepare append algorithm are handled by m_private. | 501 // Steps 4-5 of the prepare append algorithm are handled by m_private. |
| 502 | 502 |
| 503 // 3. Set the updating attribute to true. | 503 // 3. Set the updating attribute to true. |
| 504 m_updating = true; | 504 m_updating = true; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 appendStreamDone(true); | 599 appendStreamDone(true); |
| 600 } | 600 } |
| 601 | 601 |
| 602 void SourceBuffer::didFail(FileError::ErrorCode errorCode) | 602 void SourceBuffer::didFail(FileError::ErrorCode errorCode) |
| 603 { | 603 { |
| 604 LOG(Media, "SourceBuffer::didFail(%d) %p", errorCode, this); | 604 LOG(Media, "SourceBuffer::didFail(%d) %p", errorCode, this); |
| 605 appendStreamDone(false); | 605 appendStreamDone(false); |
| 606 } | 606 } |
| 607 | 607 |
| 608 } // namespace WebCore | 608 } // namespace WebCore |
| OLD | NEW |