Bug 1287244: [MSE] Remove check for not 'updating' in {set,clear}LiveSeekableRange(). r?gerald draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Sat, 16 Jul 2016 14:35:02 +1000
changeset 388532 5d680974cf48a3d8889f4925a12efaaf287b9570
parent 388531 83f1446b1e07072eed556d825a6f027f926fda0c
child 525569 e16711525cdf1202441a826ac69e1137e62c463f
push id23197
push userbmo:jyavenard@mozilla.com
push dateSat, 16 Jul 2016 04:35:44 +0000
reviewersgerald
bugs1287244
milestone50.0a1
Bug 1287244: [MSE] Remove check for not 'updating' in {set,clear}LiveSeekableRange(). r?gerald See https://github.com/w3c/media-source/issues/118 MozReview-Commit-ID: FtIc1cVfn8R
dom/media/mediasource/MediaSource.cpp
--- a/dom/media/mediasource/MediaSource.cpp
+++ b/dom/media/mediasource/MediaSource.cpp
@@ -364,57 +364,49 @@ MediaSource::Enabled(JSContext* cx, JSOb
 
 void
 MediaSource::SetLiveSeekableRange(double aStart, double aEnd, ErrorResult& aRv)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   // 1. If the readyState attribute is not "open" then throw an InvalidStateError
   // exception and abort these steps.
-  // 2. If the updating attribute equals true on any SourceBuffer in
-  // sourceBuffers, then throw an InvalidStateError exception and abort these
-  // steps.
-  if (mReadyState != MediaSourceReadyState::Open ||
-      mSourceBuffers->AnyUpdating()) {
+  if (mReadyState != MediaSourceReadyState::Open) {
     aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
     return;
   }
 
-  // 3. If start is negative or greater than end, then throw a TypeError
+  // 2. If start is negative or greater than end, then throw a TypeError
   // exception and abort these steps.
   if (aStart < 0 || aStart > aEnd) {
     aRv.Throw(NS_ERROR_DOM_TYPE_ERR);
     return;
   }
 
-  // 4. Set live seekable range to be a new normalized TimeRanges object
+  // 3. Set live seekable range to be a new normalized TimeRanges object
   // containing a single range whose start position is start and end position is
   // end.
   mLiveSeekableRange =
     Some(media::TimeInterval(media::TimeUnit::FromSeconds(aStart),
                              media::TimeUnit::FromSeconds(aEnd)));
 }
 
 void
 MediaSource::ClearLiveSeekableRange(ErrorResult& aRv)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   // 1. If the readyState attribute is not "open" then throw an InvalidStateError
   // exception and abort these steps.
-  // 2. If the updating attribute equals true on any SourceBuffer in
-  // sourceBuffers, then throw an InvalidStateError exception and abort these
-  // steps.
-  if (mReadyState != MediaSourceReadyState::Open ||
-      mSourceBuffers->AnyUpdating()) {
+  if (mReadyState != MediaSourceReadyState::Open) {
     aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
     return;
   }
 
-  // 3. If live seekable range contains a range, then set live seekable range to
+  // 2. If live seekable range contains a range, then set live seekable range to
   // be a new empty TimeRanges object.
   mLiveSeekableRange.reset();
 }
 
 bool
 MediaSource::Attach(MediaSourceDecoder* aDecoder)
 {
   MOZ_ASSERT(NS_IsMainThread());