From 1192c9ff4dd86c1f96b22ed7aa036a2a753d9f25 Mon Sep 17 00:00:00 2001 From: JW Wang Date: Mon, 15 Jan 2018 10:25:11 +0800 Subject: [PATCH] Bug 1416084. P2 - wake up readers when download is suspended. r=bechen,gerald It is possible that download is suspended after all bytes are received but before OnStopRequest is notified. In that case, we will fail to wake up the readers waiting to read the partial block and cause bug 1412737 comment 30. MozReview-Commit-ID: GUk4lXO6Upk --HG-- extra : rebase_source : 2fc277fa54842e434c3f69a474c44fb4c58c976e --- dom/media/MediaCache.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dom/media/MediaCache.cpp b/dom/media/MediaCache.cpp index 22179f753baf..b24d988e79fc 100644 --- a/dom/media/MediaCache.cpp +++ b/dom/media/MediaCache.cpp @@ -2306,6 +2306,11 @@ MediaCacheStream::NotifyClientSuspended(bool aSuspended) // mClientSuspended changes the decision of reading streams. mMediaCache->QueueUpdate(lock); UpdateDownloadStatistics(lock); + if (mClientSuspended) { + // Download is suspended. Wake up the readers that might be able to + // get data from the partial block. + lock.NotifyAll(); + } } }); OwnerThread()->Dispatch(r.forget());