Bug 828176 - Make RasterImage::GetURIString work again. r=joe

This commit is contained in:
Seth Fowler 2013-01-30 12:11:20 -08:00
parent a8989333ee
commit fcd0c77a69
3 changed files with 10 additions and 5 deletions

View File

@ -102,7 +102,7 @@ Decoder::Finish(RasterImage::eShutdownIntent aShutdownIntent)
if (consoleService && errorObject && !HasDecoderError()) {
nsAutoString msg(NS_LITERAL_STRING("Image corrupt or truncated: ") +
NS_ConvertASCIItoUTF16(mImage.GetURIString()));
NS_ConvertUTF8toUTF16(mImage.GetURIString()));
if (NS_SUCCEEDED(errorObject->InitWithWindowID(
msg,

View File

@ -2811,7 +2811,7 @@ RasterImage::RequestDecodeCore(RequestDecodeType aDecodeType)
// 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());
SAMPLE_LABEL_PRINTF("RasterImage", "DecodeABitOf", "%s", GetURIString().get());
DecodeWorker::Singleton()->DecodeABitOf(this);
return NS_OK;
}
@ -2830,7 +2830,7 @@ RasterImage::SyncDecode()
{
nsresult rv;
SAMPLE_LABEL_PRINTF("RasterImage", "SyncDecode", "%s", GetURIString());;
SAMPLE_LABEL_PRINTF("RasterImage", "SyncDecode", "%s", GetURIString().get());;
// If we're decoded already, no worries
if (mDecoded)

View File

@ -290,7 +290,13 @@ public:
kDisposeRestorePrevious // Restore the previous (composited) frame
};
const char* GetURIString() { return mURIString.get();}
nsCString GetURIString() {
nsCString spec;
if (GetURI()) {
GetURI()->GetSpec(spec);
}
return spec;
}
// Called from module startup. Sets up RasterImage to be used.
static void Initialize();
@ -647,7 +653,6 @@ private: // data
// Source data members
FallibleTArray<char> mSourceData;
nsCString mSourceDataMimeType;
nsCString mURIString;
friend class DiscardTracker;