Commit 7c6861df authored by caseq's avatar caseq Committed by Commit bot

DevTools: fix front-end compilation problems after #399131

BUG=614935

Review-Url: https://codereview.chromium.org/2072173003
Cr-Commit-Position: refs/heads/master@{#400650}
parent c935fa23
...@@ -613,6 +613,17 @@ WebInspector.AggregatedTimelineTreeView.prototype = { ...@@ -613,6 +613,17 @@ WebInspector.AggregatedTimelineTreeView.prototype = {
return true; return true;
}, },
/**
* @return {!WebInspector.TimelineAggregator}
*/
_createAggregator: function()
{
return new WebInspector.TimelineAggregator(
event => WebInspector.TimelineUIUtils.eventStyle(event).title,
event => WebInspector.TimelineUIUtils.eventStyle(event).category.name
);
},
__proto__: WebInspector.TimelineTreeView.prototype, __proto__: WebInspector.TimelineTreeView.prototype,
}; };
...@@ -636,8 +647,7 @@ WebInspector.CallTreeTimelineTreeView.prototype = { ...@@ -636,8 +647,7 @@ WebInspector.CallTreeTimelineTreeView.prototype = {
_buildTree: function() _buildTree: function()
{ {
var topDown = this._buildTopDownTree(WebInspector.TimelineAggregator.eventId); var topDown = this._buildTopDownTree(WebInspector.TimelineAggregator.eventId);
var aggregator = new WebInspector.TimelineAggregator(event => WebInspector.TimelineUIUtils.eventStyle(event)); return this._createAggregator().performGrouping(topDown, this._groupBySetting.get());
return aggregator.performGrouping(topDown, this._groupBySetting.get());
}, },
__proto__: WebInspector.AggregatedTimelineTreeView.prototype, __proto__: WebInspector.AggregatedTimelineTreeView.prototype,
...@@ -663,8 +673,7 @@ WebInspector.BottomUpTimelineTreeView.prototype = { ...@@ -663,8 +673,7 @@ WebInspector.BottomUpTimelineTreeView.prototype = {
_buildTree: function() _buildTree: function()
{ {
var topDown = this._buildTopDownTree(WebInspector.TimelineAggregator.eventId); var topDown = this._buildTopDownTree(WebInspector.TimelineAggregator.eventId);
var aggregator = new WebInspector.TimelineAggregator(event => WebInspector.TimelineUIUtils.eventStyle(event)); return WebInspector.TimelineProfileTree.buildBottomUp(topDown, this._createAggregator().groupFunction(this._groupBySetting.get()));
return WebInspector.TimelineProfileTree.buildBottomUp(topDown, aggregator.groupFunction(this._groupBySetting.get()));
}, },
__proto__: WebInspector.AggregatedTimelineTreeView.prototype __proto__: WebInspector.AggregatedTimelineTreeView.prototype
......
...@@ -313,7 +313,7 @@ WebInspector.TimelineUIUtils.interactionPhaseLabel = function(phase) ...@@ -313,7 +313,7 @@ WebInspector.TimelineUIUtils.interactionPhaseLabel = function(phase)
*/ */
WebInspector.TimelineUIUtils.isUserFrame = function(frame) WebInspector.TimelineUIUtils.isUserFrame = function(frame)
{ {
return frame.scriptId !== "0" && frame.url && !frame.url.startsWith("native "); return frame.scriptId !== "0" && !(frame.url && frame.url.startsWith("native "));
} }
/** /**
......
...@@ -218,11 +218,13 @@ WebInspector.TimelineProfileTree.eventStackFrame = function(event) ...@@ -218,11 +218,13 @@ WebInspector.TimelineProfileTree.eventStackFrame = function(event)
/** /**
* @constructor * @constructor
* @param {function(!WebInspector.TracingModel.Event):{title: string, category: !WebInspector.TimelineCategory}} eventStyleMapper * @param {function(!WebInspector.TracingModel.Event):string} titleMapper
* @param {function(!WebInspector.TracingModel.Event):string} categoryMapper
*/ */
WebInspector.TimelineAggregator = function(eventStyleMapper) WebInspector.TimelineAggregator = function(titleMapper, categoryMapper)
{ {
this._eventStyleMapper = eventStyleMapper; this._titleMapper = titleMapper;
this._categoryMapper = categoryMapper;
/** @type {!Map<string, !WebInspector.TimelineProfileTree.Node>} */ /** @type {!Map<string, !WebInspector.TimelineProfileTree.Node>} */
this._groupNodes = new Map(); this._groupNodes = new Map();
} }
...@@ -337,8 +339,8 @@ WebInspector.TimelineAggregator.prototype = { ...@@ -337,8 +339,8 @@ WebInspector.TimelineAggregator.prototype = {
switch (groupBy) { switch (groupBy) {
case WebInspector.TimelineAggregator.GroupBy.None: return null; case WebInspector.TimelineAggregator.GroupBy.None: return null;
case WebInspector.TimelineAggregator.GroupBy.EventName: return node => node.event ? this._eventStyleMapper(node.event).title : ""; case WebInspector.TimelineAggregator.GroupBy.EventName: return node => node.event ? this._titleMapper(node.event) : "";
case WebInspector.TimelineAggregator.GroupBy.Category: return node => node.event ? this._eventStyleMapper(node.event).category.name : ""; case WebInspector.TimelineAggregator.GroupBy.Category: return node => node.event ? this._categoryMapper(node.event) : "";
case WebInspector.TimelineAggregator.GroupBy.Subdomain: return groupByDomain.bind(null, false); case WebInspector.TimelineAggregator.GroupBy.Subdomain: return groupByDomain.bind(null, false);
case WebInspector.TimelineAggregator.GroupBy.Domain: return groupByDomain.bind(null, true); case WebInspector.TimelineAggregator.GroupBy.Domain: return groupByDomain.bind(null, true);
case WebInspector.TimelineAggregator.GroupBy.URL: return groupByURL; case WebInspector.TimelineAggregator.GroupBy.URL: return groupByURL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment