OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.VBox} | 7 * @extends {WebInspector.VBox} |
8 * @param {!WebInspector.TimelineModel} model | 8 * @param {!WebInspector.TimelineModel} model |
9 * @param {!Array<!WebInspector.TimelineModel.Filter>} filters | 9 * @param {!Array<!WebInspector.TimelineModel.Filter>} filters |
10 */ | 10 */ |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 * @param {!Element} parent | 74 * @param {!Element} parent |
75 */ | 75 */ |
76 _populateToolbar: function(parent) { }, | 76 _populateToolbar: function(parent) { }, |
77 | 77 |
78 /** | 78 /** |
79 * @param {?WebInspector.TimelineProfileTree.Node} node | 79 * @param {?WebInspector.TimelineProfileTree.Node} node |
80 */ | 80 */ |
81 _onHover: function(node) { }, | 81 _onHover: function(node) { }, |
82 | 82 |
83 /** | 83 /** |
84 * @param {!RuntimeAgent.CallFrame} frame | 84 * @param {!WebInspector.TracingModel.Event} event |
85 * @return {?Element} | 85 * @return {?Element} |
86 */ | 86 */ |
87 _linkifyLocationForTracing: function(frame) | 87 _linkifyLocation: function(event) |
88 { | 88 { |
89 return this._linkifier.maybeLinkifyConsoleCallFrameForTracing(this._mode l.target(), frame); | 89 var target = this._model.targetByEvent(event); |
90 if (!target) | |
91 return null; | |
92 var frame = WebInspector.TimelineProfileTree.eventStackFrame(event); | |
93 if (!frame) | |
94 return null; | |
95 return event.name === WebInspector.TimelineModel.RecordType.JSFrame | |
96 ? this._linkifier.maybeLinkifyConsoleCallFrame(target, frame) | |
97 : this._linkifier.maybeLinkifyConsoleCallFrameForTracing(target, fra me); | |
90 }, | 98 }, |
91 | 99 |
92 /** | 100 /** |
93 * @param {!RuntimeAgent.CallFrame} frame | |
94 * @return {?Element} | |
95 */ | |
96 linkifyLocation: function(frame) | |
97 { | |
98 return this._linkifier.maybeLinkifyConsoleCallFrame(this._model.target() , frame); | |
99 }, | |
100 | |
101 /** | |
102 * @param {!WebInspector.TimelineProfileTree.Node} treeNode | 101 * @param {!WebInspector.TimelineProfileTree.Node} treeNode |
103 * @param {boolean} suppressSelectedEvent | 102 * @param {boolean} suppressSelectedEvent |
104 */ | 103 */ |
105 selectProfileNode: function(treeNode, suppressSelectedEvent) | 104 selectProfileNode: function(treeNode, suppressSelectedEvent) |
106 { | 105 { |
107 var pathToRoot = []; | 106 var pathToRoot = []; |
108 for (var node = treeNode; node; node = node.parent) | 107 for (var node = treeNode; node; node = node.parent) |
109 pathToRoot.push(node); | 108 pathToRoot.push(node); |
110 for (var i = pathToRoot.length - 1; i > 0; --i) { | 109 for (var i = pathToRoot.length - 1; i > 0; --i) { |
111 var gridNode = this._dataGridNodeForTreeNode(pathToRoot[i]); | 110 var gridNode = this._dataGridNodeForTreeNode(pathToRoot[i]); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
346 name.textContent = info.name; | 345 name.textContent = info.name; |
347 icon.style.backgroundColor = info.color; | 346 icon.style.backgroundColor = info.color; |
348 } else if (event) { | 347 } else if (event) { |
349 var data = event.args["data"]; | 348 var data = event.args["data"]; |
350 var deoptReason = data && data["deoptReason"]; | 349 var deoptReason = data && data["deoptReason"]; |
351 if (deoptReason && deoptReason !== "no reason") | 350 if (deoptReason && deoptReason !== "no reason") |
352 container.createChild("div", "activity-warning").title = WebInsp ector.UIString("Not optimized: %s", deoptReason); | 351 container.createChild("div", "activity-warning").title = WebInsp ector.UIString("Not optimized: %s", deoptReason); |
353 name.textContent = event.name === WebInspector.TimelineModel.RecordT ype.JSFrame | 352 name.textContent = event.name === WebInspector.TimelineModel.RecordT ype.JSFrame |
354 ? WebInspector.beautifyFunctionName(event.args["data"]["function Name"]) | 353 ? WebInspector.beautifyFunctionName(event.args["data"]["function Name"]) |
355 : WebInspector.TimelineUIUtils.eventTitle(event); | 354 : WebInspector.TimelineUIUtils.eventTitle(event); |
356 var frame = WebInspector.TimelineProfileTree.eventStackFrame(event); | 355 var link = this._treeView._linkifyLocation(event) |
caseq
2016/07/19 22:48:58
terminate with ";"
alph
2016/07/19 23:10:29
Done.
| |
357 if (frame && frame["url"]) { | 356 if (link) |
358 var callFrame = /** @type {!RuntimeAgent.CallFrame} */ (frame); | 357 container.createChild("div", "activity-link").appendChild(link); |
359 var link = event.name === WebInspector.TimelineModel.RecordType. JSFrame | |
360 ? this._treeView.linkifyLocation(callFrame) | |
361 : this._treeView._linkifyLocationForTracing(callFrame); | |
362 if (link) | |
363 container.createChild("div", "activity-link").appendChild(li nk); | |
364 } | |
365 icon.style.backgroundColor = WebInspector.TimelineUIUtils.eventColor (event); | 358 icon.style.backgroundColor = WebInspector.TimelineUIUtils.eventColor (event); |
366 } | 359 } |
367 return cell; | 360 return cell; |
368 }, | 361 }, |
369 | 362 |
370 /** | 363 /** |
371 * @param {string} columnIdentifier | 364 * @param {string} columnIdentifier |
372 * @return {?Element} | 365 * @return {?Element} |
373 */ | 366 */ |
374 _createValueCell: function(columnIdentifier) | 367 _createValueCell: function(columnIdentifier) |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
890 return selectedNode && /** @type {!WebInspector.TimelineTreeView.GridNod e} */ (selectedNode)._profileNode; | 883 return selectedNode && /** @type {!WebInspector.TimelineTreeView.GridNod e} */ (selectedNode)._profileNode; |
891 }, | 884 }, |
892 | 885 |
893 _onSelectionChanged: function() | 886 _onSelectionChanged: function() |
894 { | 887 { |
895 this.dispatchEventToListeners(WebInspector.TimelineStackView.Events.Sele ctionChanged); | 888 this.dispatchEventToListeners(WebInspector.TimelineStackView.Events.Sele ctionChanged); |
896 }, | 889 }, |
897 | 890 |
898 __proto__: WebInspector.VBox.prototype | 891 __proto__: WebInspector.VBox.prototype |
899 } | 892 } |
OLD | NEW |