Fix import from Chrome < 69 when there are multiple profiles

It seems like #160 accidentally broken import of profiles in some circumstances from Chrome < 69. Before #160, we always took the first profile in the list *but* the profiles were not sorted chronologically. After #160 but before this PR, we were taking the chronologically first.

After this PR, we always take the chronologically last `CpuProfile` event in the trace.
This commit is contained in:
Jamie Wong
2018-09-12 18:21:04 -07:00
committed by GitHub
parent 3ba60a424d
commit ee0c2c5025
-1
View File
@@ -74,7 +74,6 @@ export function importFromChromeTimeline(events: TimelineEvent[]): Profile {
for (let event of events) {
if (event.name == 'CpuProfile') {
cpuProfile = event.args.data.cpuProfile as CPUProfile
break
}
if (event.name == 'Profile') {