Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2075)

Unified Diff: third_party/WebKit/Source/modules/mediasource/MediaSource.cpp

Issue 2144063002: MSE: Remove check for not 'updating' in {set,clear}LiveSeekableRange() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nit Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
diff --git a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
index ba2964942de764957c9bc970308265e1ee235388..4b5114982810509d756c22be66e1a1adb9c2b994 100644
--- a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
+++ b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
@@ -58,12 +58,21 @@ using blink::WebSourceBuffer;
namespace blink {
-static bool throwExceptionIfClosedOrUpdating(bool isOpen, bool isUpdating, ExceptionState& exceptionState)
+static bool throwExceptionIfClosed(bool isOpen, ExceptionState& exceptionState)
{
if (!isOpen) {
MediaSource::logAndThrowDOMException(exceptionState, InvalidStateError, "The MediaSource's readyState is not 'open'.");
return true;
}
+
+ return false;
+}
+
+static bool throwExceptionIfClosedOrUpdating(bool isOpen, bool isUpdating, ExceptionState& exceptionState)
+{
+ if (throwExceptionIfClosed(isOpen, exceptionState))
+ return true;
+
if (isUpdating) {
MediaSource::logAndThrowDOMException(exceptionState, InvalidStateError, "The 'updating' attribute is true on one or more of this MediaSource's SourceBuffers.");
return true;
@@ -530,7 +539,9 @@ void MediaSource::setLiveSeekableRange(double start, double end, ExceptionState&
// 2. If the updating attribute equals true on any SourceBuffer in
// SourceBuffers, then throw an InvalidStateError exception and abort
// these steps.
- if (throwExceptionIfClosedOrUpdating(isOpen(), isUpdating(), exceptionState))
+ // Note: https://github.com/w3c/media-source/issues/118, once fixed, will
+ // remove the updating check (step 2). We skip that check here already.
+ if (throwExceptionIfClosed(isOpen(), exceptionState))
return;
// 3. If start is negative or greater than end, then throw a TypeError
@@ -554,7 +565,9 @@ void MediaSource::clearLiveSeekableRange(ExceptionState& exceptionState)
// 2. If the updating attribute equals true on any SourceBuffer in
// SourceBuffers, then throw an InvalidStateError exception and abort
// these steps.
- if (throwExceptionIfClosedOrUpdating(isOpen(), isUpdating(), exceptionState))
+ // Note: https://github.com/w3c/media-source/issues/118, once fixed, will
+ // remove the updating check (step 2). We skip that check here already.
+ if (throwExceptionIfClosed(isOpen(), exceptionState))
return;
// 3. If live seekable range contains a range, then set live seekable range
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698