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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js

Issue 2411533002: [Devtools] Added data to networking timeline canvas experiment (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.VBox} 7 * @extends {WebInspector.VBox}
8 * @param {!WebInspector.NetworkLogView} networkLogView 8 * @param {!WebInspector.NetworkLogView} networkLogView
9 * @param {!WebInspector.SortableDataGrid} dataGrid 9 * @param {!WebInspector.SortableDataGrid} dataGrid
10 */ 10 */
11 WebInspector.NetworkTimelineColumn = function(networkLogView, dataGrid) 11 WebInspector.NetworkTimelineColumn = function(networkLogView, dataGrid)
12 { 12 {
13 WebInspector.VBox.call(this, true); 13 WebInspector.VBox.call(this, true);
14 this._canvas = this.contentElement.createChild("canvas"); 14 this._canvas = this.contentElement.createChild("canvas");
15 this._canvas.tabIndex = 1; 15 this._canvas.tabIndex = 1;
16 this.setDefaultFocusedElement(this._canvas); 16 this.setDefaultFocusedElement(this._canvas);
17 17
18 /** @const */ 18 /** @const */
19 this._leftPadding = 5; 19 this._leftPadding = 5;
20 /** @const */ 20 /** @const */
21 this._rightPadding = 5; 21 this._rightPadding = 5;
22 22
23 this._dataGrid = dataGrid; 23 this._dataGrid = dataGrid;
24 this._networkLogView = networkLogView; 24 this._networkLogView = networkLogView;
25
26 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Req uestsSorted, this._onRefreshData, this);
27 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Dat aRefreshed, this._onRefreshData, this);
28
25 /** @type {!Array<!WebInspector.NetworkRequest>} */ 29 /** @type {!Array<!WebInspector.NetworkRequest>} */
26 this._requestData = []; 30 this._requestData = [];
31 this._onRefreshData();
27 } 32 }
28 33
29 WebInspector.NetworkTimelineColumn.prototype = { 34 WebInspector.NetworkTimelineColumn.prototype = {
35 _onRefreshData: function()
36 {
37 var currentNode = this._dataGrid.rootNode();
38 this._requestData = [];
39 while (currentNode = currentNode.traverseNextNode(true))
40 this._requestData.push(currentNode.request());
41
42 this.scheduleUpdate();
43 },
44
30 scheduleUpdate: function() 45 scheduleUpdate: function()
31 { 46 {
32 if (this._updateRequestID) 47 if (this._updateRequestID)
33 return; 48 return;
34 this._updateRequestID = this.element.window().requestAnimationFrame(this ._update.bind(this)); 49 this._updateRequestID = this.element.window().requestAnimationFrame(this ._update.bind(this));
35 }, 50 },
36 51
37 _update: function() 52 _update: function()
38 { 53 {
39 this.element.window().cancelAnimationFrame(this._updateRequestID); 54 this.element.window().cancelAnimationFrame(this._updateRequestID);
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 context.lineWidth = lineWidth; 218 context.lineWidth = lineWidth;
204 context.strokeStyle = borderColor; 219 context.strokeStyle = borderColor;
205 context.stroke(); 220 context.stroke();
206 } 221 }
207 context.fill(); 222 context.fill();
208 context.restore(); 223 context.restore();
209 }, 224 },
210 225
211 __proto__: WebInspector.VBox.prototype 226 __proto__: WebInspector.VBox.prototype
212 } 227 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698