Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js |
| index fc6b986635f0fa62aa5e5ab4ddf5c81ae8ddd7fc..1e06de32020290397cd6e8194a5d625c66e882c4 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js |
| @@ -224,6 +224,23 @@ WebInspector.TimelineUIUtils = class { |
| } |
| /** |
| + * @param {!Protocol.Runtime.CallFrame} frame |
| + * @return {string} |
| + */ |
| + static frameDisplayName(frame) { |
| + if (WebInspector.TimelineJSProfileProcessor.isNativeRuntimeFrame(frame)) { |
|
caseq
2016/11/11 23:30:38
if (!..)
return
|
| + const nativeGroup = WebInspector.TimelineJSProfileProcessor.nativeGroup(frame.functionName); |
| + const groups = WebInspector.TimelineJSProfileProcessor.NativeGroups; |
| + switch (nativeGroup) { |
| + case groups.Compile: return WebInspector.UIString('Compile'); |
| + case groups.Parse: return WebInspector.UIString('Parse'); |
| + } |
| + return frame.functionName; |
| + } |
| + return WebInspector.beautifyFunctionName(frame.functionName); |
| + } |
| + |
| + /** |
| * @param {!WebInspector.TracingModel.Event} traceEvent |
| * @param {!RegExp} regExp |
| * @return {boolean} |
| @@ -438,7 +455,7 @@ WebInspector.TimelineUIUtils = class { |
| detailsText = linkifyLocationAsText(eventData['scriptId'], eventData['lineNumber'], 0); |
| break; |
| case recordType.JSFrame: |
| - detailsText = WebInspector.beautifyFunctionName(eventData['functionName']); |
| + detailsText = WebInspector.TimelineUIUtils.frameDisplayName(eventData); |
| break; |
| case recordType.EventDispatch: |
| detailsText = eventData ? eventData['type'] : null; |
| @@ -600,8 +617,8 @@ WebInspector.TimelineUIUtils = class { |
| case recordType.FunctionCall: |
| case recordType.JSFrame: |
| details = createElement('span'); |
| - details.createTextChild(WebInspector.beautifyFunctionName(eventData['functionName'])); |
| - var location = linkifyLocation( |
| + details.createTextChild(WebInspector.TimelineUIUtils.frameDisplayName(eventData)); |
| + const location = linkifyLocation( |
| eventData['scriptId'], eventData['url'], eventData['lineNumber'], eventData['columnNumber']); |
| if (location) { |
| details.createTextChild(' @ '); |
| @@ -1815,7 +1832,7 @@ WebInspector.TimelineUIUtils.InvalidationsGroupElement = class extends TreeEleme |
| if (topFrame && this._contentHelper.linkifier()) { |
| title.createTextChild(WebInspector.UIString('. ')); |
| var stack = title.createChild('span', 'monospace'); |
| - stack.createChild('span').textContent = WebInspector.beautifyFunctionName(topFrame.functionName); |
| + stack.createChild('span').textContent = WebInspector.TimelineUIUtils.frameDisplayName(topFrame); |
| var link = this._contentHelper.linkifier().maybeLinkifyConsoleCallFrame(target, topFrame); |
| if (link) { |
| stack.createChild('span').textContent = ' @ '; |