mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 904720: Take a census of event targets and listeners. r=smaug,njn
This commit is contained in:
parent
16bda08a40
commit
3916914a98
@ -11046,26 +11046,30 @@ nsDocument::GetVisibilityState(nsAString& aState)
|
||||
/* virtual */ void
|
||||
nsIDocument::DocSizeOfExcludingThis(nsWindowSizes* aWindowSizes) const
|
||||
{
|
||||
aWindowSizes->mDOMOther +=
|
||||
aWindowSizes->mDOMOtherSize +=
|
||||
nsINode::SizeOfExcludingThis(aWindowSizes->mMallocSizeOf);
|
||||
|
||||
if (mPresShell) {
|
||||
mPresShell->SizeOfIncludingThis(aWindowSizes->mMallocSizeOf,
|
||||
&aWindowSizes->mArenaStats,
|
||||
&aWindowSizes->mLayoutPresShell,
|
||||
&aWindowSizes->mLayoutStyleSets,
|
||||
&aWindowSizes->mLayoutTextRuns,
|
||||
&aWindowSizes->mLayoutPresContext);
|
||||
&aWindowSizes->mLayoutPresShellSize,
|
||||
&aWindowSizes->mLayoutStyleSetsSize,
|
||||
&aWindowSizes->mLayoutTextRunsSize,
|
||||
&aWindowSizes->mLayoutPresContextSize);
|
||||
}
|
||||
|
||||
aWindowSizes->mPropertyTables +=
|
||||
aWindowSizes->mPropertyTablesSize +=
|
||||
mPropertyTable.SizeOfExcludingThis(aWindowSizes->mMallocSizeOf);
|
||||
for (uint32_t i = 0, count = mExtraPropertyTables.Length();
|
||||
i < count; ++i) {
|
||||
aWindowSizes->mPropertyTables +=
|
||||
aWindowSizes->mPropertyTablesSize +=
|
||||
mExtraPropertyTables[i]->SizeOfExcludingThis(aWindowSizes->mMallocSizeOf);
|
||||
}
|
||||
|
||||
if (nsEventListenerManager* elm = GetExistingListenerManager()) {
|
||||
aWindowSizes->mDOMEventListenersCount += elm->ListenerCount();
|
||||
}
|
||||
|
||||
// Measurement of the following members may be added later if DMD finds it
|
||||
// is worthwhile:
|
||||
// - many!
|
||||
@ -11074,7 +11078,7 @@ nsIDocument::DocSizeOfExcludingThis(nsWindowSizes* aWindowSizes) const
|
||||
void
|
||||
nsIDocument::DocSizeOfIncludingThis(nsWindowSizes* aWindowSizes) const
|
||||
{
|
||||
aWindowSizes->mDOMOther += aWindowSizes->mMallocSizeOf(this);
|
||||
aWindowSizes->mDOMOtherSize += aWindowSizes->mMallocSizeOf(this);
|
||||
DocSizeOfExcludingThis(aWindowSizes);
|
||||
}
|
||||
|
||||
@ -11110,58 +11114,62 @@ nsDocument::DocSizeOfExcludingThis(nsWindowSizes* aWindowSizes) const
|
||||
|
||||
switch (node->NodeType()) {
|
||||
case nsIDOMNode::ELEMENT_NODE:
|
||||
p = &aWindowSizes->mDOMElementNodes;
|
||||
p = &aWindowSizes->mDOMElementNodesSize;
|
||||
break;
|
||||
case nsIDOMNode::TEXT_NODE:
|
||||
p = &aWindowSizes->mDOMTextNodes;
|
||||
p = &aWindowSizes->mDOMTextNodesSize;
|
||||
break;
|
||||
case nsIDOMNode::CDATA_SECTION_NODE:
|
||||
p = &aWindowSizes->mDOMCDATANodes;
|
||||
p = &aWindowSizes->mDOMCDATANodesSize;
|
||||
break;
|
||||
case nsIDOMNode::COMMENT_NODE:
|
||||
p = &aWindowSizes->mDOMCommentNodes;
|
||||
p = &aWindowSizes->mDOMCommentNodesSize;
|
||||
break;
|
||||
default:
|
||||
p = &aWindowSizes->mDOMOther;
|
||||
p = &aWindowSizes->mDOMOtherSize;
|
||||
break;
|
||||
}
|
||||
|
||||
*p += nodeSize;
|
||||
|
||||
if (nsEventListenerManager* elm = node->GetExistingListenerManager()) {
|
||||
aWindowSizes->mDOMEventListenersCount += elm->ListenerCount();
|
||||
}
|
||||
}
|
||||
|
||||
aWindowSizes->mStyleSheets +=
|
||||
aWindowSizes->mStyleSheetsSize +=
|
||||
mStyleSheets.SizeOfExcludingThis(SizeOfStyleSheetsElementIncludingThis,
|
||||
aWindowSizes->mMallocSizeOf);
|
||||
aWindowSizes->mStyleSheets +=
|
||||
aWindowSizes->mStyleSheetsSize +=
|
||||
mCatalogSheets.SizeOfExcludingThis(SizeOfStyleSheetsElementIncludingThis,
|
||||
aWindowSizes->mMallocSizeOf);
|
||||
aWindowSizes->mStyleSheets +=
|
||||
aWindowSizes->mStyleSheetsSize +=
|
||||
mAdditionalSheets[eAgentSheet].
|
||||
SizeOfExcludingThis(SizeOfStyleSheetsElementIncludingThis,
|
||||
aWindowSizes->mMallocSizeOf);
|
||||
aWindowSizes->mStyleSheets +=
|
||||
aWindowSizes->mStyleSheetsSize +=
|
||||
mAdditionalSheets[eUserSheet].
|
||||
SizeOfExcludingThis(SizeOfStyleSheetsElementIncludingThis,
|
||||
aWindowSizes->mMallocSizeOf);
|
||||
aWindowSizes->mStyleSheets +=
|
||||
aWindowSizes->mStyleSheetsSize +=
|
||||
mAdditionalSheets[eAuthorSheet].
|
||||
SizeOfExcludingThis(SizeOfStyleSheetsElementIncludingThis,
|
||||
aWindowSizes->mMallocSizeOf);
|
||||
// Lumping in the loader with the style-sheets size is not ideal,
|
||||
// but most of the things in there are in fact stylesheets, so it
|
||||
// doesn't seem worthwhile to separate it out.
|
||||
aWindowSizes->mStyleSheets +=
|
||||
aWindowSizes->mStyleSheetsSize +=
|
||||
CSSLoader()->SizeOfIncludingThis(aWindowSizes->mMallocSizeOf);
|
||||
|
||||
aWindowSizes->mDOMOther +=
|
||||
aWindowSizes->mDOMOtherSize +=
|
||||
mAttrStyleSheet ?
|
||||
mAttrStyleSheet->DOMSizeOfIncludingThis(aWindowSizes->mMallocSizeOf) :
|
||||
0;
|
||||
|
||||
aWindowSizes->mDOMOther +=
|
||||
aWindowSizes->mDOMOtherSize +=
|
||||
mStyledLinks.SizeOfExcludingThis(nullptr, aWindowSizes->mMallocSizeOf);
|
||||
|
||||
aWindowSizes->mDOMOther +=
|
||||
aWindowSizes->mDOMOtherSize +=
|
||||
mIdentifierMap.SizeOfExcludingThis(nsIdentifierMapEntry::SizeOfExcludingThis,
|
||||
aWindowSizes->mMallocSizeOf);
|
||||
|
||||
|
@ -400,6 +400,11 @@ public:
|
||||
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
uint32_t ListenerCount() const
|
||||
{
|
||||
return mListeners.Length();
|
||||
}
|
||||
|
||||
void MarkForCC();
|
||||
|
||||
mozilla::dom::EventTarget* GetTarget() { return mTarget; }
|
||||
|
@ -11510,40 +11510,57 @@ nsGlobalWindow::DisableTimeChangeNotifications()
|
||||
nsSystemTimeChangeObserver::RemoveWindowListener(this);
|
||||
}
|
||||
|
||||
static size_t
|
||||
SizeOfEventTargetObjectsEntryExcludingThisFun(
|
||||
static PLDHashOperator
|
||||
CollectSizeAndListenerCount(
|
||||
nsPtrHashKey<nsDOMEventTargetHelper> *aEntry,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void *arg)
|
||||
{
|
||||
nsISupports *supports = aEntry->GetKey();
|
||||
nsCOMPtr<nsISizeOfEventTarget> iface = do_QueryInterface(supports);
|
||||
return iface ? iface->SizeOfEventTargetIncludingThis(aMallocSizeOf) : 0;
|
||||
nsWindowSizes* windowSizes = static_cast<nsWindowSizes*>(arg);
|
||||
|
||||
nsDOMEventTargetHelper* et = aEntry->GetKey();
|
||||
|
||||
if (nsCOMPtr<nsISizeOfEventTarget> iSizeOf = do_QueryObject(et)) {
|
||||
windowSizes->mDOMEventTargetsSize +=
|
||||
iSizeOf->SizeOfEventTargetIncludingThis(windowSizes->mMallocSizeOf);
|
||||
}
|
||||
|
||||
if (nsEventListenerManager* elm = et->GetExistingListenerManager()) {
|
||||
windowSizes->mDOMEventListenersCount += elm->ListenerCount();
|
||||
}
|
||||
|
||||
return PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
void
|
||||
nsGlobalWindow::SizeOfIncludingThis(nsWindowSizes* aWindowSizes) const
|
||||
{
|
||||
aWindowSizes->mDOMOther += aWindowSizes->mMallocSizeOf(this);
|
||||
aWindowSizes->mDOMOtherSize += aWindowSizes->mMallocSizeOf(this);
|
||||
|
||||
if (IsInnerWindow()) {
|
||||
if (nsEventListenerManager* elm = GetExistingListenerManager()) {
|
||||
aWindowSizes->mDOMOther +=
|
||||
aWindowSizes->mDOMOtherSize +=
|
||||
elm->SizeOfIncludingThis(aWindowSizes->mMallocSizeOf);
|
||||
aWindowSizes->mDOMEventListenersCount +=
|
||||
elm->ListenerCount();
|
||||
}
|
||||
if (mDoc) {
|
||||
mDoc->DocSizeOfIncludingThis(aWindowSizes);
|
||||
}
|
||||
}
|
||||
|
||||
aWindowSizes->mDOMOther +=
|
||||
aWindowSizes->mDOMOtherSize +=
|
||||
mNavigator ?
|
||||
mNavigator->SizeOfIncludingThis(aWindowSizes->mMallocSizeOf) : 0;
|
||||
|
||||
aWindowSizes->mDOMEventTargets +=
|
||||
mEventTargetObjects.SizeOfExcludingThis(
|
||||
SizeOfEventTargetObjectsEntryExcludingThisFun,
|
||||
aWindowSizes->mMallocSizeOf);
|
||||
// The things pointed to by the entries will be measured below, so we
|
||||
// use nullptr for the callback here.
|
||||
aWindowSizes->mDOMEventTargetsSize +=
|
||||
mEventTargetObjects.SizeOfExcludingThis(nullptr,
|
||||
aWindowSizes->mMallocSizeOf);
|
||||
aWindowSizes->mDOMEventTargetsCount +=
|
||||
const_cast<nsTHashtable<nsPtrHashKey<nsDOMEventTargetHelper> >*>
|
||||
(&mEventTargetObjects)->EnumerateEntries(CollectSizeAndListenerCount,
|
||||
aWindowSizes);
|
||||
}
|
||||
|
||||
|
||||
|
@ -124,7 +124,7 @@ CollectWindowReports(nsGlobalWindow *aWindow,
|
||||
nsIMemoryReporterCallback *aCb,
|
||||
nsISupports *aClosure)
|
||||
{
|
||||
nsAutoCString windowPath("explicit/");
|
||||
nsAutoCString windowPath;
|
||||
|
||||
// Avoid calling aWindow->GetTop() if there's no outer window. It will work
|
||||
// just fine, but will spew a lot of warnings.
|
||||
@ -176,94 +176,123 @@ CollectWindowReports(nsGlobalWindow *aWindow,
|
||||
AppendWindowURI(aWindow, windowPath);
|
||||
windowPath += NS_LITERAL_CSTRING(")");
|
||||
|
||||
// Remember the path for later.
|
||||
aWindowPaths->Put(aWindow->WindowID(), windowPath);
|
||||
nsCString explicitWindowPath("explicit/");
|
||||
explicitWindowPath += windowPath;
|
||||
|
||||
#define REPORT(_pathTail, _amount, _desc) \
|
||||
// XXXkhuey
|
||||
nsCString censusWindowPath("event-counts/");
|
||||
censusWindowPath += windowPath;
|
||||
|
||||
// Remember the path for later.
|
||||
aWindowPaths->Put(aWindow->WindowID(), explicitWindowPath);
|
||||
|
||||
#define REPORT_SIZE(_pathTail, _amount, _desc) \
|
||||
do { \
|
||||
if (_amount > 0) { \
|
||||
nsAutoCString path(windowPath); \
|
||||
path += _pathTail; \
|
||||
nsresult rv; \
|
||||
rv = aCb->Callback(EmptyCString(), path, nsIMemoryReporter::KIND_HEAP,\
|
||||
nsIMemoryReporter::UNITS_BYTES, _amount, \
|
||||
NS_LITERAL_CSTRING(_desc), aClosure); \
|
||||
NS_ENSURE_SUCCESS(rv, rv); \
|
||||
nsAutoCString path(explicitWindowPath); \
|
||||
path += _pathTail; \
|
||||
nsresult rv; \
|
||||
rv = aCb->Callback(EmptyCString(), path, nsIMemoryReporter::KIND_HEAP, \
|
||||
nsIMemoryReporter::UNITS_BYTES, _amount, \
|
||||
NS_LITERAL_CSTRING(_desc), aClosure); \
|
||||
NS_ENSURE_SUCCESS(rv, rv); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define REPORT_COUNT(_pathTail, _amount, _desc) \
|
||||
do { \
|
||||
if (_amount > 0) { \
|
||||
nsAutoCString path(censusWindowPath); \
|
||||
path += _pathTail; \
|
||||
nsresult rv; \
|
||||
rv = aCb->Callback(EmptyCString(), path, nsIMemoryReporter::KIND_OTHER, \
|
||||
nsIMemoryReporter::UNITS_COUNT, _amount, \
|
||||
NS_LITERAL_CSTRING(_desc), aClosure); \
|
||||
NS_ENSURE_SUCCESS(rv, rv); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
nsWindowSizes windowSizes(WindowsMallocSizeOf);
|
||||
aWindow->SizeOfIncludingThis(&windowSizes);
|
||||
|
||||
REPORT("/dom/element-nodes", windowSizes.mDOMElementNodes,
|
||||
"Memory used by the element nodes in a window's DOM.");
|
||||
aWindowTotalSizes->mDOMElementNodes += windowSizes.mDOMElementNodes;
|
||||
REPORT_SIZE("/dom/element-nodes", windowSizes.mDOMElementNodesSize,
|
||||
"Memory used by the element nodes in a window's DOM.");
|
||||
aWindowTotalSizes->mDOMElementNodesSize += windowSizes.mDOMElementNodesSize;
|
||||
|
||||
REPORT("/dom/text-nodes", windowSizes.mDOMTextNodes,
|
||||
"Memory used by the text nodes in a window's DOM.");
|
||||
aWindowTotalSizes->mDOMTextNodes += windowSizes.mDOMTextNodes;
|
||||
REPORT_SIZE("/dom/text-nodes", windowSizes.mDOMTextNodesSize,
|
||||
"Memory used by the text nodes in a window's DOM.");
|
||||
aWindowTotalSizes->mDOMTextNodesSize += windowSizes.mDOMTextNodesSize;
|
||||
|
||||
REPORT("/dom/cdata-nodes", windowSizes.mDOMCDATANodes,
|
||||
"Memory used by the CDATA nodes in a window's DOM.");
|
||||
aWindowTotalSizes->mDOMCDATANodes += windowSizes.mDOMCDATANodes;
|
||||
REPORT_SIZE("/dom/cdata-nodes", windowSizes.mDOMCDATANodesSize,
|
||||
"Memory used by the CDATA nodes in a window's DOM.");
|
||||
aWindowTotalSizes->mDOMCDATANodesSize += windowSizes.mDOMCDATANodesSize;
|
||||
|
||||
REPORT("/dom/comment-nodes", windowSizes.mDOMCommentNodes,
|
||||
"Memory used by the comment nodes in a window's DOM.");
|
||||
aWindowTotalSizes->mDOMCommentNodes += windowSizes.mDOMCommentNodes;
|
||||
REPORT_SIZE("/dom/comment-nodes", windowSizes.mDOMCommentNodesSize,
|
||||
"Memory used by the comment nodes in a window's DOM.");
|
||||
aWindowTotalSizes->mDOMCommentNodesSize += windowSizes.mDOMCommentNodesSize;
|
||||
|
||||
REPORT("/dom/event-targets", windowSizes.mDOMEventTargets,
|
||||
"Memory used by the event targets table in a window's DOM, and the "
|
||||
"objects it points to, which include XHRs.");
|
||||
aWindowTotalSizes->mDOMEventTargets += windowSizes.mDOMEventTargets;
|
||||
REPORT_SIZE("/dom/event-targets", windowSizes.mDOMEventTargetsSize,
|
||||
"Memory used by the event targets table in a window's DOM, and "
|
||||
"the objects it points to, which include XHRs.");
|
||||
aWindowTotalSizes->mDOMEventTargetsSize += windowSizes.mDOMEventTargetsSize;
|
||||
|
||||
REPORT("/dom/other", windowSizes.mDOMOther,
|
||||
"Memory used by a window's DOM that isn't measured by the other "
|
||||
"'dom/' numbers.");
|
||||
aWindowTotalSizes->mDOMOther += windowSizes.mDOMOther;
|
||||
REPORT_COUNT("/dom/event-targets", windowSizes.mDOMEventTargetsCount,
|
||||
"Number of non-node event targets in the event targets table in "
|
||||
" window's DOM, such as XHRs.");
|
||||
aWindowTotalSizes->mDOMEventTargetsCount += windowSizes.mDOMEventTargetsCount;
|
||||
|
||||
REPORT("/property-tables",
|
||||
windowSizes.mPropertyTables,
|
||||
"Memory used for the property tables within a window.");
|
||||
aWindowTotalSizes->mPropertyTables += windowSizes.mPropertyTables;
|
||||
REPORT_COUNT("/dom/event-listeners", windowSizes.mDOMEventListenersCount,
|
||||
"Number of event listeners in a window, including event "
|
||||
"listeners on nodes and other event targets.");
|
||||
aWindowTotalSizes->mDOMEventListenersCount += windowSizes.mDOMEventListenersCount;
|
||||
|
||||
REPORT("/style-sheets", windowSizes.mStyleSheets,
|
||||
"Memory used by style sheets within a window.");
|
||||
aWindowTotalSizes->mStyleSheets += windowSizes.mStyleSheets;
|
||||
REPORT_SIZE("/dom/other", windowSizes.mDOMOtherSize,
|
||||
"Memory used by a window's DOM that isn't measured by the other "
|
||||
"'dom/' numbers.");
|
||||
aWindowTotalSizes->mDOMOtherSize += windowSizes.mDOMOtherSize;
|
||||
|
||||
REPORT("/layout/pres-shell", windowSizes.mLayoutPresShell,
|
||||
"Memory used by layout's PresShell, along with any structures "
|
||||
"allocated in its arena and not measured elsewhere, "
|
||||
"within a window.");
|
||||
aWindowTotalSizes->mLayoutPresShell += windowSizes.mLayoutPresShell;
|
||||
REPORT_SIZE("/property-tables", windowSizes.mPropertyTablesSize,
|
||||
"Memory used for the property tables within a window.");
|
||||
aWindowTotalSizes->mPropertyTablesSize += windowSizes.mPropertyTablesSize;
|
||||
|
||||
REPORT("/layout/line-boxes", windowSizes.mArenaStats.mLineBoxes,
|
||||
"Memory used by line boxes within a window.");
|
||||
REPORT_SIZE("/style-sheets", windowSizes.mStyleSheetsSize,
|
||||
"Memory used by style sheets within a window.");
|
||||
aWindowTotalSizes->mStyleSheetsSize += windowSizes.mStyleSheetsSize;
|
||||
|
||||
REPORT_SIZE("/layout/pres-shell", windowSizes.mLayoutPresShellSize,
|
||||
"Memory used by layout's PresShell, along with any structures "
|
||||
"allocated in its arena and not measured elsewhere, "
|
||||
"within a window.");
|
||||
aWindowTotalSizes->mLayoutPresShellSize += windowSizes.mLayoutPresShellSize;
|
||||
|
||||
REPORT_SIZE("/layout/line-boxes", windowSizes.mArenaStats.mLineBoxes,
|
||||
"Memory used by line boxes within a window.");
|
||||
aWindowTotalSizes->mArenaStats.mLineBoxes
|
||||
+= windowSizes.mArenaStats.mLineBoxes;
|
||||
|
||||
REPORT("/layout/rule-nodes", windowSizes.mArenaStats.mRuleNodes,
|
||||
"Memory used by CSS rule nodes within a window.");
|
||||
REPORT_SIZE("/layout/rule-nodes", windowSizes.mArenaStats.mRuleNodes,
|
||||
"Memory used by CSS rule nodes within a window.");
|
||||
aWindowTotalSizes->mArenaStats.mRuleNodes
|
||||
+= windowSizes.mArenaStats.mRuleNodes;
|
||||
|
||||
REPORT("/layout/style-contexts", windowSizes.mArenaStats.mStyleContexts,
|
||||
"Memory used by style contexts within a window.");
|
||||
REPORT_SIZE("/layout/style-contexts", windowSizes.mArenaStats.mStyleContexts,
|
||||
"Memory used by style contexts within a window.");
|
||||
aWindowTotalSizes->mArenaStats.mStyleContexts
|
||||
+= windowSizes.mArenaStats.mStyleContexts;
|
||||
|
||||
REPORT("/layout/style-sets", windowSizes.mLayoutStyleSets,
|
||||
"Memory used by style sets within a window.");
|
||||
aWindowTotalSizes->mLayoutStyleSets += windowSizes.mLayoutStyleSets;
|
||||
REPORT_SIZE("/layout/style-sets", windowSizes.mLayoutStyleSetsSize,
|
||||
"Memory used by style sets within a window.");
|
||||
aWindowTotalSizes->mLayoutStyleSetsSize += windowSizes.mLayoutStyleSetsSize;
|
||||
|
||||
REPORT("/layout/text-runs", windowSizes.mLayoutTextRuns,
|
||||
"Memory used for text-runs (glyph layout) in the PresShell's frame "
|
||||
"tree, within a window.");
|
||||
aWindowTotalSizes->mLayoutTextRuns += windowSizes.mLayoutTextRuns;
|
||||
REPORT_SIZE("/layout/text-runs", windowSizes.mLayoutTextRunsSize,
|
||||
"Memory used for text-runs (glyph layout) in the PresShell's "
|
||||
"frame tree, within a window.");
|
||||
aWindowTotalSizes->mLayoutTextRunsSize += windowSizes.mLayoutTextRunsSize;
|
||||
|
||||
REPORT("/layout/pres-contexts", windowSizes.mLayoutPresContext,
|
||||
"Memory used for the PresContext in the PresShell's frame "
|
||||
"within a window.");
|
||||
aWindowTotalSizes->mLayoutPresContext += windowSizes.mLayoutPresContext;
|
||||
REPORT_SIZE("/layout/pres-contexts", windowSizes.mLayoutPresContextSize,
|
||||
"Memory used for the PresContext in the PresShell's frame "
|
||||
"within a window.");
|
||||
aWindowTotalSizes->mLayoutPresContextSize += windowSizes.mLayoutPresContextSize;
|
||||
|
||||
// There are many different kinds of frames, but it is very likely
|
||||
// that only a few matter. Implement a cutoff so we don't bloat
|
||||
@ -279,9 +308,9 @@ CollectWindowReports(nsGlobalWindow *aWindow,
|
||||
if (frameSize < FRAME_SUNDRIES_THRESHOLD) { \
|
||||
frameSundriesSize += frameSize; \
|
||||
} else { \
|
||||
REPORT("/layout/frames/" # classname, frameSize, \
|
||||
"Memory used by frames of " \
|
||||
"type " #classname " within a window."); \
|
||||
REPORT_SIZE("/layout/frames/" # classname, frameSize, \
|
||||
"Memory used by frames of " \
|
||||
"type " #classname " within a window."); \
|
||||
} \
|
||||
aWindowTotalSizes->mArenaStats.FRAME_ID_STAT_FIELD(classname) \
|
||||
+= frameSize; \
|
||||
@ -290,12 +319,13 @@ CollectWindowReports(nsGlobalWindow *aWindow,
|
||||
#undef FRAME_ID
|
||||
|
||||
if (frameSundriesSize > 0) {
|
||||
REPORT("/layout/frames/sundries", frameSundriesSize,
|
||||
"The sum of all memory used by frames which were too small "
|
||||
"to be shown individually.");
|
||||
REPORT_SIZE("/layout/frames/sundries", frameSundriesSize,
|
||||
"The sum of all memory used by frames which were too small "
|
||||
"to be shown individually.");
|
||||
}
|
||||
|
||||
#undef REPORT
|
||||
#undef REPORT_SIZE
|
||||
#undef REPORT_COUNT
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -367,32 +397,32 @@ nsWindowMemoryReporter::CollectReports(nsIMemoryReporterCallback* aCb,
|
||||
NS_ENSURE_SUCCESS(rv, rv); \
|
||||
} while (0)
|
||||
|
||||
REPORT("window-objects/dom/element-nodes", windowTotalSizes.mDOMElementNodes,
|
||||
REPORT("window-objects/dom/element-nodes", windowTotalSizes.mDOMElementNodesSize,
|
||||
"This is the sum of all windows' 'dom/element-nodes' numbers.");
|
||||
|
||||
REPORT("window-objects/dom/text-nodes", windowTotalSizes.mDOMTextNodes,
|
||||
REPORT("window-objects/dom/text-nodes", windowTotalSizes.mDOMTextNodesSize,
|
||||
"This is the sum of all windows' 'dom/text-nodes' numbers.");
|
||||
|
||||
REPORT("window-objects/dom/cdata-nodes", windowTotalSizes.mDOMCDATANodes,
|
||||
REPORT("window-objects/dom/cdata-nodes", windowTotalSizes.mDOMCDATANodesSize,
|
||||
"This is the sum of all windows' 'dom/cdata-nodes' numbers.");
|
||||
|
||||
REPORT("window-objects/dom/comment-nodes", windowTotalSizes.mDOMCommentNodes,
|
||||
REPORT("window-objects/dom/comment-nodes", windowTotalSizes.mDOMCommentNodesSize,
|
||||
"This is the sum of all windows' 'dom/comment-nodes' numbers.");
|
||||
|
||||
REPORT("window-objects/dom/event-targets", windowTotalSizes.mDOMEventTargets,
|
||||
REPORT("window-objects/dom/event-targets", windowTotalSizes.mDOMEventTargetsSize,
|
||||
"This is the sum of all windows' 'dom/event-targets' numbers.");
|
||||
|
||||
REPORT("window-objects/dom/other", windowTotalSizes.mDOMOther,
|
||||
REPORT("window-objects/dom/other", windowTotalSizes.mDOMOtherSize,
|
||||
"This is the sum of all windows' 'dom/other' numbers.");
|
||||
|
||||
REPORT("window-objects/property-tables",
|
||||
windowTotalSizes.mPropertyTables,
|
||||
windowTotalSizes.mPropertyTablesSize,
|
||||
"This is the sum of all windows' 'property-tables' numbers.");
|
||||
|
||||
REPORT("window-objects/style-sheets", windowTotalSizes.mStyleSheets,
|
||||
REPORT("window-objects/style-sheets", windowTotalSizes.mStyleSheetsSize,
|
||||
"This is the sum of all windows' 'style-sheets' numbers.");
|
||||
|
||||
REPORT("window-objects/layout/pres-shell", windowTotalSizes.mLayoutPresShell,
|
||||
REPORT("window-objects/layout/pres-shell", windowTotalSizes.mLayoutPresShellSize,
|
||||
"This is the sum of all windows' 'layout/arenas' numbers.");
|
||||
|
||||
REPORT("window-objects/layout/line-boxes",
|
||||
@ -407,13 +437,13 @@ nsWindowMemoryReporter::CollectReports(nsIMemoryReporterCallback* aCb,
|
||||
windowTotalSizes.mArenaStats.mStyleContexts,
|
||||
"This is the sum of all windows' 'layout/style-contexts' numbers.");
|
||||
|
||||
REPORT("window-objects/layout/style-sets", windowTotalSizes.mLayoutStyleSets,
|
||||
REPORT("window-objects/layout/style-sets", windowTotalSizes.mLayoutStyleSetsSize,
|
||||
"This is the sum of all windows' 'layout/style-sets' numbers.");
|
||||
|
||||
REPORT("window-objects/layout/text-runs", windowTotalSizes.mLayoutTextRuns,
|
||||
REPORT("window-objects/layout/text-runs", windowTotalSizes.mLayoutTextRunsSize,
|
||||
"This is the sum of all windows' 'layout/text-runs' numbers.");
|
||||
|
||||
REPORT("window-objects/layout/pres-contexts", windowTotalSizes.mLayoutPresContext,
|
||||
REPORT("window-objects/layout/pres-contexts", windowTotalSizes.mLayoutPresContextSize,
|
||||
"This is the sum of all windows' 'layout/pres-contexts' numbers.");
|
||||
|
||||
size_t frameTotal = 0;
|
||||
|
@ -32,19 +32,23 @@ public:
|
||||
}
|
||||
mozilla::MallocSizeOf mMallocSizeOf;
|
||||
nsArenaMemoryStats mArenaStats;
|
||||
size_t mDOMElementNodes;
|
||||
size_t mDOMTextNodes;
|
||||
size_t mDOMCDATANodes;
|
||||
size_t mDOMCommentNodes;
|
||||
size_t mDOMEventTargets;
|
||||
size_t mDOMOther;
|
||||
size_t mStyleSheets;
|
||||
size_t mLayoutPresShell;
|
||||
size_t mLayoutStyleSets;
|
||||
size_t mLayoutTextRuns;
|
||||
size_t mLayoutPresContext;
|
||||
size_t mPropertyTables;
|
||||
size_t mDOMElementNodesSize;
|
||||
size_t mDOMTextNodesSize;
|
||||
size_t mDOMCDATANodesSize;
|
||||
size_t mDOMCommentNodesSize;
|
||||
size_t mDOMEventTargetsSize;
|
||||
size_t mDOMOtherSize;
|
||||
size_t mStyleSheetsSize;
|
||||
size_t mLayoutPresShellSize;
|
||||
size_t mLayoutStyleSetsSize;
|
||||
size_t mLayoutTextRunsSize;
|
||||
size_t mLayoutPresContextSize;
|
||||
size_t mPropertyTablesSize;
|
||||
|
||||
uint32_t mDOMEventTargetsCount;
|
||||
uint32_t mDOMEventListenersCount;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* nsWindowMemoryReporter is responsible for the 'explicit/window-objects'
|
||||
|
Loading…
Reference in New Issue
Block a user