Backed out changeset 25ea9ac37380 (bug 828176) for crashes.
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 30 Jan 2013 18:16:09 -0500
changeset 130289 838146e5e46a1fd9cb3d07d1e135c9527fb04d78
parent 130288 dedbcc7744132620cd8fd71d2af25b0158230846
child 130290 220ee1b126c31d4aa53efc0017c07f6912c7f428
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs828176
milestone21.0a1
backs out25ea9ac37380c0e569856a718d662b7686af35ee
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
Backed out changeset 25ea9ac37380 (bug 828176) for crashes.
image/src/Decoder.cpp
image/src/RasterImage.cpp
image/src/RasterImage.h
--- a/image/src/Decoder.cpp
+++ b/image/src/Decoder.cpp
@@ -97,17 +97,17 @@ Decoder::Finish(RasterImage::eShutdownIn
     // Log data errors to the error console
     nsCOMPtr<nsIConsoleService> consoleService =
       do_GetService(NS_CONSOLESERVICE_CONTRACTID);
     nsCOMPtr<nsIScriptError> errorObject =
       do_CreateInstance(NS_SCRIPTERROR_CONTRACTID);
 
     if (consoleService && errorObject && !HasDecoderError()) {
       nsAutoString msg(NS_LITERAL_STRING("Image corrupt or truncated: ") +
-                       NS_ConvertUTF8toUTF16(mImage.GetURIString()));
+                       NS_ConvertASCIItoUTF16(mImage.GetURIString()));
 
       if (NS_SUCCEEDED(errorObject->InitWithWindowID(
                          msg,
                          NS_ConvertUTF8toUTF16(mImage.GetURIString()),
                          EmptyString(), 0, 0, nsIScriptError::errorFlag,
                          "Image", mImage.InnerWindowID()
                        ))) {
         consoleService->LogMessage(errorObject);
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -2806,17 +2806,17 @@ RasterImage::RequestDecodeCore(RequestDe
   // If we've read all the data we have, we're done
   if (mBytesDecoded == mSourceData.Length())
     return NS_OK;
 
   // If we can do decoding now, do so.  Small images will decode completely,
   // large images will decode a bit and post themselves to the event loop
   // to finish decoding.
   if (!mDecoded && !mInDecoder && mHasSourceData && aDecodeType == SOMEWHAT_SYNCHRONOUS) {
-    SAMPLE_LABEL_PRINTF("RasterImage", "DecodeABitOf", "%s", GetURIString().get());
+    SAMPLE_LABEL_PRINTF("RasterImage", "DecodeABitOf", "%s", GetURIString());
     DecodeWorker::Singleton()->DecodeABitOf(this);
     return NS_OK;
   }
 
   // If we get this far, dispatch the worker. We do this instead of starting
   // any immediate decoding to guarantee that all our decode notifications are
   // dispatched asynchronously, and to ensure we stay responsive.
   DecodeWorker::Singleton()->RequestDecode(this);
@@ -2825,17 +2825,17 @@ RasterImage::RequestDecodeCore(RequestDe
 }
 
 // Synchronously decodes as much data as possible
 nsresult
 RasterImage::SyncDecode()
 {
   nsresult rv;
 
-  SAMPLE_LABEL_PRINTF("RasterImage", "SyncDecode", "%s", GetURIString().get());;
+  SAMPLE_LABEL_PRINTF("RasterImage", "SyncDecode", "%s", GetURIString());;
 
   // If we're decoded already, no worries
   if (mDecoded)
     return NS_OK;
 
   // If we're not storing source data, there isn't much to do here
   if (!StoringSourceData())
     return NS_OK;
--- a/image/src/RasterImage.h
+++ b/image/src/RasterImage.h
@@ -285,21 +285,17 @@ public:
     kDisposeClearAll         = -1, // Clear the whole image, revealing
                                    // what was there before the gif displayed
     kDisposeNotSpecified,   // Leave frame, let new frame draw on top
     kDisposeKeep,           // Leave frame, let new frame draw on top
     kDisposeClear,          // Clear the frame's area, revealing bg
     kDisposeRestorePrevious // Restore the previous (composited) frame
   };
 
-  nsCString GetURIString() {
-    nsAutoCString spec;
-    GetURI()->GetSpec(spec);
-    return spec;
-  }
+  const char* GetURIString() { return mURIString.get();}
 
   // Called from module startup. Sets up RasterImage to be used.
   static void Initialize();
 
   enum ScaleStatus
   {
     SCALE_INVALID,
     SCALE_PENDING,
@@ -646,16 +642,17 @@ private: // data
 
   // Discard members
   uint32_t                   mLockCount;
   DiscardTracker::Node       mDiscardTrackerNode;
 
   // Source data members
   FallibleTArray<char>       mSourceData;
   nsCString                  mSourceDataMimeType;
+  nsCString                  mURIString;
 
   friend class DiscardTracker;
 
   // Decoder and friends
   nsRefPtr<Decoder>              mDecoder;
   DecodeRequest                  mDecodeRequest;
   uint32_t                       mBytesDecoded;