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

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

Issue 2486853002: Timeline: remove TimelineModel inferred properties from TracingModel.Event (Closed)
Patch Set: addressed comments and rebased Created 4 years, 1 month 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 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 WebInspector.CPUProfileNode = class extends WebInspector.ProfileNode { 7 WebInspector.CPUProfileNode = class extends WebInspector.ProfileNode {
8 /** 8 /**
9 * @param {!Protocol.Profiler.ProfileNode} node 9 * @param {!Protocol.Profiler.ProfileNode} node
10 * @param {number} sampleTime 10 * @param {number} sampleTime
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 * @return {!WebInspector.CPUProfileNode} 104 * @return {!WebInspector.CPUProfileNode}
105 */ 105 */
106 _translateProfileTree(nodes) { 106 _translateProfileTree(nodes) {
107 /** 107 /**
108 * @param {!Protocol.Profiler.ProfileNode} node 108 * @param {!Protocol.Profiler.ProfileNode} node
109 * @return {boolean} 109 * @return {boolean}
110 */ 110 */
111 function isNativeNode(node) { 111 function isNativeNode(node) {
112 if (node.callFrame) 112 if (node.callFrame)
113 return !!node.callFrame.url && node.callFrame.url.startsWith('native '); 113 return !!node.callFrame.url && node.callFrame.url.startsWith('native ');
114 return !!node.url && node.url.startsWith('native '); 114 return !!node['url'] && node['url'].startsWith('native ');
115 } 115 }
116 /** 116 /**
117 * @param {!Array<!Protocol.Profiler.ProfileNode>} nodes 117 * @param {!Array<!Protocol.Profiler.ProfileNode>} nodes
118 */ 118 */
119 function buildChildrenFromParents(nodes) { 119 function buildChildrenFromParents(nodes) {
120 if (nodes[0].children) 120 if (nodes[0].children)
121 return; 121 return;
122 nodes[0].children = []; 122 nodes[0].children = [];
123 for (var i = 1; i < nodes.length; ++i) { 123 for (var i = 1; i < nodes.length; ++i) {
124 var node = nodes[i]; 124 var node = nodes[i];
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 } 356 }
357 357
358 /** 358 /**
359 * @param {number} index 359 * @param {number} index
360 * @return {?WebInspector.CPUProfileNode} 360 * @return {?WebInspector.CPUProfileNode}
361 */ 361 */
362 nodeByIndex(index) { 362 nodeByIndex(index) {
363 return this._idToNode.get(this.samples[index]) || null; 363 return this._idToNode.get(this.samples[index]) || null;
364 } 364 }
365 }; 365 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698