Bug 1289301 - Remove the call to Shutdown() from MediaDecoder::NetworkError(). r?cpearce
MozReview-Commit-ID: EuDKW2KZQ9n
--- 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;