Bug 1289295 - Remove the call to Shutdown() from MediaDecoder::DecodeError(). r=cpearce
authorJW Wang <jwwang@mozilla.com>
Tue, 26 Jul 2016 14:18:47 +0800
changeset 346907 4d52a4c41a7754ef4c14f4f02b3273a5469de156
parent 346906 ffc7874fcb7ef819f55c29172fb2fb09589c2405
child 346908 277d6fc32922740a6324b11ab29b82939f5aca90
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1289295
milestone50.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 1289295 - Remove the call to Shutdown() from MediaDecoder::DecodeError(). r=cpearce MozReview-Commit-ID: DcpaEFEsaWD
dom/media/MediaDecoder.cpp
dom/media/MediaDecoderOwner.h
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1047,17 +1047,17 @@ MediaDecoder::NetworkError()
 }
 
 void
 MediaDecoder::DecodeError()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!IsShutdown());
   mOwner->DecodeError();
-  Shutdown();
+  MOZ_ASSERT(IsShutdown());
 }
 
 void
 MediaDecoder::UpdateSameOriginStatus(bool aSameOrigin)
 {
   MOZ_ASSERT(NS_IsMainThread());
   mSameOriginMedia = aSameOrigin;
 }
--- a/dom/media/MediaDecoderOwner.h
+++ b/dom/media/MediaDecoderOwner.h
@@ -56,18 +56,20 @@ public:
   // 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,
   // when the resource has a network error during loading.
   virtual void NetworkError() = 0;
 
-  // Called by the video decoder object, on the main thread, when the
+  // 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;
 
   // Return true if media element error attribute is not null.
   virtual bool HasError() const = 0;
 
   // Called by the video decoder object, on the main thread, when the
   // resource load has been cancelled.
   virtual void LoadAborted() = 0;