Bug 1183229 - Add a way to count the number of timeline-observed docshells outside of nsDocShell, r=smaug
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user