Bug 1287244: [MSE] Remove check for not 'updating' in {set,clear}LiveSeekableRange(). r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Sat, 16 Jul 2016 14:35:02 +1000
changeset 305203 aa16312b9dcf3a2658826145fcfc03cff411df17
parent 305202 1b3826196e7efc0c7442a02207ef833003de2dfe
child 305204 de45aca6e7cfd90777cfcb1524443039e1d22374
push id79518
push usercbook@mozilla.com
push dateSun, 17 Jul 2016 08:09:59 +0000
treeherdermozilla-inbound@711963e8daa3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1287244
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
@@ -368,57 +368,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());