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

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

Issue 2439453003: [Devtools] Removed dependency of networkLogView and dataGrid (Closed)
Patch Set: [Devtools] Removed dependency of networkLogView and dataGrid 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
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 bf7a209cc09c5da8088e34f5977df07767774868..3d123fd51e625a7a110a22f978ade8743058818a 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
@@ -293,7 +293,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._timelineColumn.update.bind(this._timelineColumn));
+
this._timelineColumn.addEventListener(WebInspector.NetworkTimelineColumn.Events.RequestHovered, requestHovered.bind(this));
this._timelineColumn.show(this._timelineWidget.element);
this.switchViewMode(false);
@@ -586,7 +594,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)
@@ -702,8 +714,18 @@ WebInspector.NetworkLogView.prototype = {
this._staleRequestIds = {};
this._updateSummaryBar();
+
if (Runtime.experiments.isEnabled("canvasNetworkTimeline"))
- this._timelineColumn.scheduleRefreshData();
+ this._timelineColumn.setRequests(this._getOrderedRequests());
+ },
+
+ _getOrderedRequests: function()
+ {
+ var currentNode = this._dataGrid.rootNode();
+ var requestData = [];
+ while (currentNode = currentNode.traverseNextNode(true))
+ requestData.push(currentNode.request());
+ return requestData;
},
reset: function()
@@ -920,8 +942,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);
@@ -1165,7 +1198,7 @@ WebInspector.NetworkLogView.prototype = {
this._timelineColumnSortIcon.classList.add("sort-descending");
}
- this._timelineColumn.scheduleRefreshData();
+ this._timelineColumn.setRequests(this._getOrderedRequests());
},
/**

Powered by Google App Engine
This is Rietveld 408576698