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

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

Issue 2010943002: DevTools: Add grouping by Activity to Timeline treeview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layout test got resultz Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js
index cd96356b88d07c6723f379e23f018f8164f8618a..5a9a559350327578c64b3aa30b909c0195a65f5c 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js
@@ -489,6 +489,8 @@ WebInspector.AggregatedTimelineTreeView.prototype = {
_displayInfoForGroupNode: function(node)
{
var categories = WebInspector.TimelineUIUtils.categories();
+ var color = node.id ? WebInspector.TimelineUIUtils.eventColor(node.event) : categories["other"].color;
+
switch (this._groupBySetting.get()) {
case WebInspector.TimelineAggregator.GroupBy.Category:
var category = categories[node.id] || categories["other"];
@@ -503,8 +505,17 @@ WebInspector.AggregatedTimelineTreeView.prototype = {
name = this._executionContextNamesByOrigin.get(name) || name;
return {
name: name || WebInspector.UIString("unattributed"),
- color: node.id ? WebInspector.TimelineUIUtils.eventColor(node.event) : categories["other"].color
- }
+ color: color
+ };
+
+ case WebInspector.TimelineAggregator.GroupBy.EventName:
+ var name = node.event.name === WebInspector.TimelineModel.RecordType.JSFrame ?
+ WebInspector.UIString("JavaScript") : WebInspector.TimelineUIUtils.eventTitle(node.event);
+ return {
+ name: name,
+ color: node.event.name === WebInspector.TimelineModel.RecordType.JSFrame ?
+ WebInspector.TimelineUIUtils.eventStyle(node.event).category.color : color
+ };
case WebInspector.TimelineAggregator.GroupBy.URL:
break;
@@ -514,8 +525,8 @@ WebInspector.AggregatedTimelineTreeView.prototype = {
}
return {
name: node.id || WebInspector.UIString("unattributed"),
- color: node.id ? WebInspector.TimelineUIUtils.eventColor(node.event) : categories["other"].color
- }
+ color: color
+ };
},
/**
@@ -539,6 +550,7 @@ WebInspector.AggregatedTimelineTreeView.prototype = {
this._groupByCombobox.select(option);
}
addGroupingOption.call(this, WebInspector.UIString("No Grouping"), WebInspector.TimelineAggregator.GroupBy.None);
+ addGroupingOption.call(this, WebInspector.UIString("Group by Activity"), WebInspector.TimelineAggregator.GroupBy.EventName);
addGroupingOption.call(this, WebInspector.UIString("Group by Category"), WebInspector.TimelineAggregator.GroupBy.Category);
addGroupingOption.call(this, WebInspector.UIString("Group by Domain"), WebInspector.TimelineAggregator.GroupBy.Domain);
addGroupingOption.call(this, WebInspector.UIString("Group by Subdomain"), WebInspector.TimelineAggregator.GroupBy.Subdomain);
@@ -624,7 +636,7 @@ WebInspector.CallTreeTimelineTreeView.prototype = {
_buildTree: function()
{
var topDown = this._buildTopDownTree(WebInspector.TimelineAggregator.eventId);
- var aggregator = new WebInspector.TimelineAggregator(event => WebInspector.TimelineUIUtils.eventStyle(event).category.name);
+ var aggregator = new WebInspector.TimelineAggregator(event => WebInspector.TimelineUIUtils.eventStyle(event));
return aggregator.performGrouping(topDown, this._groupBySetting.get());
},
@@ -651,7 +663,7 @@ WebInspector.BottomUpTimelineTreeView.prototype = {
_buildTree: function()
{
var topDown = this._buildTopDownTree(WebInspector.TimelineAggregator.eventId);
- var aggregator = new WebInspector.TimelineAggregator(event => WebInspector.TimelineUIUtils.eventStyle(event).category.name);
+ var aggregator = new WebInspector.TimelineAggregator(event => WebInspector.TimelineUIUtils.eventStyle(event));
return WebInspector.TimelineProfileTree.buildBottomUp(topDown, aggregator.groupFunction(this._groupBySetting.get()));
},

Powered by Google App Engine
This is Rietveld 408576698