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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/CPUProfileDataModel.js

Issue 2169153002: DevTools: make all timeline trace events use 0-based line numbers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update expectation 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
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 * @constructor 6 * @constructor
7 * @extends {WebInspector.ProfileNode} 7 * @extends {WebInspector.ProfileNode}
8 * @param {!ProfilerAgent.CPUProfileNode} sourceNode 8 * @param {!ProfilerAgent.CPUProfileNode} node
9 * @param {number} sampleTime 9 * @param {number} sampleTime
10 */ 10 */
11 WebInspector.CPUProfileNode = function(sourceNode, sampleTime) 11 WebInspector.CPUProfileNode = function(node, sampleTime)
12 { 12 {
13 if (sourceNode.callFrame) { 13 var callFrame = node.callFrame || /** @type {!RuntimeAgent.CallFrame} */ ({
14 WebInspector.ProfileNode.call(this, sourceNode.callFrame); 14 // Backward compatibility for old SamplingHeapProfileNode format.
15 } else { 15 functionName: node["functionName"],
16 // Backward compatibility for old CPUProfileNode format. 16 scriptId: node["scriptId"],
17 var frame = /** @type {!RuntimeAgent.CallFrame} */(sourceNode); 17 url: node["url"],
18 WebInspector.ProfileNode.call(this, { 18 lineNumber: node["lineNumber"] - 1,
19 functionName: frame.functionName, 19 columnNumber: node["columnNumber"] - 1
20 scriptId: frame.scriptId, url: frame.url, 20 });
21 lineNumber: frame.lineNumber - 1, 21 WebInspector.ProfileNode.call(this, callFrame);
22 columnNumber: frame.columnNumber - 1 22 this.id = node.id;
23 }); 23 this.self = node.hitCount * sampleTime;
24 } 24 this.positionTicks = node.positionTicks;
25 this.id = sourceNode.id; 25 this.deoptReason = node.deoptReason;
26 this.self = sourceNode.hitCount * sampleTime;
27 this.positionTicks = sourceNode.positionTicks;
28 this.deoptReason = sourceNode.deoptReason;
29 } 26 }
30 27
31 WebInspector.CPUProfileNode.prototype = { 28 WebInspector.CPUProfileNode.prototype = {
32 __proto__: WebInspector.ProfileNode.prototype 29 __proto__: WebInspector.ProfileNode.prototype
33 } 30 }
34 31
35 /** 32 /**
36 * @constructor 33 * @constructor
37 * @extends {WebInspector.ProfileTreeModel} 34 * @extends {WebInspector.ProfileTreeModel}
38 * @param {!ProfilerAgent.CPUProfile} profile 35 * @param {!ProfilerAgent.CPUProfile} profile
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 * @param {number} index 298 * @param {number} index
302 * @return {?WebInspector.CPUProfileNode} 299 * @return {?WebInspector.CPUProfileNode}
303 */ 300 */
304 nodeByIndex: function(index) 301 nodeByIndex: function(index)
305 { 302 {
306 return this._idToNode.get(this.samples[index]) || null; 303 return this._idToNode.get(this.samples[index]) || null;
307 }, 304 },
308 305
309 __proto__: WebInspector.ProfileTreeModel.prototype 306 __proto__: WebInspector.ProfileTreeModel.prototype
310 } 307 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698