зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1065954 - Avoid drawing start/end markers in the timeline if no layer in the inspected docshell was painted. r=BenWa
This commit is contained in:
Родитель
4bb3785445
Коммит
21fbda20ef
|
@ -2861,22 +2861,24 @@ nsDocShell::PopProfileTimelineMarkers(JSContext* aCx,
|
|||
mProfileTimelineMarkers[j]->mPayload);
|
||||
const char* endMarkerName = mProfileTimelineMarkers[j]->mName;
|
||||
|
||||
// Look for Layer markers to stream out paint markers
|
||||
// Look for Layer markers to stream out paint markers.
|
||||
if (strcmp(endMarkerName, "Layer") == 0) {
|
||||
hasSeenPaintedLayer = true;
|
||||
}
|
||||
|
||||
bool isSameMarkerType = strcmp(startMarkerName, endMarkerName) == 0;
|
||||
bool isValidType = strcmp(endMarkerName, "Paint") != 0 ||
|
||||
hasSeenPaintedLayer;
|
||||
bool isPaint = strcmp(startMarkerName, "Paint") == 0;
|
||||
|
||||
if (endPayload->GetMetaData() == TRACING_INTERVAL_END &&
|
||||
isSameMarkerType && isValidType) {
|
||||
mozilla::dom::ProfileTimelineMarker marker;
|
||||
marker.mName = NS_ConvertUTF8toUTF16(startMarkerName);
|
||||
marker.mStart = mProfileTimelineMarkers[i]->mTime;
|
||||
marker.mEnd = mProfileTimelineMarkers[j]->mTime;
|
||||
profileTimelineMarkers.AppendElement(marker);
|
||||
// Pair start and end markers.
|
||||
if (endPayload->GetMetaData() == TRACING_INTERVAL_END && isSameMarkerType) {
|
||||
// But ignore paint start/end if no layer has been painted.
|
||||
if (!isPaint || (isPaint && hasSeenPaintedLayer)) {
|
||||
mozilla::dom::ProfileTimelineMarker marker;
|
||||
marker.mName = NS_ConvertUTF8toUTF16(startMarkerName);
|
||||
marker.mStart = mProfileTimelineMarkers[i]->mTime;
|
||||
marker.mEnd = mProfileTimelineMarkers[j]->mTime;
|
||||
profileTimelineMarkers.AppendElement(marker);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче