Bug 869476. nsImageLoadingContent::Track/UntrackImage should return void. r=khuey
authorTimothy Nikkel <tnikkel@gmail.com>
Tue, 07 May 2013 13:38:35 -0500
changeset 142097 e3dcea95f1613007334844001faf1980e428dc52
parent 142096 c39614efd2637b174d3a5272c1633762a2d1259e
child 142098 880dc52ab5192306c14a84137057413a8d35a9ae
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs869476
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 869476. nsImageLoadingContent::Track/UntrackImage should return void. r=khuey
content/base/src/nsImageLoadingContent.cpp
content/base/src/nsImageLoadingContent.h
--- a/content/base/src/nsImageLoadingContent.cpp
+++ b/content/base/src/nsImageLoadingContent.cpp
@@ -1291,45 +1291,44 @@ nsImageLoadingContent::UnbindFromTree(bo
 
   UntrackImage(mCurrentRequest);
   UntrackImage(mPendingRequest);
 
   if (mCurrentRequestFlags & REQUEST_BLOCKS_ONLOAD)
     doc->UnblockOnload(false);
 }
 
-nsresult
+void
 nsImageLoadingContent::TrackImage(imgIRequest* aImage, uint32_t aFlags /* = 0 */)
 {
   if (!aImage)
-    return NS_OK;
+    return;
 
   MOZ_ASSERT(aImage == mCurrentRequest || aImage == mPendingRequest,
              "Why haven't we heard of this request?");
 
   nsIDocument* doc = GetOurCurrentDoc();
   if (doc && ((aFlags & SKIP_FRAME_CHECK) || GetOurPrimaryFrame()) &&
       (mVisibleCount > 0)) {
     if (aImage == mCurrentRequest && !(mCurrentRequestFlags & REQUEST_IS_TRACKED)) {
       mCurrentRequestFlags |= REQUEST_IS_TRACKED;
       doc->AddImage(mCurrentRequest);
     }
     if (aImage == mPendingRequest && !(mPendingRequestFlags & REQUEST_IS_TRACKED)) {
       mPendingRequestFlags |= REQUEST_IS_TRACKED;
       doc->AddImage(mPendingRequest);
     }
   }
-  return NS_OK;
 }
 
-nsresult
+void
 nsImageLoadingContent::UntrackImage(imgIRequest* aImage, uint32_t aFlags /* = 0 */)
 {
   if (!aImage)
-    return NS_OK;
+    return;
 
   MOZ_ASSERT(aImage == mCurrentRequest || aImage == mPendingRequest,
              "Why haven't we heard of this request?");
 
   // We may not be in the document.  If we outlived our document that's fine,
   // because the document empties out the tracker and unlocks all locked images
   // on destruction.  But if we were never in the document we may need to force
   // discarding the image here, since this is the only chance we have.
@@ -1351,17 +1350,16 @@ nsImageLoadingContent::UntrackImage(imgI
       doc->RemoveImage(mPendingRequest,
                        (aFlags & REQUEST_DISCARD) ? nsIDocument::REQUEST_DISCARD : 0);
     }
     else if (aFlags & REQUEST_DISCARD) {
       // If we're not in the document we may still need to be discarded.
       aImage->RequestDiscard();
     }
   }
-  return NS_OK;
 }
 
 
 void
 nsImageLoadingContent::CreateStaticImageClone(nsImageLoadingContent* aDest) const
 {
   aDest->mCurrentRequest = nsContentUtils::GetStaticRequest(mCurrentRequest);
   aDest->TrackImage(aDest->mCurrentRequest);
--- a/content/base/src/nsImageLoadingContent.h
+++ b/content/base/src/nsImageLoadingContent.h
@@ -332,21 +332,21 @@ protected:
    * frame, there is only one valid use of this: when calling from FrameCreated.
    *
    * REQUEST_DISCARD passed to UntrackImage means we request the discard of the
    * decoded data of the image.
    */
   enum {
     SKIP_FRAME_CHECK = 0x1
   };
-  nsresult TrackImage(imgIRequest* aImage, uint32_t aFlags = 0);
+  void TrackImage(imgIRequest* aImage, uint32_t aFlags = 0);
   enum {
     REQUEST_DISCARD = 0x1
   };
-  nsresult UntrackImage(imgIRequest* aImage, uint32_t aFlags = 0);
+  void UntrackImage(imgIRequest* aImage, uint32_t aFlags = 0);
 
   /* MEMBERS */
   nsRefPtr<imgRequestProxy> mCurrentRequest;
   nsRefPtr<imgRequestProxy> mPendingRequest;
   uint32_t mCurrentRequestFlags;
   uint32_t mPendingRequestFlags;
 
   enum {