Bug 1175395: P1. Reject append promise early. r=kentuckyfriedtakahe
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 17 Jun 2015 15:07:33 +1000
changeset 267822 a64d14d0bf260a2e29bd23ad2f29b657c2dcfa11
parent 267821 d7aad45010b6adac72489dd2338606a90d76b87b
child 267823 a519d1f3064e2562435f631cb891325477ecf94d
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskentuckyfriedtakahe
bugs1175395
milestone41.0a1
Bug 1175395: P1. Reject append promise early. r=kentuckyfriedtakahe So the next call to appendBuffer following an abort() is guaranteed to succeed.
dom/media/mediasource/TrackBuffersManager.cpp
--- a/dom/media/mediasource/TrackBuffersManager.cpp
+++ b/dom/media/mediasource/TrackBuffersManager.cpp
@@ -329,16 +329,19 @@ TrackBuffersManager::CompleteResetParser
     // to mInputBuffer as it will get modified in the Segment Parser Loop.
     mInputBuffer = new MediaByteBuffer;
     mInputBuffer->AppendElements(*mInitData);
   }
   RecreateParser();
 
   // 7. Set append state to WAITING_FOR_SEGMENT.
   SetAppendState(AppendState::WAITING_FOR_SEGMENT);
+
+  // Reject our promise immediately.
+  mAppendPromise.RejectIfExists(NS_ERROR_ABORT, __func__);
 }
 
 void
 TrackBuffersManager::DoEvictData(const TimeUnit& aPlaybackTime,
                                  uint32_t aSizeToEvict)
 {
   MOZ_ASSERT(OnTaskQueue());