Bug 1207696 Part 5j - Don't add GC events to timelines when recording or replaying, r=mccr8.

--HG--
extra : rebase_source : 1c600ce8918a3b343864c8a3606a4de5d25b87f6
This commit is contained in:
Brian Hackett 2018-07-23 14:38:49 +00:00
parent 3bf3cc3f2e
commit da3fee20ba

View File

@ -949,14 +949,17 @@ CycleCollectedJSRuntime::GCNurseryCollectionCallback(JSContext* aContext,
MOZ_ASSERT(CycleCollectedJSContext::Get()->Context() == aContext);
MOZ_ASSERT(NS_IsMainThread());
RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
if (timelines && !timelines->IsEmpty()) {
UniquePtr<AbstractTimelineMarker> abstractMarker(
MakeUnique<MinorGCMarker>(aProgress, aReason));
timelines->AddMarkerForAllObservedDocShells(abstractMarker);
if (!recordreplay::IsRecordingOrReplaying()) {
RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
if (timelines && !timelines->IsEmpty()) {
UniquePtr<AbstractTimelineMarker> abstractMarker(
MakeUnique<MinorGCMarker>(aProgress, aReason));
timelines->AddMarkerForAllObservedDocShells(abstractMarker);
}
}
if (aProgress == JS::GCNurseryProgress::GC_NURSERY_COLLECTION_START) {
recordreplay::AutoPassThroughThreadEvents pt;
self->mLatestNurseryCollectionStart = TimeStamp::Now();
}
#ifdef MOZ_GECKO_PROFILER