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

Unified Diff: Source/devtools/front_end/TimelineView.js

Issue 185403008: DevTools: allow selecting and showing details for coalesced record. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review comment addressed. Created 6 years, 10 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
« no previous file with comments | « Source/devtools/front_end/TimelinePanel.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/TimelineView.js
diff --git a/Source/devtools/front_end/TimelineView.js b/Source/devtools/front_end/TimelineView.js
index 78e188746eb6703331508a69132d5b2f29663dc3..f35382ad3495cb69aacb2aa5009fc0aa23992621 100644
--- a/Source/devtools/front_end/TimelineView.js
+++ b/Source/devtools/front_end/TimelineView.js
@@ -320,11 +320,25 @@ WebInspector.TimelineView.prototype = {
},
/**
- * @param {?WebInspector.TimelinePresentationModel.Record} record
+ * @param {?WebInspector.TimelinePresentationModel.Record} presentationRecord
*/
- _selectRecord: function(record)
- {
- this._delegate.selectRecord(record ? record.record() : null);
+ _selectRecord: function(presentationRecord)
+ {
+ if (presentationRecord && presentationRecord.coalesced()) {
+ // Presentation record does not have model record to highlight.
+ this._innerSetSelectedRecord(presentationRecord);
+ var aggregatedStats = {};
+ var presentationChildren = presentationRecord.presentationChildren();
+ for (var i = 0; i < presentationChildren.length; ++i)
+ WebInspector.TimelineUIUtils.aggregateTimeByCategory(aggregatedStats, presentationChildren[i].record().aggregatedStats);
+ var idle = presentationRecord.record().endTime - presentationRecord.record().startTime;
+ for (var category in aggregatedStats)
+ idle -= aggregatedStats[category];
+ aggregatedStats["idle"] = idle;
+ this._delegate.showAggregatedStatsInDetails(WebInspector.TimelineUIUtils.recordStyle(presentationRecord.record()).title, aggregatedStats);
+ return;
+ }
+ this._delegate.selectRecord(presentationRecord ? presentationRecord.record() : null);
},
/**
@@ -332,7 +346,14 @@ WebInspector.TimelineView.prototype = {
*/
setSelectedRecord: function(record)
{
- var presentationRecord = this._presentationModel.toPresentationRecord(record);
+ this._innerSetSelectedRecord(this._presentationModel.toPresentationRecord(record));
+ },
+
+ /**
+ * @param {?WebInspector.TimelinePresentationModel.Record} presentationRecord
+ */
+ _innerSetSelectedRecord: function(presentationRecord)
+ {
if (presentationRecord === this._lastSelectedRecord)
return;
« no previous file with comments | « Source/devtools/front_end/TimelinePanel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698