Bug 1112972 (Part 4) - Remove Image::OnNewSourceData. r=tn
authorSeth Fowler <seth@mozilla.com>
Wed, 07 Jan 2015 01:37:20 -0800
changeset 235454 82ff19dfa592e8713979896a2c416a38c263ef0b
parent 235453 d97d45fa892db7de628d721253e1e1a763122077
child 235455 da5084c9e3e640723ff9541da88fe150c294739c
push id366
push usercmanchester@mozilla.com
push dateThu, 08 Jan 2015 16:40:24 +0000
reviewerstn
bugs1112972
milestone37.0a1
Bug 1112972 (Part 4) - Remove Image::OnNewSourceData. r=tn
image/src/DynamicImage.cpp
image/src/DynamicImage.h
image/src/Image.h
image/src/ImageWrapper.cpp
image/src/ImageWrapper.h
image/src/RasterImage.cpp
image/src/RasterImage.h
image/src/VectorImage.cpp
image/src/VectorImage.h
--- a/image/src/DynamicImage.cpp
+++ b/image/src/DynamicImage.cpp
@@ -87,22 +87,16 @@ nsresult
 DynamicImage::OnImageDataComplete(nsIRequest* aRequest,
                                   nsISupports* aContext,
                                   nsresult aStatus,
                                   bool aLastPart)
 {
   return NS_OK;
 }
 
-nsresult
-DynamicImage::OnNewSourceData()
-{
-  return NS_OK;
-}
-
 void
 DynamicImage::OnSurfaceDiscarded()
 { }
 
 void
 DynamicImage::SetInnerWindowID(uint64_t aInnerWindowId)
 { }
 
--- a/image/src/DynamicImage.h
+++ b/image/src/DynamicImage.h
@@ -50,17 +50,16 @@ public:
                                         nsISupports* aContext,
                                         nsIInputStream* aInStr,
                                         uint64_t aSourceOffset,
                                         uint32_t aCount) MOZ_OVERRIDE;
   virtual nsresult OnImageDataComplete(nsIRequest* aRequest,
                                        nsISupports* aContext,
                                        nsresult aStatus,
                                        bool aLastPart) MOZ_OVERRIDE;
-  virtual nsresult OnNewSourceData() MOZ_OVERRIDE;
 
   virtual void OnSurfaceDiscarded() MOZ_OVERRIDE;
 
   virtual void SetInnerWindowID(uint64_t aInnerWindowId) MOZ_OVERRIDE;
   virtual uint64_t InnerWindowID() const MOZ_OVERRIDE;
 
   virtual bool HasError() MOZ_OVERRIDE;
   virtual void SetHasError() MOZ_OVERRIDE;
--- a/image/src/Image.h
+++ b/image/src/Image.h
@@ -121,22 +121,16 @@ public:
    * @param aLastPart Whether this is the final part of the underlying request.
    */
   virtual nsresult OnImageDataComplete(nsIRequest* aRequest,
                                        nsISupports* aContext,
                                        nsresult aStatus,
                                        bool aLastPart) = 0;
 
   /**
-   * Called for multipart images to allow for any necessary reinitialization
-   * when there's a new part to add.
-   */
-  virtual nsresult OnNewSourceData() = 0;
-
-  /**
    * Called when the SurfaceCache discards a persistent surface belonging to
    * this image.
    */
   virtual void OnSurfaceDiscarded() = 0;
 
   virtual void SetInnerWindowID(uint64_t aInnerWindowId) = 0;
   virtual uint64_t InnerWindowID() const = 0;
 
--- a/image/src/ImageWrapper.cpp
+++ b/image/src/ImageWrapper.cpp
@@ -92,22 +92,16 @@ ImageWrapper::OnImageDataComplete(nsIReq
                                   nsISupports* aContext,
                                   nsresult aStatus,
                                   bool aLastPart)
 {
   return mInnerImage->OnImageDataComplete(aRequest, aContext, aStatus,
                                           aLastPart);
 }
 
-nsresult
-ImageWrapper::OnNewSourceData()
-{
-  return mInnerImage->OnNewSourceData();
-}
-
 void
 ImageWrapper::OnSurfaceDiscarded()
 {
   return mInnerImage->OnSurfaceDiscarded();
 }
 
 void
 ImageWrapper::SetInnerWindowID(uint64_t aInnerWindowId)
