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

Unified Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js

Issue 2439453003: [Devtools] Removed dependency of networkLogView and dataGrid (Closed)
Patch Set: changes Created 4 years, 2 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 | third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
index dd36b68cf14f4723147c7b634744bc9c69077c41..1b5778e1c9a6e696a91c91c631a6d2120037f15c 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
@@ -83,6 +83,7 @@ WebInspector.NetworkLogView = function(filterBar, progressBarContainer, networkL
this._headerHeight = 0;
this._timelineHeaderElement = null;
+ this._timelineRequestsAreStale = false;
this._addFilters();
this._resetSuggestionBuilder();
@@ -293,7 +294,15 @@ WebInspector.NetworkLogView.prototype = {
this._timelineWidget.element.classList.add("network-timeline-view");
this._splitWidget.setMainWidget(this._timelineWidget);
- this._timelineColumn = new WebInspector.NetworkTimelineColumn(this, this._dataGrid);
+ this._timelineColumn = new WebInspector.NetworkTimelineColumn(this._rowHeight, this._headerHeight, this._calculator, this._dataGrid.scrollContainer);
+
+ var dataGridScroller = this._dataGrid.scrollContainer;
+ this._dataGrid.setScrollContainer(this._timelineColumn.getScrollContainer());
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Events.PaddingChanged, () => {
+ this._timelineColumn.setScrollHeight(dataGridScroller.scrollHeight)
+ });
+ this._dataGrid.addEventListener(WebInspector.ViewportDataGrid.Events.ViewportCalculated, this._redrawTimelineColumn.bind(this));
+
this._timelineColumn.addEventListener(WebInspector.NetworkTimelineColumn.Events.RequestHovered, requestHovered.bind(this));
this._timelineColumn.show(this._timelineWidget.element);
this.switchViewMode(false);
@@ -318,6 +327,15 @@ WebInspector.NetworkLogView.prototype = {
}
},
+ _redrawTimelineColumn: function()
+ {
+ /** @type {!Array<!WebInspector.NetworkRequest>|undefined} */
+ var requests;
+ if (this._timelineRequestsAreStale)
+ requests = this._getOrderedRequests();
+ this._timelineColumn.update(requests);
+ },
+
_showRecordingHint: function()
{
this._hideRecordingHint();
@@ -586,7 +604,11 @@ WebInspector.NetworkLogView.prototype = {
if (!x || this._calculator === x)
return;
- this._calculator = x;
+ if (this._calculator !== x) {
+ this._calculator = x;
+ if (Runtime.experiments.isEnabled("canvasNetworkTimeline"))
+ this._timelineColumn.setCalculator(this._calculator);
+ }
this._calculator.reset();
if (this._calculator.startAtZero)
@@ -704,8 +726,18 @@ WebInspector.NetworkLogView.prototype = {
this._staleRequestIds = {};
this._updateSummaryBar();
+
if (Runtime.experiments.isEnabled("canvasNetworkTimeline"))
- this._timelineColumn.scheduleRefreshData();
+ this._timelineRequestsAreStale = true;
+ },
+
+ _getOrderedRequests: function()
+ {
+ var currentNode = this._dataGrid.rootNode();
+ var requestData = [];
+ while (currentNode = currentNode.traverseNextNode(true))
+ requestData.push(currentNode.request());
+ return requestData;
},
reset: function()
@@ -924,8 +956,19 @@ WebInspector.NetworkLogView.prototype = {
{
var largeRows = !!this._networkLogLargeRowsSetting.get();
// TODO(allada) Make these non-magic numbers.
- this._rowHeight = largeRows ? 41 : 21;
- this._headerHeight = largeRows ? 31 : 27;
+ var rowHeight = largeRows ? 41 : 21;
+ var headerHeight = largeRows ? 31 : 27;
+ if (this._rowHeight !== rowHeight) {
+ this._rowHeight = rowHeight;
+ if (Runtime.experiments.isEnabled("canvasNetworkTimeline"))
+ this._timelineColumn.setRowHeight(this._rowHeight);
+ }
+ if (this._headerHeight !== headerHeight) {
+ this._headerHeight = headerHeight;
+ if (Runtime.experiments.isEnabled("canvasNetworkTimeline"))
+ this._timelineColumn.setHeaderHeight(this._headerHeight);
+ }
+
this._dataGrid.element.classList.toggle("small", !largeRows);
if (Runtime.experiments.isEnabled("canvasNetworkTimeline"))
this._timelineHeaderElement.classList.toggle("small", !largeRows);
@@ -1169,7 +1212,7 @@ WebInspector.NetworkLogView.prototype = {
this._timelineColumnSortIcon.classList.add("sort-descending");
}
- this._timelineColumn.scheduleRefreshData();
+ this._timelineRequestsAreStale = true;
},
/**
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698