Bug 716140 - imgDecoderObserver::OnDataAvailable is simply a duplicate of imgDecoderObserver::FrameUpdated, so remove it. r=seth
authorJoe Drew <joe@drew.ca>
Fri, 18 Jan 2013 16:47:17 -0500
changeset 132051 45d8ebb295435b7e811b2c1ca3e02481199b8773
parent 132050 384efd041a377420a76d480b139bf66030ad92d9
child 132052 94af4b2dd18226b5c75c3874d3e224c920af3bcc
push idunknown
push userunknown
push dateunknown
reviewersseth
bugs716140
milestone22.0a1
Bug 716140 - imgDecoderObserver::OnDataAvailable is simply a duplicate of imgDecoderObserver::FrameUpdated, so remove it. r=seth
image/src/Decoder.cpp
image/src/imgDecoderObserver.h
image/src/imgStatusTracker.cpp
image/src/imgStatusTracker.h
--- a/image/src/Decoder.cpp
+++ b/image/src/Decoder.cpp
@@ -153,33 +153,32 @@ Decoder::FlushInvalidations()
 
   // If we've got an empty invalidation rect, we have nothing to do
   if (mInvalidRect.IsEmpty())
     return;
 
   // Tell the image that it's been updated
   mImage.FrameUpdated(mFrameCount - 1, mInvalidRect);
 
-  // Fire OnDataAvailable
   if (mObserver) {
 #ifdef XP_MACOSX
     // Bug 703231
     // Because of high quality down sampling on mac we show scan lines while decoding.
     // Bypass this problem by redrawing the border.
     int32_t width;
     int32_t height;
 
     mImage.GetWidth(&width);
     mImage.GetHeight(&height);
     nsIntRect mImageBound(0, 0, width, height);
 
     mInvalidRect.Inflate(1);
     mInvalidRect = mInvalidRect.Intersect(mImageBound);
 #endif
-    mObserver->OnDataAvailable(&mInvalidRect);
+    mObserver->FrameChanged(&mInvalidRect);
   }
 
   // Clear the invalidation rectangle
   mInvalidRect.SetEmpty();
 }
 
 /*
  * Hook stubs. Override these as necessary in decoder implementations.
--- a/image/src/imgDecoderObserver.h
+++ b/image/src/imgDecoderObserver.h
@@ -65,18 +65,16 @@ public:
    */
   virtual void OnStartContainer() = 0;
 
   /**
    * Decode notification.
    *
    * called when there is more to paint.
    */
-  virtual void OnDataAvailable(const nsIntRect * aRect) = 0;
-
   virtual void FrameChanged(const nsIntRect * aDirtyRect) = 0;
 
   /**
    * Decode notification.
    *
    * called when a frame is finished decoding.
    */
   virtual void OnStopFrame() = 0;
--- a/image/src/imgStatusTracker.cpp
+++ b/image/src/imgStatusTracker.cpp
@@ -71,30 +71,16 @@ public:
     mTracker->RecordStartContainer(mTracker->GetImage());
 
     nsTObserverArray<imgRequestProxy*>::ForwardIterator iter(mTracker->mConsumers);
     while (iter.HasMore()) {
       mTracker->SendStartContainer(iter.GetNext());
     }
   }
 
-  virtual void OnDataAvailable(const nsIntRect* rect)
-  {
-    LOG_SCOPE(GetImgLog(), "imgStatusTrackerObserver::OnDataAvailable");
-    NS_ABORT_IF_FALSE(mTracker->GetImage(),
-                      "OnDataAvailable callback before we've created our image");
-
-    mTracker->RecordDataAvailable();
-
-    nsTObserverArray<imgRequestProxy*>::ForwardIterator iter(mTracker->mConsumers);
-    while (iter.HasMore()) {
-      mTracker->SendDataAvailable(iter.GetNext(), rect);
-    }
-  }
-
   virtual void FrameChanged(const nsIntRect* dirtyRect)
   {
     LOG_SCOPE(GetImgLog(), "imgStatusTrackerObserver::FrameChanged");
     NS_ABORT_IF_FALSE(mTracker->GetImage(),
                       "FrameChanged callback before we've created our image");
 
     mTracker->RecordFrameChanged(dirtyRect);
 
@@ -369,17 +355,17 @@ imgStatusTracker::SyncNotify(imgRequestP
   if (mState & stateDecodeStarted)
     proxy->OnStartDecode();
 
   // BlockOnload
   if (mState & stateBlockingOnload)
     proxy->BlockOnload();
 
   if (mImage) {
-    // OnDataAvailable
+    // OnFrameUpdate
     // XXX - Should only send partial rects here, but that needs to
     // wait until we fix up the observer interface
     nsIntRect r(mImage->FrameRect(imgIContainer::FRAME_CURRENT));
 
     // If there's any content in this frame at all (always true for
     // vector images, true for raster images that have decoded at
     // least one frame) then send OnFrameUpdate.
     if (!r.IsEmpty())
@@ -502,34 +488,16 @@ imgStatusTracker::RecordStartContainer(i
 void
 imgStatusTracker::SendStartContainer(imgRequestProxy* aProxy)
 {
   if (!aProxy->NotificationsDeferred())
     aProxy->OnStartContainer();
 }
 
 void
-imgStatusTracker::RecordDataAvailable()
-{
-  NS_ABORT_IF_FALSE(mImage,
-                    "RecordDataAvailable called before we have an Image");
-  // no bookkeeping necessary here - this is implied by imgIContainer's
-  // number of frames and frame rect
-}
-
-void
-imgStatusTracker::SendDataAvailable(imgRequestProxy* aProxy,
-                                    const nsIntRect* aRect)
-{
-  if (!aProxy->NotificationsDeferred())
-    aProxy->OnFrameUpdate(aRect);
-}
-
-
-void
 imgStatusTracker::RecordStopFrame()
 {
   NS_ABORT_IF_FALSE(mImage, "RecordStopFrame called before we have an Image");
   mState |= stateFrameStopped;
   mImageStatus |= imgIRequest::STATUS_FRAME_COMPLETE;
 }
 
 void
--- a/image/src/imgStatusTracker.h
+++ b/image/src/imgStatusTracker.h
@@ -130,18 +130,16 @@ public:
   // StartFrame, DataAvailable, StopFrame, StopDecode.
   void RecordDecoded();
 
   /* non-virtual imgDecoderObserver methods */
   void RecordStartDecode();
   void SendStartDecode(imgRequestProxy* aProxy);
   void RecordStartContainer(imgIContainer* aContainer);
   void SendStartContainer(imgRequestProxy* aProxy);
-  void RecordDataAvailable();
-  void SendDataAvailable(imgRequestProxy* aProxy, const nsIntRect* aRect);
   void RecordFrameChanged(const nsIntRect* aDirtyRect);
   void SendFrameChanged(imgRequestProxy* aProxy, const nsIntRect* aDirtyRect);
   void RecordStopFrame();
   void SendStopFrame(imgRequestProxy* aProxy);
   void RecordStopDecode(nsresult statusg);
   void SendStopDecode(imgRequestProxy* aProxy, nsresult aStatus);
   void RecordDiscard();
   void SendDiscard(imgRequestProxy* aProxy);