--- a/image/src/ImageWrapper.h
+++ b/image/src/ImageWrapper.h
@@ -44,17 +44,16 @@ public:
                                         nsISupports* aContext,
                                         nsIInputStream* aInStr,
                                         uint64_t aSourceOffset,
                                         uint32_t aCount) MOZ_OVERRIDE;
   virtual nsresult OnImageDataComplete(nsIRequest* aRequest,
                                        nsISupports* aContext,
                                        nsresult aStatus,
                                        bool aLastPart) MOZ_OVERRIDE;
-  virtual nsresult OnNewSourceData() MOZ_OVERRIDE;
 
   virtual void OnSurfaceDiscarded() MOZ_OVERRIDE;
 
   virtual void SetInnerWindowID(uint64_t aInnerWindowId) MOZ_OVERRIDE;
   virtual uint64_t InnerWindowID() const MOZ_OVERRIDE;
 
   virtual bool HasError() MOZ_OVERRIDE;
   virtual void SetHasError() MOZ_OVERRIDE;
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -1505,24 +1505,16 @@ RasterImage::OnImageDataAvailable(nsIReq
 
   NS_ABORT_IF_FALSE(bytesRead == aCount || HasError() || NS_FAILED(rv),
     "WriteToRasterImage should consume everything if ReadSegments succeeds or "
     "the image must be in error!");
 
   return rv;
 }
 
-nsresult
-RasterImage::OnNewSourceData()
-{
-  // XXX(seth): This will be removed in a subsequent patch.
-  MOZ_ASSERT_UNREACHABLE();
-  return NS_ERROR_ILLEGAL_VALUE;
-}
-
 /* static */ already_AddRefed<nsIEventTarget>
 RasterImage::GetEventTarget()
 {
   return DecodePool::Singleton()->GetEventTarget();
 }
 
 nsresult
 RasterImage::SetSourceSizeHint(uint32_t sizeHint)
--- a/image/src/RasterImage.h
+++ b/image/src/RasterImage.h
@@ -223,17 +223,16 @@ public:
                                         nsISupports* aContext,
                                         nsIInputStream* aInStr,
                                         uint64_t aSourceOffset,
                                         uint32_t aCount) MOZ_OVERRIDE;
   virtual nsresult OnImageDataComplete(nsIRequest* aRequest,
                                        nsISupports* aContext,
                                        nsresult aStatus,
                                        bool aLastPart) MOZ_OVERRIDE;
-  virtual nsresult OnNewSourceData() MOZ_OVERRIDE;
 
   static already_AddRefed<nsIEventTarget> GetEventTarget();
 
   /**
    * A hint of the number of bytes of source data that the image contains. If
    * called early on, this can help reduce copying and reallocations by
    * appropriately preallocating the source data buffer.
    *
--- a/image/src/VectorImage.cpp
+++ b/image/src/VectorImage.cpp
@@ -424,22 +424,16 @@ VectorImage::OnImageDataAvailable(nsIReq
                                   nsIInputStream* aInStr,
                                   uint64_t aSourceOffset,
                                   uint32_t aCount)
 {
   return OnDataAvailable(aRequest, aContext, aInStr, aSourceOffset, aCount);
 }
 
 nsresult
-VectorImage::OnNewSourceData()
-{
-  return NS_OK;
-}
-
-nsresult
 VectorImage::StartAnimation()
 {
   if (mError)
     return NS_ERROR_FAILURE;
 
   MOZ_ASSERT(ShouldAnimate(), "Should not animate!");
 
   mSVGDocumentWrapper->StartAnimation();
--- a/image/src/VectorImage.h
+++ b/image/src/VectorImage.h
@@ -50,17 +50,16 @@ public:
                                         nsISupports* aContext,
                                         nsIInputStream* aInStr,
                                         uint64_t aSourceOffset,
                                         uint32_t aCount) MOZ_OVERRIDE;
   virtual nsresult OnImageDataComplete(nsIRequest* aRequest,
                                        nsISupports* aContext,
                                        nsresult aResult,
                                        bool aLastPart) MOZ_OVERRIDE;
-  virtual nsresult OnNewSourceData() MOZ_OVERRIDE;
 
   /**
    * Callback for SVGRootRenderingObserver.
    *
    * This just sets a dirty flag that we check in VectorImage::RequestRefresh,
    * which is called under the ticks of the refresh driver of any observing
    * documents that we may have. Only then (after all animations in this image
    * have been updated) do we send out "frame changed" notifications,