Bug 1462272: Remove an unneeded and ugly reinterpret_cast. r?dholbert draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 16 May 2018 20:10:14 +0200
changeset 796232 1e56644b7824e870ca23a842f2f5a8e56c9759d2
parent 796231 160c2379a949df2f49eda5c97192309f2feda775
child 796233 4b93479ae3a2478e348da910fdbf102ec59fa52f
push id110185
push userbmo:emilio@crisal.io
push dateThu, 17 May 2018 09:02:34 +0000
reviewersdholbert
bugs1462272
milestone62.0a1
Bug 1462272: Remove an unneeded and ugly reinterpret_cast. r?dholbert MozReview-Commit-ID: Evip43nwNii
layout/generic/nsImageFrame.cpp
layout/generic/nsImageFrame.h
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -209,17 +209,17 @@ nsImageFrame::DestroyFrom(nsIFrame* aDes
     if (imageLoader) {
       // Notify our image loading content that we are going away so it can
       // deregister with our refresh driver.
       imageLoader->FrameDestroyed(this);
 
       imageLoader->RemoveNativeObserver(mListener);
     }
 
-    reinterpret_cast<nsImageListener*>(mListener.get())->SetFrame(nullptr);
+    mListener->SetFrame(nullptr);
   }
 
   mListener = nullptr;
 
   // If we were displaying an icon, take ourselves off the list
   if (mDisplayingIcon)
     gIconLoad->RemoveIconObserver(this);
 
--- a/layout/generic/nsImageFrame.h
+++ b/layout/generic/nsImageFrame.h
@@ -324,17 +324,17 @@ private:
    * @param aFrameInvalidRect The area to invalidate in frame space. If null, the
    *                          entire frame will be invalidated.
    */
   void InvalidateSelf(const nsIntRect* aLayerInvalidRect,
                       const nsRect* aFrameInvalidRect);
 
   RefPtr<nsImageMap> mImageMap;
 
-  nsCOMPtr<imgINotificationObserver> mListener;
+  RefPtr<nsImageListener> mListener;
 
   nsCOMPtr<imgIContainer> mImage;
   nsCOMPtr<imgIContainer> mPrevImage;
   nsSize mComputedSize;
   mozilla::IntrinsicSize mIntrinsicSize;
   nsSize mIntrinsicRatio;
 
   bool mDisplayingIcon;