Bug 1427699. P1 - allow element->DownloadSuspended() to be called when mChannel is null. r=gerald
authorJW Wang <jwwang@mozilla.com>
Fri, 05 Jan 2018 16:04:16 +0800
changeset 449914 15c31a08d6e3d530c0ed84bc162f5370d2e5ce29
parent 449913 2698d1eb51ab0ffa2680a5a22ca89df1e7affe9c
child 449915 8932f0853269bfdaf7cc043ae4b1167a1cf28ad0
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1427699
milestone59.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 1427699. P1 - allow element->DownloadSuspended() to be called when mChannel is null. r=gerald This is required by P2 where we want to notify the 'suspend' event for a cloned resource whose mChannel is initially null. MozReview-Commit-ID: 3znDl2TqlqK
dom/media/ChannelMediaResource.cpp
--- a/dom/media/ChannelMediaResource.cpp
+++ b/dom/media/ChannelMediaResource.cpp
@@ -646,23 +646,20 @@ ChannelMediaResource::Suspend(bool aClos
 
   MediaDecoderOwner* owner = mCallback->GetMediaOwner();
   MOZ_DIAGNOSTIC_ASSERT(owner);
   dom::HTMLMediaElement* element = owner->GetMediaElement();
   MOZ_DIAGNOSTIC_ASSERT(element);
 
   if (mChannel && aCloseImmediately && mIsTransportSeekable) {
     CloseChannel();
-    element->DownloadSuspended();
   }
 
   if (mSuspendAgent.Suspend()) {
-    if (mChannel) {
-      element->DownloadSuspended();
-    }
+    element->DownloadSuspended();
   }
 }
 
 void
 ChannelMediaResource::Resume()
 {
   NS_ASSERTION(NS_IsMainThread(), "Don't call on non-main thread");