Bug 1289301 - Remove the call to Shutdown() from MediaDecoder::NetworkError(). r?cpearce draft
authorJW Wang <jwwang@mozilla.com>
Tue, 26 Jul 2016 14:33:16 +0800
changeset 393587 7215fd58dd86dd0c20857039d60b1e6ab38f1ee0
parent 393586 d8d6a3a7e037bf7d1120f9c7a09b2ace8ed2d653
child 393588 faf77534b0dc1a122b860f27688beea1685607fe
push id24352
push userjwwang@mozilla.com
push dateThu, 28 Jul 2016 02:15:02 +0000
reviewerscpearce
bugs1289301
milestone50.0a1
Bug 1289301 - Remove the call to Shutdown() from MediaDecoder::NetworkError(). r?cpearce MozReview-Commit-ID: EuDKW2KZQ9n
dom/media/MediaDecoder.cpp
dom/media/MediaDecoderOwner.h
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1036,17 +1036,17 @@ MediaDecoder::ResetConnectionState()
 }
 
 void
 MediaDecoder::NetworkError()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!IsShutdown());
   mOwner->NetworkError();
-  Shutdown();
+  MOZ_ASSERT(IsShutdown());
 }
 
 void
 MediaDecoder::DecodeError()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!IsShutdown());
   mOwner->DecodeError();
--- a/dom/media/MediaDecoderOwner.h
+++ b/dom/media/MediaDecoderOwner.h
@@ -52,18 +52,20 @@ public:
   // Must take ownership of MetadataTags aTags argument.
   virtual void MetadataLoaded(const MediaInfo* aInfo,
                               nsAutoPtr<const MetadataTags> aTags) = 0;
 
   // Called by the decoder object, on the main thread,
   // when it has read the first frame of the video or audio.
   virtual void FirstFrameLoaded() = 0;
 
-  // Called by the video decoder object, on the main thread,
+  // Called by the decoder object, on the main thread,
   // when the resource has a network error during loading.
+  // The decoder owner should call Shutdown() on the decoder and drop the
+  // reference to the decoder to prevent further calls into the decoder.
   virtual void NetworkError() = 0;
 
   // Called by the decoder object, on the main thread, when the
   // resource has a decode error during metadata loading or decoding.
   // The decoder owner should call Shutdown() on the decoder and drop the
   // reference to the decoder to prevent further calls into the decoder.
   virtual void DecodeError() = 0;