Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js b/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js |
| index df56d748899a2be33b825c6110a4fb8679790baa..03b913534cb7a1c5bc4e979a9a85628667851d40 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js |
| @@ -41,6 +41,7 @@ WebInspector.UISourceCodeFrame = function(uiSourceCode) |
| this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._onWorkingCopyCommitted, this); |
| this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.MessageAdded, this._onMessageAdded, this); |
| this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.MessageRemoved, this._onMessageRemoved, this); |
| + this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.ProfileInfoUpdated, this._updateProfileInfo, this); |
| this._updateStyle(); |
| this._errorPopoverHelper = new WebInspector.PopoverHelper(this.element, this._getErrorAnchor.bind(this), this._showErrorPopover.bind(this)); |
| @@ -118,6 +119,7 @@ WebInspector.UISourceCodeFrame.prototype = { |
| WebInspector.SourceFrame.prototype.onTextEditorContentLoaded.call(this); |
| for (var message of this._uiSourceCode.messages()) |
| this._addMessageToSource(message); |
| + this._updateProfileInfo(); |
| }, |
| /** |
| @@ -330,6 +332,20 @@ WebInspector.UISourceCodeFrame.prototype = { |
| } |
| }, |
| + _updateProfileInfo: function() |
| + { |
| + this._textEditor.resetProfileInfo(); |
| + var profileInfo = this._uiSourceCode.profileInfo(); |
| + if (!profileInfo) |
| + return; |
| + for (var lineInfo of profileInfo) { |
| + var lineNumber = lineInfo[0] - 1; |
| + var time = lineInfo[1]; |
| + var intensity = Number.constrain(Math.log10(1 + 2 * time) / 5, 0.02, 1); |
|
lushnikov
2016/03/02 03:19:13
A thought: maybe consider intensity relative to th
alph
2016/03/02 18:34:34
I'll consider it for the next patch. Not sure thou
|
| + this._textEditor.addProfileInfo(lineNumber, WebInspector.UIString("%.1f\xa0ms", time), intensity); |
| + } |
| + }, |
| + |
| __proto__: WebInspector.SourceFrame.prototype |
| } |