Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Unified Diff: third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js

Issue 2434813003: DevTools: Support reading updated version of CPU profile. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-streamed-cpu-profile.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js
index c025c3267102021a69cde9434c5af8c2f9835412..36c86326b61652606a7e68f1ebc99fc6177e1d7d 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js
@@ -161,7 +161,8 @@ WebInspector.TimelineModel.RecordType = {
// CpuProfile is a virtual event created on frontend to support
// serialization of CPU Profiles within tracing timeline data.
- CpuProfile: "CpuProfile"
+ CpuProfile: "CpuProfile",
+ Profile: "Profile"
}
WebInspector.TimelineModel.Category = {
@@ -752,7 +753,7 @@ WebInspector.TimelineModel.prototype = {
}
if (!cpuProfile) {
- cpuProfileEvent = events.find(e => e.name === WebInspector.TimelineModel.RecordType.CpuProfile);
+ cpuProfileEvent = events.find(e => e.name === WebInspector.TimelineModel.RecordType.Profile);
if (!cpuProfileEvent)
return null;
var profileGroup = tracingModel.profileGroup(cpuProfileEvent.id);
@@ -773,9 +774,14 @@ WebInspector.TimelineModel.prototype = {
cpuProfile.startTime = eventData["startTime"];
if ("endTime" in eventData)
cpuProfile.endTime = eventData["endTime"];
- cpuProfile.nodes.pushAll(eventData["nodes"] || []);
- cpuProfile.samples.pushAll(eventData["samples"] || []);
+ var nodesAndSamples = eventData["cpuProfile"] || {};
+ cpuProfile.nodes.pushAll(nodesAndSamples["nodes"] || []);
+ cpuProfile.samples.pushAll(nodesAndSamples["samples"] || []);
cpuProfile.timeDeltas.pushAll(eventData["timeDeltas"] || []);
+ if (cpuProfile.samples.length !== cpuProfile.timeDeltas.length) {
+ WebInspector.console.error("Failed to parse CPU profile.");
+ return null;
+ }
}
if (!cpuProfile.endTime)
cpuProfile.endTime = cpuProfile.timeDeltas.reduce((x, y) => x + y, cpuProfile.startTime);
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-streamed-cpu-profile.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698