Bug 1373589 - Remove MediaResourceCallback::NotifyDecodeError which has no callers at all. draft
authorJW Wang <jwwang@mozilla.com>
Fri, 16 Jun 2017 17:36:30 +0800
changeset 596263 f8372b006d81438544ad2da81029e3a3921d468a
parent 595498 d548ae3fb235cec909eb4933b605ecb67453ac6a
child 596265 7ca6fa4677c61c3cef6e3a1f9d9b2c869bc05120
push id64561
push userjwwang@mozilla.com
push dateMon, 19 Jun 2017 02:44:04 +0000
bugs1373589
milestone56.0a1
Bug 1373589 - Remove MediaResourceCallback::NotifyDecodeError which has no callers at all. MozReview-Commit-ID: D2xqWHIiRBv
dom/media/MediaDecoder.cpp
dom/media/MediaDecoder.h
dom/media/MediaResourceCallback.h
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -181,28 +181,16 @@ void
 MediaDecoder::ResourceCallback::NotifyNetworkError()
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (mDecoder) {
     mDecoder->NetworkError();
   }
 }
 
-void
-MediaDecoder::ResourceCallback::NotifyDecodeError()
-{
-  RefPtr<ResourceCallback> self = this;
-  nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([=] () {
-    if (self->mDecoder) {
-      self->mDecoder->DecodeError(NS_ERROR_DOM_MEDIA_FATAL_ERR);
-    }
-  });
-  mAbstractMainThread->Dispatch(r.forget());
-}
-
 /* static */ void
 MediaDecoder::ResourceCallback::TimerCallback(nsITimer* aTimer, void* aClosure)
 {
   MOZ_ASSERT(NS_IsMainThread());
   ResourceCallback* thiz = static_cast<ResourceCallback*>(aClosure);
   MOZ_ASSERT(thiz->mDecoder);
   thiz->mDecoder->NotifyDataArrived();
   thiz->mTimerArmed = false;
--- a/dom/media/MediaDecoder.h
+++ b/dom/media/MediaDecoder.h
@@ -106,17 +106,16 @@ public:
     // Called upon shutdown to stop receiving notifications.
     void Disconnect();
 
   private:
     /* MediaResourceCallback functions */
     MediaDecoderOwner* GetMediaOwner() const override;
     void SetInfinite(bool aInfinite) override;
     void NotifyNetworkError() override;
-    void NotifyDecodeError() override;
     void NotifyDataArrived() override;
     void NotifyBytesDownloaded() override;
     void NotifyDataEnded(nsresult aStatus) override;
     void NotifyPrincipalChanged() override;
     void NotifySuspendedStatusChanged() override;
     void NotifyBytesConsumed(int64_t aBytes, int64_t aOffset) override;
 
     static void TimerCallback(nsITimer* aTimer, void* aClosure);
--- a/dom/media/MediaResourceCallback.h
+++ b/dom/media/MediaResourceCallback.h
@@ -32,19 +32,16 @@ public:
   virtual MediaDecoderOwner* GetMediaOwner() const { return nullptr; }
 
   // Notify is duration is known to this MediaResource.
   virtual void SetInfinite(bool aInfinite) {}
 
   // Notify that a network error is encountered.
   virtual void NotifyNetworkError() {}
 
-  // Notify that decoding has failed.
-  virtual void NotifyDecodeError() {}
-
   // Notify that data arrives on the stream and is read into the cache.
   virtual void NotifyDataArrived() {}
 
   // Notify that MediaResource has received some data.
   virtual void NotifyBytesDownloaded() {}
 
   // Notify download is ended.
   // NOTE: this can be called with the media cache lock held, so don't