| 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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 bool isActive = (sourceBuffer->videoTracks().selectedIndex() != -1) || | 479 bool isActive = (sourceBuffer->videoTracks().selectedIndex() != -1) || |
| 480 sourceBuffer->audioTracks().hasEnabledTrack(); | 480 sourceBuffer->audioTracks().hasEnabledTrack(); |
| 481 setSourceBufferActive(sourceBuffer, isActive); | 481 setSourceBufferActive(sourceBuffer, isActive); |
| 482 } | 482 } |
| 483 | 483 |
| 484 void MediaSource::setDuration(double duration, ExceptionState& exceptionState) { | 484 void MediaSource::setDuration(double duration, ExceptionState& exceptionState) { |
| 485 // 2.1 https://www.w3.org/TR/media-source/#widl-MediaSource-duration | 485 // 2.1 https://www.w3.org/TR/media-source/#widl-MediaSource-duration |
| 486 // 1. If the value being set is negative or NaN then throw a TypeError | 486 // 1. If the value being set is negative or NaN then throw a TypeError |
| 487 // exception and abort these steps. | 487 // exception and abort these steps. |
| 488 if (std::isnan(duration)) { | 488 if (std::isnan(duration)) { |
| 489 logAndThrowTypeError(exceptionState, ExceptionMessages::notAFiniteNumber( | 489 logAndThrowTypeError( |
| 490 duration, "duration")); | 490 exceptionState, |
| 491 ExceptionMessages::notAFiniteNumber(duration, "duration")); |
| 491 return; | 492 return; |
| 492 } | 493 } |
| 493 if (duration < 0.0) { | 494 if (duration < 0.0) { |
| 494 logAndThrowTypeError( | 495 logAndThrowTypeError( |
| 495 exceptionState, | 496 exceptionState, |
| 496 ExceptionMessages::indexExceedsMinimumBound("duration", duration, 0.0)); | 497 ExceptionMessages::indexExceedsMinimumBound("duration", duration, 0.0)); |
| 497 return; | 498 return; |
| 498 } | 499 } |
| 499 | 500 |
| 500 // 2. If the readyState attribute is not "open" then throw an | 501 // 2. If the readyState attribute is not "open" then throw an |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 event->setTarget(this); | 812 event->setTarget(this); |
| 812 | 813 |
| 813 m_asyncEventQueue->enqueueEvent(event); | 814 m_asyncEventQueue->enqueueEvent(event); |
| 814 } | 815 } |
| 815 | 816 |
| 816 URLRegistry& MediaSource::registry() const { | 817 URLRegistry& MediaSource::registry() const { |
| 817 return MediaSourceRegistry::registry(); | 818 return MediaSourceRegistry::registry(); |
| 818 } | 819 } |
| 819 | 820 |
| 820 } // namespace blink | 821 } // namespace blink |
| OLD | NEW |