Bug 1289301 - Remove the call to Shutdown() from MediaDecoder::NetworkError(). r=cpearce
authorJW Wang <jwwang@mozilla.com>
Tue, 26 Jul 2016 14:33:16 +0800
changeset 331943 72f738a49d10cb5db41b11483eead53af7b5384c
parent 331942 277d6fc32922740a6324b11ab29b82939f5aca90
child 331944 b582a8dc13c39e25854f728e0b5f2598008b179b
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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;