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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineJSProfile.js

Issue 2156523003: [DevTools] Fix links for JSFrame records in timeline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 WebInspector.TimelineJSProfileProcessor = { }; 6 WebInspector.TimelineJSProfileProcessor = { };
7 7
8 /** 8 /**
9 * @param {!WebInspector.CPUProfileDataModel} jsProfileModel 9 * @param {!WebInspector.CPUProfileDataModel} jsProfileModel
10 * @param {!WebInspector.TracingModel.Thread} thread 10 * @param {!WebInspector.TracingModel.Thread} thread
(...skipping 15 matching lines...) Expand all
26 if (!node) { 26 if (!node) {
27 console.error(`Node with unknown id ${samples[i]} at index ${i}`); 27 console.error(`Node with unknown id ${samples[i]} at index ${i}`);
28 continue; 28 continue;
29 } 29 }
30 if (node === gcNode || node === idleNode) 30 if (node === gcNode || node === idleNode)
31 continue; 31 continue;
32 var callFrames = nodeToStackMap.get(node); 32 var callFrames = nodeToStackMap.get(node);
33 if (!callFrames) { 33 if (!callFrames) {
34 callFrames = /** @type {!Array<!RuntimeAgent.CallFrame>} */ (new Arr ay(node.depth + 1)); 34 callFrames = /** @type {!Array<!RuntimeAgent.CallFrame>} */ (new Arr ay(node.depth + 1));
35 nodeToStackMap.set(node, callFrames); 35 nodeToStackMap.set(node, callFrames);
36 for (var j = 0; node.parent; node = node.parent) 36 for (var j = 0; node.parent; node = node.parent) {
37 callFrames[j++] = /** @type {!RuntimeAgent.CallFrame} */ (node); 37 // Tracing Events are 1-based.
38 callFrames[j++] = /** @type {!RuntimeAgent.CallFrame} */ ({
39 functionName: node.functionName,
alph 2016/07/15 22:42:25 You're creating a bunch of objects here. There wer
40 scriptId: node.scriptId,
41 url: node.url,
42 lineNumber: node.lineNumber + 1,
43 columnNumber: node.columnNumber + 1
44 });
45 }
38 } 46 }
39 var jsSampleEvent = new WebInspector.TracingModel.Event(WebInspector.Tra cingModel.DevToolsTimelineEventCategory, 47 var jsSampleEvent = new WebInspector.TracingModel.Event(WebInspector.Tra cingModel.DevToolsTimelineEventCategory,
40 WebInspector.TimelineModel.RecordType.JSSample, 48 WebInspector.TimelineModel.RecordType.JSSample,
41 WebInspector.TracingModel.Phase.Instant, timestamps[i], thread); 49 WebInspector.TracingModel.Phase.Instant, timestamps[i], thread);
42 jsSampleEvent.args["data"] = { stackTrace: callFrames }; 50 jsSampleEvent.args["data"] = { stackTrace: callFrames };
43 jsEvents.push(jsSampleEvent); 51 jsEvents.push(jsSampleEvent);
44 } 52 }
45 return jsEvents; 53 return jsEvents;
46 } 54 }
47 55
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 WebInspector.TracingModel.Phase.Instant, e.startTime, e.thread); 496 WebInspector.TracingModel.Phase.Instant, e.startTime, e.thread);
489 sampleEvent.ordinal = e.ordinal; 497 sampleEvent.ordinal = e.ordinal;
490 sampleEvent.args = {"data": {"stackTrace": stack }}; 498 sampleEvent.args = {"data": {"stackTrace": stack }};
491 samples.push(sampleEvent); 499 samples.push(sampleEvent);
492 break; 500 break;
493 } 501 }
494 } 502 }
495 503
496 return samples; 504 return samples;
497 } 505 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698