From aa4ed76615a779dab4ea11dc70311453055d0ad9 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Sun, 6 May 2012 22:05:16 -0700 Subject: [PATCH] Bug 752381 - Merge System Principal compartments in about:memory. r=jlebar. --- js/xpconnect/src/XPCJSRuntime.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index 8f53a256dac5..6fcdab43392f 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -1197,7 +1197,7 @@ XPCJSRuntime::~XPCJSRuntime() } static void -GetCompartmentName(JSCompartment *c, bool getAddress, nsCString &name) +GetCompartmentName(JSCompartment *c, nsCString &name) { if (js::IsAtomsCompartment(c)) { name.AssignLiteral("atoms"); @@ -1205,9 +1205,6 @@ GetCompartmentName(JSCompartment *c, bool getAddress, nsCString &name) nsJSPrincipals::get(principals)->GetScriptLocation(name); // For system compartments we append the location, if there is one. - // And we append the address if |getAddress| is true, so that - // multiple system compartments (and there can be many) can be - // distinguished. if (js::IsSystemCompartment(c)) { xpc::CompartmentPrivate *compartmentPrivate = static_cast(JS_GetCompartmentPrivate(c)); @@ -1215,12 +1212,6 @@ GetCompartmentName(JSCompartment *c, bool getAddress, nsCString &name) name.AppendLiteral(", "); name.Append(compartmentPrivate->location); } - - if (getAddress) { - // ample; 64-bit address max is 18 chars - nsPrintfCString address(", 0x%llx", PRUint64(c)); - name.Append(address); - } } // A hack: replace forward slashes with '\\' so they aren't @@ -1641,7 +1632,7 @@ class JSCompartmentsMultiReporter : public nsIMemoryMultiReporter // silently ignore OOM errors Paths *paths = static_cast(data); nsCString path; - GetCompartmentName(c, /* getAddress = */ false, path); + GetCompartmentName(c, path); path.Insert(js::IsSystemCompartment(c) ? NS_LITERAL_CSTRING("compartments/system/") : NS_LITERAL_CSTRING("compartments/user/"), @@ -1698,7 +1689,7 @@ struct XPCJSRuntimeStats : public JS::RuntimeStats { virtual void initExtraCompartmentStats(JSCompartment *c, JS::CompartmentStats *cstats) MOZ_OVERRIDE { nsCAutoString name; - GetCompartmentName(c, /* getAddress = */ true, name); + GetCompartmentName(c, name); cstats->extra = strdup(name.get()); } };