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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js

Issue 2156523003: [DevTools] Fix links for JSFrame records in timeline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased 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 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 {!RuntimeAgent.CallFrame} frame
85 * @return {?Element} 85 * @return {?Element}
86 */ 86 */
87 _linkifyLocationForTracing: function(frame)
88 {
89 return this._linkifier.maybeLinkifyConsoleCallFrameForTracing(this._mode l.target(), frame);
90 },
91
92 /**
93 * @param {!RuntimeAgent.CallFrame} frame
94 * @return {?Element}
95 */
87 linkifyLocation: function(frame) 96 linkifyLocation: function(frame)
88 { 97 {
89 return this._linkifier.maybeLinkifyConsoleCallFrameForTimeline(this._mod el.target(), frame); 98 return this._linkifier.maybeLinkifyConsoleCallFrame(this._model.target() , frame);
90 }, 99 },
91 100
92 /** 101 /**
93 * @param {!WebInspector.TimelineProfileTree.Node} treeNode 102 * @param {!WebInspector.TimelineProfileTree.Node} treeNode
94 * @param {boolean} suppressSelectedEvent 103 * @param {boolean} suppressSelectedEvent
95 */ 104 */
96 selectProfileNode: function(treeNode, suppressSelectedEvent) 105 selectProfileNode: function(treeNode, suppressSelectedEvent)
97 { 106 {
98 var pathToRoot = []; 107 var pathToRoot = [];
99 for (var node = treeNode; node; node = node.parent) 108 for (var node = treeNode; node; node = node.parent)
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 var data = event.args["data"]; 349 var data = event.args["data"];
341 var deoptReason = data && data["deoptReason"]; 350 var deoptReason = data && data["deoptReason"];
342 if (deoptReason && deoptReason !== "no reason") 351 if (deoptReason && deoptReason !== "no reason")
343 container.createChild("div", "activity-warning").title = WebInsp ector.UIString("Not optimized: %s", deoptReason); 352 container.createChild("div", "activity-warning").title = WebInsp ector.UIString("Not optimized: %s", deoptReason);
344 name.textContent = event.name === WebInspector.TimelineModel.RecordT ype.JSFrame 353 name.textContent = event.name === WebInspector.TimelineModel.RecordT ype.JSFrame
345 ? WebInspector.beautifyFunctionName(event.args["data"]["function Name"]) 354 ? WebInspector.beautifyFunctionName(event.args["data"]["function Name"])
346 : WebInspector.TimelineUIUtils.eventTitle(event); 355 : WebInspector.TimelineUIUtils.eventTitle(event);
347 var frame = WebInspector.TimelineProfileTree.eventStackFrame(event); 356 var frame = WebInspector.TimelineProfileTree.eventStackFrame(event);
348 if (frame && frame["url"]) { 357 if (frame && frame["url"]) {
349 var callFrame = /** @type {!RuntimeAgent.CallFrame} */ (frame); 358 var callFrame = /** @type {!RuntimeAgent.CallFrame} */ (frame);
350 var link = this._treeView.linkifyLocation(callFrame); 359 var link = event.name === WebInspector.TimelineModel.RecordType. JSFrame
360 ? this._treeView.linkifyLocation(callFrame)
361 : this._treeView._linkifyLocationForTracing(callFrame);
351 if (link) 362 if (link)
352 container.createChild("div", "activity-link").appendChild(li nk); 363 container.createChild("div", "activity-link").appendChild(li nk);
353 } 364 }
354 icon.style.backgroundColor = WebInspector.TimelineUIUtils.eventColor (event); 365 icon.style.backgroundColor = WebInspector.TimelineUIUtils.eventColor (event);
355 } 366 }
356 return cell; 367 return cell;
357 }, 368 },
358 369
359 /** 370 /**
360 * @param {string} columnIdentifier 371 * @param {string} columnIdentifier
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 return selectedNode && /** @type {!WebInspector.TimelineTreeView.GridNod e} */ (selectedNode)._profileNode; 890 return selectedNode && /** @type {!WebInspector.TimelineTreeView.GridNod e} */ (selectedNode)._profileNode;
880 }, 891 },
881 892
882 _onSelectionChanged: function() 893 _onSelectionChanged: function()
883 { 894 {
884 this.dispatchEventToListeners(WebInspector.TimelineStackView.Events.Sele ctionChanged); 895 this.dispatchEventToListeners(WebInspector.TimelineStackView.Events.Sele ctionChanged);
885 }, 896 },
886 897
887 __proto__: WebInspector.VBox.prototype 898 __proto__: WebInspector.VBox.prototype
888 } 899 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698