Backed out changeset f9b9ee8fb89e for causing build failures.

This commit is contained in:
Benoit Girard 2014-10-13 16:42:04 -04:00
parent fd5261495d
commit ad512d37fa
2 changed files with 3 additions and 26 deletions

View File

@ -2858,11 +2858,6 @@ nsDocShell::PopProfileTimelineMarkers(JSContext* aCx,
nsTArray<mozilla::dom::ProfileTimelineMarker> profileTimelineMarkers;
// If we see an unpaired START, we keep it around for the next call
// to PopProfileTimelineMarkers. We store the kept START objects in
// this array.
decltype(mProfileTimelineMarkers) keptMarkers;
for (uint32_t i = 0; i < mProfileTimelineMarkers.Length(); ++i) {
ProfilerMarkerTracing* startPayload = static_cast<ProfilerMarkerTracing*>(
mProfileTimelineMarkers[i]->mPayload);
@ -2871,8 +2866,6 @@ nsDocShell::PopProfileTimelineMarkers(JSContext* aCx,
bool hasSeenPaintedLayer = false;
if (startPayload->GetMetaData() == TRACING_INTERVAL_START) {
bool hasSeenEnd = false;
// The assumption is that the devtools timeline flushes markers frequently
// enough for the amount of markers to always be small enough that the
// nested for loop isn't going to be a performance problem.
@ -2900,26 +2893,15 @@ nsDocShell::PopProfileTimelineMarkers(JSContext* aCx,
profileTimelineMarkers.AppendElement(marker);
}
// We want the start to be dropped either way.
hasSeenEnd = true;
break;
}
}
// If we did not see the corresponding END, keep the START.
if (!hasSeenEnd) {
keptMarkers.AppendElement(mProfileTimelineMarkers[i]);
mProfileTimelineMarkers.RemoveElementAt(i);
--i;
}
}
}
ToJSValue(aCx, profileTimelineMarkers, aProfileTimelineMarkers);
ClearProfileTimelineMarkers();
mProfileTimelineMarkers.SwapElements(keptMarkers);
return NS_OK;
#else
@ -2970,7 +2952,8 @@ nsDocShell::ClearProfileTimelineMarkers()
{
#ifdef MOZ_ENABLE_PROFILER_SPS
for (uint32_t i = 0; i < mProfileTimelineMarkers.Length(); ++i) {
delete mProfileTimelineMarkers[i];
delete mProfileTimelineMarkers[i]->mPayload;
mProfileTimelineMarkers[i]->mPayload = nullptr;
}
mProfileTimelineMarkers.Clear();
#endif

View File

@ -959,17 +959,11 @@ private:
, mPayload(aPayload)
, mTime(aTime)
{}
~InternalProfileTimelineMarker()
{
delete mPayload;
}
const char* mName;
ProfilerMarkerTracing* mPayload;
float mTime;
};
nsTArray<InternalProfileTimelineMarker*> mProfileTimelineMarkers;
nsTArray<nsAutoPtr<InternalProfileTimelineMarker>> mProfileTimelineMarkers;
// Get the elapsed time (in millis) since the profile timeline recording
// started