Bug 1104213 - add stack traces to timeline markers. r=smaug r=vporof

This commit is contained in:
Tom Tromey
2014-12-29 11:32:00 +01:00
parent 65eeab6f83
commit b6ceb31c8a
20 changed files with 594 additions and 124 deletions

View File

@@ -2887,6 +2887,7 @@ nsDocShell::PopProfileTimelineMarkers(JSContext* aCx,
// docShell if an Layer marker type was recorded too.
nsTArray<mozilla::dom::ProfileTimelineMarker> profileTimelineMarkers;
SequenceRooter<mozilla::dom::ProfileTimelineMarker> rooter(aCx, &profileTimelineMarkers);
// If we see an unpaired START, we keep it around for the next call
// to PopProfileTimelineMarkers. We store the kept START objects in
@@ -2938,17 +2939,18 @@ nsDocShell::PopProfileTimelineMarkers(JSContext* aCx,
} else {
// But ignore paint start/end if no layer has been painted.
if (!isPaint || (isPaint && hasSeenPaintedLayer)) {
mozilla::dom::ProfileTimelineMarker marker;
mozilla::dom::ProfileTimelineMarker* marker =
profileTimelineMarkers.AppendElement();
marker.mName = NS_ConvertUTF8toUTF16(startPayload->GetName());
marker.mStart = startPayload->GetTime();
marker.mEnd = endPayload->GetTime();
marker->mName = NS_ConvertUTF8toUTF16(startPayload->GetName());
marker->mStart = startPayload->GetTime();
marker->mEnd = endPayload->GetTime();
marker->mStack = startPayload->GetStack();
if (isPaint) {
marker.mRectangles.Construct(layerRectangles);
} else {
startPayload->AddDetails(marker);
marker->mRectangles.Construct(layerRectangles);
}
profileTimelineMarkers.AppendElement(marker);
startPayload->AddDetails(*marker);
endPayload->AddDetails(*marker);
}
// We want the start to be dropped either way.