Chromium Code Reviews| 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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 523 } | 523 } |
| 524 | 524 |
| 525 void MediaSource::setLiveSeekableRange(double start, double end, ExceptionState& exceptionState) | 525 void MediaSource::setLiveSeekableRange(double start, double end, ExceptionState& exceptionState) |
| 526 { | 526 { |
| 527 // http://w3c.github.io/media-source/#widl-MediaSource-setLiveSeekableRange- void-double-start-double-end | 527 // http://w3c.github.io/media-source/#widl-MediaSource-setLiveSeekableRange- void-double-start-double-end |
| 528 // 1. If the readyState attribute is not "open" then throw an | 528 // 1. If the readyState attribute is not "open" then throw an |
| 529 // InvalidStateError exception and abort these steps. | 529 // InvalidStateError exception and abort these steps. |
| 530 // 2. If the updating attribute equals true on any SourceBuffer in | 530 // 2. If the updating attribute equals true on any SourceBuffer in |
| 531 // SourceBuffers, then throw an InvalidStateError exception and abort | 531 // SourceBuffers, then throw an InvalidStateError exception and abort |
| 532 // these steps. | 532 // these steps. |
| 533 if (throwExceptionIfClosedOrUpdating(isOpen(), isUpdating(), exceptionState) ) | 533 // Note: With anticipated change to remove this 'updating' check to fix |
|
chcunningham
2016/07/13 19:24:06
Nit: this is hard to read. If you make a separate
wolenetz
2016/07/13 19:51:54
Done.
| |
| 534 // spec issue https://github.com/w3c/media-source/issues/118, this method | |
| 535 // fakes that we are not 'updating' to pass that check. | |
| 536 if (throwExceptionIfClosedOrUpdating(isOpen(), false, exceptionState)) | |
| 534 return; | 537 return; |
| 535 | 538 |
| 536 // 3. If start is negative or greater than end, then throw a TypeError | 539 // 3. If start is negative or greater than end, then throw a TypeError |
| 537 // exception and abort these steps. | 540 // exception and abort these steps. |
| 538 if (start < 0 || start > end) { | 541 if (start < 0 || start > end) { |
| 539 exceptionState.throwTypeError(ExceptionMessages::indexOutsideRange("star t value", start, 0.0, ExceptionMessages::InclusiveBound, end, ExceptionMessages: :InclusiveBound)); | 542 exceptionState.throwTypeError(ExceptionMessages::indexOutsideRange("star t value", start, 0.0, ExceptionMessages::InclusiveBound, end, ExceptionMessages: :InclusiveBound)); |
| 540 return; | 543 return; |
| 541 } | 544 } |
| 542 | 545 |
| 543 // 4. Set live seekable range to be a new normalized TimeRanges object | 546 // 4. Set live seekable range to be a new normalized TimeRanges object |
| 544 // containing a single range whose start position is start and end | 547 // containing a single range whose start position is start and end |
| 545 // position is end. | 548 // position is end. |
| 546 m_liveSeekableRange = TimeRanges::create(start, end); | 549 m_liveSeekableRange = TimeRanges::create(start, end); |
| 547 } | 550 } |
| 548 | 551 |
| 549 void MediaSource::clearLiveSeekableRange(ExceptionState& exceptionState) | 552 void MediaSource::clearLiveSeekableRange(ExceptionState& exceptionState) |
| 550 { | 553 { |
| 551 // http://w3c.github.io/media-source/#widl-MediaSource-clearLiveSeekableRang e-void | 554 // http://w3c.github.io/media-source/#widl-MediaSource-clearLiveSeekableRang e-void |
| 552 // 1. If the readyState attribute is not "open" then throw an | 555 // 1. If the readyState attribute is not "open" then throw an |
| 553 // InvalidStateError exception and abort these steps. | 556 // InvalidStateError exception and abort these steps. |
| 554 // 2. If the updating attribute equals true on any SourceBuffer in | 557 // 2. If the updating attribute equals true on any SourceBuffer in |
| 555 // SourceBuffers, then throw an InvalidStateError exception and abort | 558 // SourceBuffers, then throw an InvalidStateError exception and abort |
| 556 // these steps. | 559 // these steps. |
| 557 if (throwExceptionIfClosedOrUpdating(isOpen(), isUpdating(), exceptionState) ) | 560 // Note: With anticipated change to remove this 'updating' check to fix |
| 561 // spec issue https://github.com/w3c/media-source/issues/118, this method | |
| 562 // fakes that we are not 'updating' to pass that check. | |
| 563 if (throwExceptionIfClosedOrUpdating(isOpen(), false, exceptionState)) | |
| 558 return; | 564 return; |
| 559 | 565 |
| 560 // 3. If live seekable range contains a range, then set live seekable range | 566 // 3. If live seekable range contains a range, then set live seekable range |
| 561 // to be a new empty TimeRanges object. | 567 // to be a new empty TimeRanges object. |
| 562 if (m_liveSeekableRange->length() != 0) | 568 if (m_liveSeekableRange->length() != 0) |
| 563 m_liveSeekableRange = TimeRanges::create(); | 569 m_liveSeekableRange = TimeRanges::create(); |
| 564 } | 570 } |
| 565 | 571 |
| 566 void MediaSource::endOfStreamInternal(const WebMediaSource::EndOfStreamStatus eo sStatus, ExceptionState& exceptionState) | 572 void MediaSource::endOfStreamInternal(const WebMediaSource::EndOfStreamStatus eo sStatus, ExceptionState& exceptionState) |
| 567 { | 573 { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 697 | 703 |
| 698 m_asyncEventQueue->enqueueEvent(event); | 704 m_asyncEventQueue->enqueueEvent(event); |
| 699 } | 705 } |
| 700 | 706 |
| 701 URLRegistry& MediaSource::registry() const | 707 URLRegistry& MediaSource::registry() const |
| 702 { | 708 { |
| 703 return MediaSourceRegistry::registry(); | 709 return MediaSourceRegistry::registry(); |
| 704 } | 710 } |
| 705 | 711 |
| 706 } // namespace blink | 712 } // namespace blink |
| OLD | NEW |