From ba751f44257f6a3871f17e1c296ebed5da3eb2a9 Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Sat, 19 Nov 2011 20:49:17 +0200 Subject: [PATCH] Bug 703654 - Improve document's CC Describe, r=mccr8 --- content/base/src/nsDocument.cpp | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index b69c0cfc9109..bc0e2ee7fefc 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -1782,31 +1782,38 @@ IdentifierMapEntryTraverse(nsIdentifierMapEntry *aEntry, void *aArg) } static const char* kNSURIs[] = { - " ([none])", - " (xmlns)", - " (xml)", - " (xhtml)", - " (XLink)", - " (XSLT)", - " (XBL)", - " (MathML)", - " (RDF)", - " (XUL)" + "([none])", + "(xmlns)", + "(xml)", + "(xhtml)", + "(XLink)", + "(XSLT)", + "(XBL)", + "(MathML)", + "(RDF)", + "(XUL)" }; NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument) if (NS_UNLIKELY(cb.WantDebugInfo())) { char name[512]; + nsCAutoString loadedAsData; + if (tmp->IsLoadedAsData()) { + loadedAsData.AssignLiteral("data"); + } else { + loadedAsData.AssignLiteral("normal"); + } PRUint32 nsid = tmp->GetDefaultNamespaceID(); nsCAutoString uri; if (tmp->mDocumentURI) tmp->mDocumentURI->GetSpec(uri); if (nsid < ArrayLength(kNSURIs)) { - PR_snprintf(name, sizeof(name), "nsDocument%s %s", kNSURIs[nsid], - uri.get()); + PR_snprintf(name, sizeof(name), "nsDocument %s %s %s", + loadedAsData.get(), kNSURIs[nsid], uri.get()); } else { - PR_snprintf(name, sizeof(name), "nsDocument %s", uri.get()); + PR_snprintf(name, sizeof(name), "nsDocument %s %s", + loadedAsData.get(), uri.get()); } cb.DescribeRefCountedNode(tmp->mRefCnt.get(), sizeof(nsDocument), name); }