Bug 1398659. P3 - ChannelMediaResource::Open() is a no-op for a cloned resource. r=gerald
authorJW Wang <jwwang@mozilla.com>
Tue, 05 Sep 2017 17:35:24 +0800
changeset 662277 2a71c9276c31863aee681682b78679437f94fe70
parent 662276 3928ea56c1d334d0b5e550639004bec6a6b27dda
child 662278 bd93f2e8986baa83c634612dc013a4d42781b09d
push id79014
push userbmo:bpostelnicu@mozilla.com
push dateMon, 11 Sep 2017 09:58:20 +0000
reviewersgerald
bugs1398659
milestone57.0a1
Bug 1398659. P3 - ChannelMediaResource::Open() is a no-op for a cloned resource. r=gerald 1. mChannel is null. 2. mCacheStream has been initialized by InitAsClone(). So ChannelMediaDecoder::Load() doesn't need to call OpenResource(nullptr) at all. MozReview-Commit-ID: FeARp9fu65L
dom/media/ChannelMediaDecoder.cpp
--- a/dom/media/ChannelMediaDecoder.cpp
+++ b/dom/media/ChannelMediaDecoder.cpp
@@ -278,19 +278,16 @@ ChannelMediaDecoder::Load(BaseMediaResou
     return NS_ERROR_FAILURE;
   }
 
   nsresult rv = MediaShutdownManager::Instance().Register(this);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-  rv = OpenResource(nullptr);
-  NS_ENSURE_SUCCESS(rv, rv);
-
   SetStateMachine(CreateStateMachine());
   NS_ENSURE_TRUE(GetStateMachine(), NS_ERROR_FAILURE);
 
   return InitializeStateMachine();
 }
 
 void
 ChannelMediaDecoder::NotifyDownloadEnded(nsresult aStatus)