Bug 1183229 - Add a way to count the number of timeline-observed docshells outside of nsDocShell, r=smaug

This commit is contained in:
Victor Porof
2015-07-18 09:35:59 -04:00
parent d22151d072
commit 90aed03d00
9 changed files with 77 additions and 14 deletions

View File

@@ -2929,8 +2929,6 @@ nsDocShell::HistoryTransactionRemoved(int32_t aIndex)
return NS_OK;
}
unsigned long nsDocShell::gProfileTimelineRecordingsCount = 0;
mozilla::LinkedList<nsDocShell::ObservedDocShell>* nsDocShell::gObservedDocShells = nullptr;
NS_IMETHODIMP
@@ -2939,14 +2937,14 @@ nsDocShell::SetRecordProfileTimelineMarkers(bool aValue)
bool currentValue = nsIDocShell::GetRecordProfileTimelineMarkers();
if (currentValue != aValue) {
if (aValue) {
++gProfileTimelineRecordingsCount;
TimelineConsumers::AddConsumer();
UseEntryScriptProfiling();
MOZ_ASSERT(!mObserved);
mObserved.reset(new ObservedDocShell(this));
GetOrCreateObservedDocShells().insertFront(mObserved.get());
} else {
--gProfileTimelineRecordingsCount;
TimelineConsumers::RemoveConsumer();
UnuseEntryScriptProfiling();
mObserved.reset(nullptr);