Bug 806243 - Fix blob memory reporter's SHA1s on 32-bit by passing a correct format string to nsPrintfCString. r=njn

This commit is contained in:
Justin Lebar 2012-11-02 15:06:03 -04:00
parent 11ec75bdd6
commit 5da76eb7a9

View File

@ -744,21 +744,21 @@ class nsDOMMemoryFileDataOwnerMemoryReporter
sha1.finish(digest);
nsAutoCString digestString;
for (uint8_t i = 0; i < sizeof(digest); i++) {
for (size_t i = 0; i < sizeof(digest); i++) {
digestString.AppendPrintf("%02x", digest[i]);
}
nsresult rv = aCallback->Callback(
/* process */ NS_LITERAL_CSTRING(""),
nsPrintfCString(
"explicit/dom/memory-file-data/large/file(length=%d, sha1=%s)",
"explicit/dom/memory-file-data/large/file(length=%llu, sha1=%s)",
owner->mLength, digestString.get()),
nsIMemoryReporter::KIND_HEAP,
nsIMemoryReporter::UNITS_BYTES,
size,
nsPrintfCString(
"Memory used to back a memory file of length %d. The file has a "
"sha1 of %s.\n\n"
"Memory used to back a memory file of length %llu bytes. The file "
"has a sha1 of %s.\n\n"
"Note that the allocator may round up a memory file's length -- "
"that is, an N-byte memory file may take up more than N bytes of "
"memory.",