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

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

Issue 213673005: Timeline: show selected event details in Tracing mode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « no previous file | Source/devtools/front_end/TracingModel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/TimelineTracingView.js
diff --git a/Source/devtools/front_end/TimelineTracingView.js b/Source/devtools/front_end/TimelineTracingView.js
index 1656ccbd4285d4930c8933c0428b5adfefb0052b..9a89555894242fc4016400f7b5151b4e32c37e2a 100644
--- a/Source/devtools/front_end/TimelineTracingView.js
+++ b/Source/devtools/front_end/TimelineTracingView.js
@@ -18,7 +18,6 @@ WebInspector.TimelineTracingView = function(delegate)
this._tracingModel = new WebInspector.TracingModel();
this.element.classList.add("timeline-flamechart");
this.registerRequiredCSS("flameChart.css");
- this._delegate = delegate;
this._dataProvider = new WebInspector.TraceViewFlameChartDataProvider(this._tracingModel);
this._mainView = new WebInspector.FlameChart(this._dataProvider, this, true, true);
this._mainView.show(this.element);
@@ -129,6 +128,27 @@ WebInspector.TimelineTracingView.prototype = {
*/
_onEntrySelected: function(event)
{
+ var index = /** @type {number} */ (event.data);
+ var record = this._dataProvider._recordAt(index);
+ if (!record || this._dataProvider._isHeaderRecord(record)) {
+ this._delegate.showInDetails("", document.createTextNode(""));
+ return;
+ }
+ var contentHelper = new WebInspector.TimelineDetailsContentHelper(new WebInspector.Linkifier(), false);
+ contentHelper.appendTextRow(WebInspector.UIString("Name"), record.name);
+ contentHelper.appendTextRow(WebInspector.UIString("Category"), record.category);
+ contentHelper.appendTextRow(WebInspector.UIString("Start"), Number.millisToString(this._dataProvider._toTimelineTime(record.startTime - this._tracingModel.minimumRecordTime()), true));
+ contentHelper.appendTextRow(WebInspector.UIString("Duration"), Number.millisToString(this._dataProvider._toTimelineTime(record.duration), true));
+ if (!Object.isEmpty(record.args)) {
+ var table = document.createElement("table");
pfeldman 2014/04/01 14:17:01 Is there a screenshot?
+ for (var name in record.args) {
+ var row = table.createChild("tr");
+ row.createChild("td", "timeline-details-row-title").textContent = name + ":";
+ row.createChild("td", "timeline-details-row-data").textContent = record.args[name];
+ }
+ contentHelper.appendElementRow(WebInspector.UIString("Arguments"), table);
+ }
+ this._delegate.showInDetails(WebInspector.UIString("Selected Event"), contentHelper.element);
},
__proto__: WebInspector.VBox.prototype
@@ -202,7 +222,7 @@ WebInspector.TraceViewFlameChartDataProvider.prototype = {
entryTitle: function(entryIndex)
{
var record = this._records[entryIndex];
- if (record === this._threadHeaderRecord || record === this._processHeaderRecord)
+ if (this._isHeaderRecord(record))
return this._headerTitles[entryIndex]
return record.name;
},
@@ -351,7 +371,13 @@ WebInspector.TraceViewFlameChartDataProvider.prototype = {
*/
highlightTimeRange: function(entryIndex)
{
- return null;
+ var record = this._records[entryIndex];
+ if (!record || this._isHeaderRecord(record))
+ return null;
+ return {
+ startTimeOffset: this._toTimelineTime(record.startTime - this._zeroTime),
+ endTimeOffset: this._toTimelineTime(record.endTime - this._zeroTime)
+ }
},
/**
@@ -404,6 +430,23 @@ WebInspector.TraceViewFlameChartDataProvider.prototype = {
_toTimelineTime: function(time)
{
return time / 1000;
+ },
+
+ /**
+ * @param {!WebInspector.TracingModel.Event} record
+ */
+ _isHeaderRecord: function(record)
+ {
+ return record === this._threadHeaderRecord || record === this._processHeaderRecord;
+ },
+
+ /**
+ * @param {number} index
+ * @return {!WebInspector.TracingModel.Event|undefined}
+ */
+ _recordAt: function(index)
+ {
+ return this._records[index];
}
}
« no previous file with comments | « no previous file | Source/devtools/front_end/TracingModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698