Bug 840843 - Rename RasterImage::eShutdownIntent_Interrupted to eShutdownIntent_Unneeded. r=joe
authorSeth Fowler <seth@mozilla.com>
Wed, 13 Feb 2013 13:41:45 -0800
changeset 121831 e1f096c747dfb93a4f692bdbb7ed364f9d8a9a82
parent 121830 d771cec5537320db52182070d8e3db43b58ccc73
child 121832 c89635394bdb2789e98f60a49b0bbd95483d413b
push id22950
push userryanvm@gmail.com
push dateThu, 14 Feb 2013 02:07:50 +0000
treeherdermozilla-inbound@77a7ce6cbf81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe
bugs840843
milestone21.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 840843 - Rename RasterImage::eShutdownIntent_Interrupted to eShutdownIntent_Unneeded. r=joe
image/src/Decoder.cpp
image/src/RasterImage.cpp
image/src/RasterImage.h
--- a/image/src/Decoder.cpp
+++ b/image/src/Decoder.cpp
@@ -113,17 +113,17 @@ Decoder::Finish(RasterImage::eShutdownIn
                          EmptyString(), 0, 0, nsIScriptError::errorFlag,
                          "Image", mImage.InnerWindowID()
                        ))) {
         consoleService->LogMessage(errorObject);
       }
     }
 
     bool usable = true;
-    if (aShutdownIntent != RasterImage::eShutdownIntent_Interrupted && !HasDecoderError()) {
+    if (aShutdownIntent != RasterImage::eShutdownIntent_NotNeeded && !HasDecoderError()) {
       // If we only have a data error, we're usable if we have at least one frame.
       if (mImage.GetNumFrames() == 0) {
         usable = false;
       }
     }
 
     // If we're usable, do exactly what we should have when the decoder
     // completed.
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -2610,17 +2610,17 @@ RasterImage::InitDecoder(bool aDoSizeDec
 }
 
 // Flushes, closes, and nulls-out a decoder. Cleans up any related decoding
 // state. It is an error to call this function when there is no initialized
 // decoder.
 // 
 // aIntent specifies the intent of the shutdown. If aIntent is
 // eShutdownIntent_Done, an error is flagged if we didn't get what we should
-// have out of the decode. If aIntent is eShutdownIntent_Interrupted, we don't
+// have out of the decode. If aIntent is eShutdownIntent_NotNeeded, we don't
 // check this. If aIntent is eShutdownIntent_Error, we shut down in error mode.
 nsresult
 RasterImage::ShutdownDecoder(eShutdownIntent aIntent)
 {
   // Ensure that our intent is valid
   NS_ABORT_IF_FALSE((aIntent >= 0) && (aIntent < eShutdownIntent_AllCount),
                     "Invalid shutdown intent");
 
@@ -2791,17 +2791,17 @@ RasterImage::RequestDecodeCore(RequestDe
   }
 
 
   // If we have a size decode open, interrupt it and shut it down; or if
   // the decoder has different flags than what we need
   if (mDecoder &&
       (mDecoder->IsSizeDecode() || mDecoder->GetDecodeFlags() != mFrameDecodeFlags))
   {
-    rv = ShutdownDecoder(eShutdownIntent_Interrupted);
+    rv = ShutdownDecoder(eShutdownIntent_NotNeeded);
     CONTAINER_ENSURE_SUCCESS(rv);
   }
 
   // If we don't have a decoder, create one 
   if (!mDecoder) {
     NS_ABORT_IF_FALSE(mFrames.IsEmpty(), "Trying to decode to non-empty frame-array");
     rv = InitDecoder(/* aDoSizeDecode = */ false);
     CONTAINER_ENSURE_SUCCESS(rv);
@@ -2850,17 +2850,17 @@ RasterImage::SyncDecode()
   // disallow this type of call in the API, and check for it in API methods.
   NS_ABORT_IF_FALSE(!mInDecoder, "Yikes, forcing sync in reentrant call!");
 
   // If we have a size decoder open, or one with different flags than
   // what we need, shut it down
   if (mDecoder &&
       (mDecoder->IsSizeDecode() || mDecoder->GetDecodeFlags() != mFrameDecodeFlags))
   {
-    rv = ShutdownDecoder(eShutdownIntent_Interrupted);
+    rv = ShutdownDecoder(eShutdownIntent_NotNeeded);
     CONTAINER_ENSURE_SUCCESS(rv);
   }
 
   // If we don't have a decoder, create one 
   if (!mDecoder) {
     NS_ABORT_IF_FALSE(mFrames.IsEmpty(), "Trying to decode to non-empty frame-array");
     rv = InitDecoder(/* aDoSizeDecode = */ false);
     CONTAINER_ENSURE_SUCCESS(rv);
@@ -3157,17 +3157,17 @@ RasterImage::UnlockImage()
   // and our lock count is now zero (so nothing is forcing us to keep the
   // decoded data around), try to cancel the decode and throw away whatever
   // we've decoded.
   if (mHasBeenDecoded && mDecoder &&
       mLockCount == 0 && CanForciblyDiscard()) {
     PR_LOG(GetCompressedImageAccountingLog(), PR_LOG_DEBUG,
            ("RasterImage[0x%p] canceling decode because image "
             "is now unlocked.", this));
-    ShutdownDecoder(eShutdownIntent_Interrupted);
+    ShutdownDecoder(eShutdownIntent_NotNeeded);
     ForceDiscard();
     return NS_OK;
   }
 
   // Otherwise, we might still be a candidate for discarding in the future.  If
   // we are, add ourselves to the discard tracker.
   if (CanDiscard()) {
     nsresult rv = DiscardTracker::Reset(&mDiscardTrackerNode);
--- a/image/src/RasterImage.h
+++ b/image/src/RasterImage.h
@@ -316,17 +316,17 @@ public:
   // Call this with a finished ScaleRequest to set this RasterImage's scale
   // result. Give it a ScaleStatus of SCALE_DONE if everything succeeded, and
   // SCALE_INVALID otherwise.
   void ScalingDone(ScaleRequest* request, ScaleStatus status);
 
   // Decoder shutdown
   enum eShutdownIntent {
     eShutdownIntent_Done        = 0,
-    eShutdownIntent_Interrupted = 1,
+    eShutdownIntent_NotNeeded   = 1,
     eShutdownIntent_Error       = 2,
     eShutdownIntent_AllCount    = 3
   };
 
 private:
   struct Anim
   {
     //! Area of the first frame that needs to be redrawn on subsequent loops.