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

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

Issue 2493373002: DevTools: rename WebInspector into modules. (Closed)
Patch Set: for bots Created 4 years, 1 month 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 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 WebInspector.NetworkLogViewColumns = class { 7 Network.NetworkLogViewColumns = class {
8 /** 8 /**
9 * @param {!WebInspector.NetworkLogView} networkLogView 9 * @param {!Network.NetworkLogView} networkLogView
10 * @param {!WebInspector.NetworkTransferTimeCalculator} timeCalculator 10 * @param {!Network.NetworkTransferTimeCalculator} timeCalculator
11 * @param {!WebInspector.NetworkTransferDurationCalculator} durationCalculator 11 * @param {!Network.NetworkTransferDurationCalculator} durationCalculator
12 * @param {!WebInspector.Setting} networkLogLargeRowsSetting 12 * @param {!Common.Setting} networkLogLargeRowsSetting
13 */ 13 */
14 constructor(networkLogView, timeCalculator, durationCalculator, networkLogLarg eRowsSetting) { 14 constructor(networkLogView, timeCalculator, durationCalculator, networkLogLarg eRowsSetting) {
15 this._networkLogView = networkLogView; 15 this._networkLogView = networkLogView;
16 16
17 /** @type {!WebInspector.Setting} */ 17 /** @type {!Common.Setting} */
18 this._persistantSettings = WebInspector.settings.createSetting('networkLogCo lumns', {}); 18 this._persistantSettings = Common.settings.createSetting('networkLogColumns' , {});
19 19
20 this._networkLogLargeRowsSetting = networkLogLargeRowsSetting; 20 this._networkLogLargeRowsSetting = networkLogLargeRowsSetting;
21 this._networkLogLargeRowsSetting.addChangeListener(this._updateRowsSize, thi s); 21 this._networkLogLargeRowsSetting.addChangeListener(this._updateRowsSize, thi s);
22 22
23 /** @type {!Map<string, !Array<number>>} */ 23 /** @type {!Map<string, !Array<number>>} */
24 this._eventDividers = new Map(); 24 this._eventDividers = new Map();
25 this._eventDividersShown = false; 25 this._eventDividersShown = false;
26 26
27 this._gridMode = true; 27 this._gridMode = true;
28 28
29 /** @type {!Array.<!WebInspector.NetworkLogViewColumns.Descriptor>} */ 29 /** @type {!Array.<!Network.NetworkLogViewColumns.Descriptor>} */
30 this._columns = []; 30 this._columns = [];
31 31
32 this._waterfallRequestsAreStale = false; 32 this._waterfallRequestsAreStale = false;
33 this._waterfallScrollerWidthIsStale = true; 33 this._waterfallScrollerWidthIsStale = true;
34 34
35 /** @type {!WebInspector.Linkifier} */ 35 /** @type {!Components.Linkifier} */
36 this._popupLinkifier = new WebInspector.Linkifier(); 36 this._popupLinkifier = new Components.Linkifier();
37 37
38 /** @type {!Map<string, !WebInspector.NetworkTimeCalculator>} */ 38 /** @type {!Map<string, !Network.NetworkTimeCalculator>} */
39 this._calculatorsMap = new Map(); 39 this._calculatorsMap = new Map();
40 this._calculatorsMap.set(WebInspector.NetworkLogViewColumns._calculatorTypes .Time, timeCalculator); 40 this._calculatorsMap.set(Network.NetworkLogViewColumns._calculatorTypes.Time , timeCalculator);
41 this._calculatorsMap.set(WebInspector.NetworkLogViewColumns._calculatorTypes .Duration, durationCalculator); 41 this._calculatorsMap.set(Network.NetworkLogViewColumns._calculatorTypes.Dura tion, durationCalculator);
42 42
43 this._setupDataGrid(); 43 this._setupDataGrid();
44 this._setupWaterfall(); 44 this._setupWaterfall();
45 } 45 }
46 46
47 /** 47 /**
48 * @param {!WebInspector.NetworkLogViewColumns.Descriptor} columnConfig 48 * @param {!Network.NetworkLogViewColumns.Descriptor} columnConfig
49 * @return {!WebInspector.DataGrid.ColumnDescriptor} 49 * @return {!UI.DataGrid.ColumnDescriptor}
50 */ 50 */
51 static _convertToDataGridDescriptor(columnConfig) { 51 static _convertToDataGridDescriptor(columnConfig) {
52 return /** @type {!WebInspector.DataGrid.ColumnDescriptor} */ ({ 52 return /** @type {!UI.DataGrid.ColumnDescriptor} */ ({
53 id: columnConfig.id, 53 id: columnConfig.id,
54 title: columnConfig.title, 54 title: columnConfig.title,
55 sortable: columnConfig.sortable, 55 sortable: columnConfig.sortable,
56 align: columnConfig.align, 56 align: columnConfig.align,
57 nonSelectable: columnConfig.nonSelectable, 57 nonSelectable: columnConfig.nonSelectable,
58 weight: columnConfig.weight 58 weight: columnConfig.weight
59 }); 59 });
60 } 60 }
61 61
62 wasShown() { 62 wasShown() {
63 this._updateRowsSize(); 63 this._updateRowsSize();
64 } 64 }
65 65
66 willHide() { 66 willHide() {
67 this._popoverHelper.hidePopover(); 67 this._popoverHelper.hidePopover();
68 } 68 }
69 69
70 reset() { 70 reset() {
71 if (this._popoverHelper) 71 if (this._popoverHelper)
72 this._popoverHelper.hidePopover(); 72 this._popoverHelper.hidePopover();
73 this._eventDividers.clear(); 73 this._eventDividers.clear();
74 } 74 }
75 75
76 _setupDataGrid() { 76 _setupDataGrid() {
77 var defaultColumns = WebInspector.NetworkLogViewColumns._defaultColumns; 77 var defaultColumns = Network.NetworkLogViewColumns._defaultColumns;
78 var defaultColumnConfig = WebInspector.NetworkLogViewColumns._defaultColumnC onfig; 78 var defaultColumnConfig = Network.NetworkLogViewColumns._defaultColumnConfig ;
79 79
80 this._columns = /** @type {!Array<!WebInspector.NetworkLogViewColumns.Descri ptor>} */ ([]); 80 this._columns = /** @type {!Array<!Network.NetworkLogViewColumns.Descriptor> } */ ([]);
81 for (var currentConfigColumn of defaultColumns) { 81 for (var currentConfigColumn of defaultColumns) {
82 var columnConfig = /** @type {!WebInspector.NetworkLogViewColumns.Descript or} */ ( 82 var columnConfig = /** @type {!Network.NetworkLogViewColumns.Descriptor} * / (
83 Object.assign(/** @type {!Object} */ ({}), defaultColumnConfig, curren tConfigColumn)); 83 Object.assign(/** @type {!Object} */ ({}), defaultColumnConfig, curren tConfigColumn));
84 columnConfig.id = columnConfig.id; 84 columnConfig.id = columnConfig.id;
85 if (columnConfig.subtitle) 85 if (columnConfig.subtitle)
86 columnConfig.titleDOMFragment = this._makeHeaderFragment(columnConfig.ti tle, columnConfig.subtitle); 86 columnConfig.titleDOMFragment = this._makeHeaderFragment(columnConfig.ti tle, columnConfig.subtitle);
87 this._columns.push(columnConfig); 87 this._columns.push(columnConfig);
88 } 88 }
89 this._loadColumns(); 89 this._loadColumns();
90 90
91 this._popoverHelper = new WebInspector.PopoverHelper(this._networkLogView.el ement); 91 this._popoverHelper = new UI.PopoverHelper(this._networkLogView.element);
92 this._popoverHelper.initializeCallbacks( 92 this._popoverHelper.initializeCallbacks(
93 this._getPopoverAnchor.bind(this), this._showPopover.bind(this), this._o nHidePopover.bind(this)); 93 this._getPopoverAnchor.bind(this), this._showPopover.bind(this), this._o nHidePopover.bind(this));
94 94
95 this._dataGrid = new WebInspector.SortableDataGrid( 95 this._dataGrid = new UI.SortableDataGrid(
96 this._columns.map(WebInspector.NetworkLogViewColumns._convertToDataGridD escriptor)); 96 this._columns.map(Network.NetworkLogViewColumns._convertToDataGridDescri ptor));
97 this._dataGrid.element.addEventListener('mousedown', event => { 97 this._dataGrid.element.addEventListener('mousedown', event => {
98 if ((!this._dataGrid.selectedNode && event.button) || event.target.enclosi ngNodeOrSelfWithNodeName('a')) 98 if ((!this._dataGrid.selectedNode && event.button) || event.target.enclosi ngNodeOrSelfWithNodeName('a'))
99 event.consume(); 99 event.consume();
100 }, true); 100 }, true);
101 101
102 this._dataGridScroller = this._dataGrid.scrollContainer; 102 this._dataGridScroller = this._dataGrid.scrollContainer;
103 103
104 this._updateColumns(); 104 this._updateColumns();
105 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._sortHandler, this); 105 this._dataGrid.addEventListener(UI.DataGrid.Events.SortingChanged, this._sor tHandler, this);
106 this._dataGrid.setHeaderContextMenuCallback(this._innerHeaderContextMenu.bin d(this)); 106 this._dataGrid.setHeaderContextMenuCallback(this._innerHeaderContextMenu.bin d(this));
107 107
108 this._activeWaterfallSortId = WebInspector.NetworkLogViewColumns.WaterfallSo rtIds.StartTime; 108 this._activeWaterfallSortId = Network.NetworkLogViewColumns.WaterfallSortIds .StartTime;
109 this._dataGrid.markColumnAsSortedBy( 109 this._dataGrid.markColumnAsSortedBy(
110 WebInspector.NetworkLogViewColumns._initialSortColumn, WebInspector.Data Grid.Order.Ascending); 110 Network.NetworkLogViewColumns._initialSortColumn, UI.DataGrid.Order.Asce nding);
111 111
112 this._splitWidget = new WebInspector.SplitWidget(true, true, 'networkPanelSp litViewWaterfall', 200); 112 this._splitWidget = new UI.SplitWidget(true, true, 'networkPanelSplitViewWat erfall', 200);
113 var widget = this._dataGrid.asWidget(); 113 var widget = this._dataGrid.asWidget();
114 widget.setMinimumSize(150, 0); 114 widget.setMinimumSize(150, 0);
115 this._splitWidget.setMainWidget(widget); 115 this._splitWidget.setMainWidget(widget);
116 } 116 }
117 117
118 _setupWaterfall() { 118 _setupWaterfall() {
119 this._waterfallColumn = 119 this._waterfallColumn =
120 new WebInspector.NetworkWaterfallColumn(this._networkLogView.rowHeight() , this._networkLogView.calculator()); 120 new Network.NetworkWaterfallColumn(this._networkLogView.rowHeight(), thi s._networkLogView.calculator());
121 121
122 this._waterfallColumn.element.addEventListener('contextmenu', handleContextM enu.bind(this)); 122 this._waterfallColumn.element.addEventListener('contextmenu', handleContextM enu.bind(this));
123 this._waterfallColumn.element.addEventListener('mousewheel', this._onMouseWh eel.bind(this, false), {passive: true}); 123 this._waterfallColumn.element.addEventListener('mousewheel', this._onMouseWh eel.bind(this, false), {passive: true});
124 this._dataGridScroller.addEventListener('mousewheel', this._onMouseWheel.bin d(this, true), true); 124 this._dataGridScroller.addEventListener('mousewheel', this._onMouseWheel.bin d(this, true), true);
125 125
126 this._waterfallColumn.element.addEventListener( 126 this._waterfallColumn.element.addEventListener(
127 'mousemove', 127 'mousemove',
128 event => this._networkLogView.setHoveredRequest( 128 event => this._networkLogView.setHoveredRequest(
129 this._waterfallColumn.getRequestFromPoint(event.offsetX, event.offse tY + event.target.offsetTop), 129 this._waterfallColumn.getRequestFromPoint(event.offsetX, event.offse tY + event.target.offsetTop),
130 event.shiftKey), 130 event.shiftKey),
131 true); 131 true);
132 this._waterfallColumn.element.addEventListener( 132 this._waterfallColumn.element.addEventListener(
133 'mouseleave', this._networkLogView.setHoveredRequest.bind(this._networkL ogView, null, false), true); 133 'mouseleave', this._networkLogView.setHoveredRequest.bind(this._networkL ogView, null, false), true);
134 134
135 this._waterfallScroller = this._waterfallColumn.contentElement.createChild(' div', 'network-waterfall-v-scroll'); 135 this._waterfallScroller = this._waterfallColumn.contentElement.createChild(' div', 'network-waterfall-v-scroll');
136 this._waterfallScroller.addEventListener('scroll', this._syncScrollers.bind( this), {passive: true}); 136 this._waterfallScroller.addEventListener('scroll', this._syncScrollers.bind( this), {passive: true});
137 this._waterfallScrollerContent = this._waterfallScroller.createChild('div', 'network-waterfall-v-scroll-content'); 137 this._waterfallScrollerContent = this._waterfallScroller.createChild('div', 'network-waterfall-v-scroll-content');
138 138
139 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.PaddingChanged, () => { 139 this._dataGrid.addEventListener(UI.DataGrid.Events.PaddingChanged, () => {
140 this._waterfallScrollerWidthIsStale = true; 140 this._waterfallScrollerWidthIsStale = true;
141 this._syncScrollers(); 141 this._syncScrollers();
142 }); 142 });
143 this._dataGrid.addEventListener( 143 this._dataGrid.addEventListener(
144 WebInspector.ViewportDataGrid.Events.ViewportCalculated, this._redrawWat erfallColumn.bind(this)); 144 UI.ViewportDataGrid.Events.ViewportCalculated, this._redrawWaterfallColu mn.bind(this));
145 145
146 this._createWaterfallHeader(); 146 this._createWaterfallHeader();
147 this._waterfallColumn.contentElement.classList.add('network-waterfall-view') ; 147 this._waterfallColumn.contentElement.classList.add('network-waterfall-view') ;
148 148
149 this._waterfallColumn.setMinimumSize(100, 0); 149 this._waterfallColumn.setMinimumSize(100, 0);
150 this._splitWidget.setSidebarWidget(this._waterfallColumn); 150 this._splitWidget.setSidebarWidget(this._waterfallColumn);
151 151
152 this.switchViewMode(false); 152 this.switchViewMode(false);
153 153
154 /** 154 /**
155 * @param {!Event} event 155 * @param {!Event} event
156 * @this {WebInspector.NetworkLogViewColumns} 156 * @this {Network.NetworkLogViewColumns}
157 */ 157 */
158 function handleContextMenu(event) { 158 function handleContextMenu(event) {
159 var request = this._waterfallColumn.getRequestFromPoint(event.offsetX, eve nt.offsetY); 159 var request = this._waterfallColumn.getRequestFromPoint(event.offsetX, eve nt.offsetY);
160 if (!request) 160 if (!request)
161 return; 161 return;
162 var contextMenu = new WebInspector.ContextMenu(event); 162 var contextMenu = new UI.ContextMenu(event);
163 this._networkLogView.handleContextMenuForRequest(contextMenu, request); 163 this._networkLogView.handleContextMenuForRequest(contextMenu, request);
164 contextMenu.show(); 164 contextMenu.show();
165 } 165 }
166 } 166 }
167 167
168 /** 168 /**
169 * @param {boolean} shouldConsume 169 * @param {boolean} shouldConsume
170 * @param {!Event} event 170 * @param {!Event} event
171 */ 171 */
172 _onMouseWheel(shouldConsume, event) { 172 _onMouseWheel(shouldConsume, event) {
(...skipping 22 matching lines...) Expand all
195 } 195 }
196 196
197 _redrawWaterfallColumn() { 197 _redrawWaterfallColumn() {
198 if (!this._waterfallRequestsAreStale) { 198 if (!this._waterfallRequestsAreStale) {
199 this._updateScrollerWidthIfNeeded(); 199 this._updateScrollerWidthIfNeeded();
200 this._waterfallColumn.update( 200 this._waterfallColumn.update(
201 this._activeScroller.scrollTop, this._eventDividersShown ? this._event Dividers : undefined); 201 this._activeScroller.scrollTop, this._eventDividersShown ? this._event Dividers : undefined);
202 return; 202 return;
203 } 203 }
204 var currentNode = this._dataGrid.rootNode(); 204 var currentNode = this._dataGrid.rootNode();
205 /** @type {!WebInspector.NetworkWaterfallColumn.RequestData} */ 205 /** @type {!Network.NetworkWaterfallColumn.RequestData} */
206 var requestData = {requests: [], navigationRequest: null}; 206 var requestData = {requests: [], navigationRequest: null};
207 while (currentNode = currentNode.traverseNextNode(true)) { 207 while (currentNode = currentNode.traverseNextNode(true)) {
208 if (currentNode.isNavigationRequest()) 208 if (currentNode.isNavigationRequest())
209 requestData.navigationRequest = currentNode.request(); 209 requestData.navigationRequest = currentNode.request();
210 requestData.requests.push(currentNode.request()); 210 requestData.requests.push(currentNode.request());
211 } 211 }
212 this._waterfallColumn.update(this._activeScroller.scrollTop, this._eventDivi ders, requestData); 212 this._waterfallColumn.update(this._activeScroller.scrollTop, this._eventDivi ders, requestData);
213 } 213 }
214 214
215 /** 215 /**
216 * @param {?WebInspector.NetworkRequest} request 216 * @param {?SDK.NetworkRequest} request
217 * @param {boolean} highlightInitiatorChain 217 * @param {boolean} highlightInitiatorChain
218 */ 218 */
219 setHoveredRequest(request, highlightInitiatorChain) { 219 setHoveredRequest(request, highlightInitiatorChain) {
220 this._waterfallColumn.setHoveredRequest(request, highlightInitiatorChain); 220 this._waterfallColumn.setHoveredRequest(request, highlightInitiatorChain);
221 } 221 }
222 222
223 _createWaterfallHeader() { 223 _createWaterfallHeader() {
224 this._waterfallHeaderElement = this._waterfallColumn.contentElement.createCh ild('div', 'network-waterfall-header'); 224 this._waterfallHeaderElement = this._waterfallColumn.contentElement.createCh ild('div', 'network-waterfall-header');
225 this._waterfallHeaderElement.addEventListener('click', waterfallHeaderClicke d.bind(this)); 225 this._waterfallHeaderElement.addEventListener('click', waterfallHeaderClicke d.bind(this));
226 this._waterfallHeaderElement.addEventListener( 226 this._waterfallHeaderElement.addEventListener(
227 'contextmenu', event => this._innerHeaderContextMenu(new WebInspector.Co ntextMenu(event))); 227 'contextmenu', event => this._innerHeaderContextMenu(new UI.ContextMenu( event)));
228 var innerElement = this._waterfallHeaderElement.createChild('div'); 228 var innerElement = this._waterfallHeaderElement.createChild('div');
229 innerElement.textContent = WebInspector.UIString('Waterfall'); 229 innerElement.textContent = Common.UIString('Waterfall');
230 this._waterfallColumnSortIcon = this._waterfallHeaderElement.createChild('di v', 'sort-order-icon-container') 230 this._waterfallColumnSortIcon = this._waterfallHeaderElement.createChild('di v', 'sort-order-icon-container')
231 .createChild('div', 'sort-order-icon'); 231 .createChild('div', 'sort-order-icon');
232 232
233 /** 233 /**
234 * @this {WebInspector.NetworkLogViewColumns} 234 * @this {Network.NetworkLogViewColumns}
235 */ 235 */
236 function waterfallHeaderClicked() { 236 function waterfallHeaderClicked() {
237 var sortOrders = WebInspector.DataGrid.Order; 237 var sortOrders = UI.DataGrid.Order;
238 var sortOrder = 238 var sortOrder =
239 this._dataGrid.sortOrder() === sortOrders.Ascending ? sortOrders.Desce nding : sortOrders.Ascending; 239 this._dataGrid.sortOrder() === sortOrders.Ascending ? sortOrders.Desce nding : sortOrders.Ascending;
240 this._dataGrid.markColumnAsSortedBy('waterfall', sortOrder); 240 this._dataGrid.markColumnAsSortedBy('waterfall', sortOrder);
241 this._sortHandler(); 241 this._sortHandler();
242 } 242 }
243 } 243 }
244 244
245 /** 245 /**
246 * @param {!WebInspector.NetworkTimeCalculator} x 246 * @param {!Network.NetworkTimeCalculator} x
247 */ 247 */
248 setCalculator(x) { 248 setCalculator(x) {
249 this._waterfallColumn.setCalculator(x); 249 this._waterfallColumn.setCalculator(x);
250 } 250 }
251 251
252 dataChanged() { 252 dataChanged() {
253 this._waterfallRequestsAreStale = true; 253 this._waterfallRequestsAreStale = true;
254 } 254 }
255 255
256 _updateRowsSize() { 256 _updateRowsSize() {
257 var largeRows = !!this._networkLogLargeRowsSetting.get(); 257 var largeRows = !!this._networkLogLargeRowsSetting.get();
258 this._dataGrid.element.classList.toggle('small', !largeRows); 258 this._dataGrid.element.classList.toggle('small', !largeRows);
259 this._dataGrid.scheduleUpdate(); 259 this._dataGrid.scheduleUpdate();
260 260
261 this._waterfallScrollerWidthIsStale = true; 261 this._waterfallScrollerWidthIsStale = true;
262 this._waterfallColumn.setRowHeight(this._networkLogView.rowHeight()); 262 this._waterfallColumn.setRowHeight(this._networkLogView.rowHeight());
263 this._waterfallScroller.classList.toggle('small', !largeRows); 263 this._waterfallScroller.classList.toggle('small', !largeRows);
264 this._waterfallHeaderElement.classList.toggle('small', !largeRows); 264 this._waterfallHeaderElement.classList.toggle('small', !largeRows);
265 this._waterfallColumn.setHeaderHeight(this._waterfallScroller.offsetTop); 265 this._waterfallColumn.setHeaderHeight(this._waterfallScroller.offsetTop);
266 } 266 }
267 267
268 /** 268 /**
269 * @param {!Element} element 269 * @param {!Element} element
270 */ 270 */
271 show(element) { 271 show(element) {
272 this._splitWidget.show(element); 272 this._splitWidget.show(element);
273 } 273 }
274 274
275 /** 275 /**
276 * @return {!WebInspector.SortableDataGrid} dataGrid 276 * @return {!UI.SortableDataGrid} dataGrid
277 */ 277 */
278 dataGrid() { 278 dataGrid() {
279 return this._dataGrid; 279 return this._dataGrid;
280 } 280 }
281 281
282 sortByCurrentColumn() { 282 sortByCurrentColumn() {
283 this._sortHandler(); 283 this._sortHandler();
284 } 284 }
285 285
286 _sortHandler() { 286 _sortHandler() {
287 var columnId = this._dataGrid.sortColumnId(); 287 var columnId = this._dataGrid.sortColumnId();
288 this._networkLogView.removeAllNodeHighlights(); 288 this._networkLogView.removeAllNodeHighlights();
289 if (columnId === 'waterfall') { 289 if (columnId === 'waterfall') {
290 this._waterfallColumnSortIcon.classList.remove('sort-ascending', 'sort-des cending'); 290 this._waterfallColumnSortIcon.classList.remove('sort-ascending', 'sort-des cending');
291 291
292 if (this._dataGrid.sortOrder() === WebInspector.DataGrid.Order.Ascending) 292 if (this._dataGrid.sortOrder() === UI.DataGrid.Order.Ascending)
293 this._waterfallColumnSortIcon.classList.add('sort-ascending'); 293 this._waterfallColumnSortIcon.classList.add('sort-ascending');
294 else 294 else
295 this._waterfallColumnSortIcon.classList.add('sort-descending'); 295 this._waterfallColumnSortIcon.classList.add('sort-descending');
296 296
297 this._waterfallRequestsAreStale = true; 297 this._waterfallRequestsAreStale = true;
298 var sortFunction = 298 var sortFunction =
299 WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, this._activeWaterfallSortId); 299 Network.NetworkDataGridNode.RequestPropertyComparator.bind(null, this. _activeWaterfallSortId);
300 this._dataGrid.sortNodes(sortFunction, !this._dataGrid.isSortOrderAscendin g()); 300 this._dataGrid.sortNodes(sortFunction, !this._dataGrid.isSortOrderAscendin g());
301 return; 301 return;
302 } 302 }
303 303
304 var columnConfig = this._columns.find(columnConfig => columnConfig.id === co lumnId); 304 var columnConfig = this._columns.find(columnConfig => columnConfig.id === co lumnId);
305 if (!columnConfig || !columnConfig.sortingFunction) 305 if (!columnConfig || !columnConfig.sortingFunction)
306 return; 306 return;
307 307
308 this._dataGrid.sortNodes(columnConfig.sortingFunction, !this._dataGrid.isSor tOrderAscending()); 308 this._dataGrid.sortNodes(columnConfig.sortingFunction, !this._dataGrid.isSor tOrderAscending());
309 this._networkLogView.dataGridSorted(); 309 this._networkLogView.dataGridSorted();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 this._networkLogView.removeAllNodeHighlights(); 341 this._networkLogView.removeAllNodeHighlights();
342 this._splitWidget.hideSidebar(); 342 this._splitWidget.hideSidebar();
343 this._activeScroller = this._dataGridScroller; 343 this._activeScroller = this._dataGridScroller;
344 this._dataGrid.setScrollContainer(this._dataGridScroller); 344 this._dataGrid.setScrollContainer(this._dataGridScroller);
345 } 345 }
346 this._networkLogView.element.classList.toggle('brief-mode', !gridMode); 346 this._networkLogView.element.classList.toggle('brief-mode', !gridMode);
347 this._updateColumns(); 347 this._updateColumns();
348 } 348 }
349 349
350 /** 350 /**
351 * @param {!WebInspector.NetworkLogViewColumns.Descriptor} columnConfig 351 * @param {!Network.NetworkLogViewColumns.Descriptor} columnConfig
352 */ 352 */
353 _toggleColumnVisibility(columnConfig) { 353 _toggleColumnVisibility(columnConfig) {
354 this._loadColumns(); 354 this._loadColumns();
355 columnConfig.visible = !columnConfig.visible; 355 columnConfig.visible = !columnConfig.visible;
356 this._saveColumns(); 356 this._saveColumns();
357 this._updateColumns(); 357 this._updateColumns();
358 } 358 }
359 359
360 _saveColumns() { 360 _saveColumns() {
361 var saveableSettings = {}; 361 var saveableSettings = {};
(...skipping 25 matching lines...) Expand all
387 */ 387 */
388 _makeHeaderFragment(title, subtitle) { 388 _makeHeaderFragment(title, subtitle) {
389 var fragment = createDocumentFragment(); 389 var fragment = createDocumentFragment();
390 fragment.createTextChild(title); 390 fragment.createTextChild(title);
391 var subtitleDiv = fragment.createChild('div', 'network-header-subtitle'); 391 var subtitleDiv = fragment.createChild('div', 'network-header-subtitle');
392 subtitleDiv.createTextChild(subtitle); 392 subtitleDiv.createTextChild(subtitle);
393 return fragment; 393 return fragment;
394 } 394 }
395 395
396 /** 396 /**
397 * @param {!WebInspector.ContextMenu} contextMenu 397 * @param {!UI.ContextMenu} contextMenu
398 */ 398 */
399 _innerHeaderContextMenu(contextMenu) { 399 _innerHeaderContextMenu(contextMenu) {
400 var columnConfigs = this._columns.filter(columnConfig => columnConfig.hideab le); 400 var columnConfigs = this._columns.filter(columnConfig => columnConfig.hideab le);
401 var nonResponseHeaders = columnConfigs.filter(columnConfig => !columnConfig. isResponseHeader); 401 var nonResponseHeaders = columnConfigs.filter(columnConfig => !columnConfig. isResponseHeader);
402 for (var columnConfig of nonResponseHeaders) { 402 for (var columnConfig of nonResponseHeaders) {
403 contextMenu.appendCheckboxItem( 403 contextMenu.appendCheckboxItem(
404 columnConfig.title, this._toggleColumnVisibility.bind(this, columnConf ig), columnConfig.visible); 404 columnConfig.title, this._toggleColumnVisibility.bind(this, columnConf ig), columnConfig.visible);
405 } 405 }
406 406
407 contextMenu.appendSeparator(); 407 contextMenu.appendSeparator();
408 408
409 var responseSubMenu = contextMenu.appendSubMenuItem(WebInspector.UIString('R esponse Headers')); 409 var responseSubMenu = contextMenu.appendSubMenuItem(Common.UIString('Respons e Headers'));
410 var responseHeaders = columnConfigs.filter(columnConfig => columnConfig.isRe sponseHeader); 410 var responseHeaders = columnConfigs.filter(columnConfig => columnConfig.isRe sponseHeader);
411 for (var columnConfig of responseHeaders) { 411 for (var columnConfig of responseHeaders) {
412 responseSubMenu.appendCheckboxItem( 412 responseSubMenu.appendCheckboxItem(
413 columnConfig.title, this._toggleColumnVisibility.bind(this, columnConf ig), columnConfig.visible); 413 columnConfig.title, this._toggleColumnVisibility.bind(this, columnConf ig), columnConfig.visible);
414 } 414 }
415 415
416 responseSubMenu.appendSeparator(); 416 responseSubMenu.appendSeparator();
417 responseSubMenu.appendItem( 417 responseSubMenu.appendItem(
418 WebInspector.UIString('Manage Header Columns\u2026'), this._manageCustom HeaderDialog.bind(this)); 418 Common.UIString('Manage Header Columns\u2026'), this._manageCustomHeader Dialog.bind(this));
419 419
420 contextMenu.appendSeparator(); 420 contextMenu.appendSeparator();
421 421
422 var waterfallSortIds = WebInspector.NetworkLogViewColumns.WaterfallSortIds; 422 var waterfallSortIds = Network.NetworkLogViewColumns.WaterfallSortIds;
423 var waterfallSubMenu = contextMenu.appendSubMenuItem(WebInspector.UIString(' Waterfall')); 423 var waterfallSubMenu = contextMenu.appendSubMenuItem(Common.UIString('Waterf all'));
424 waterfallSubMenu.appendCheckboxItem( 424 waterfallSubMenu.appendCheckboxItem(
425 WebInspector.UIString('Start Time'), setWaterfallMode.bind(this, waterfa llSortIds.StartTime), 425 Common.UIString('Start Time'), setWaterfallMode.bind(this, waterfallSort Ids.StartTime),
426 this._activeWaterfallSortId === waterfallSortIds.StartTime); 426 this._activeWaterfallSortId === waterfallSortIds.StartTime);
427 waterfallSubMenu.appendCheckboxItem( 427 waterfallSubMenu.appendCheckboxItem(
428 WebInspector.UIString('Response Time'), setWaterfallMode.bind(this, wate rfallSortIds.ResponseTime), 428 Common.UIString('Response Time'), setWaterfallMode.bind(this, waterfallS ortIds.ResponseTime),
429 this._activeWaterfallSortId === waterfallSortIds.ResponseTime); 429 this._activeWaterfallSortId === waterfallSortIds.ResponseTime);
430 waterfallSubMenu.appendCheckboxItem( 430 waterfallSubMenu.appendCheckboxItem(
431 WebInspector.UIString('End Time'), setWaterfallMode.bind(this, waterfall SortIds.EndTime), 431 Common.UIString('End Time'), setWaterfallMode.bind(this, waterfallSortId s.EndTime),
432 this._activeWaterfallSortId === waterfallSortIds.EndTime); 432 this._activeWaterfallSortId === waterfallSortIds.EndTime);
433 waterfallSubMenu.appendCheckboxItem( 433 waterfallSubMenu.appendCheckboxItem(
434 WebInspector.UIString('Total Duration'), setWaterfallMode.bind(this, wat erfallSortIds.Duration), 434 Common.UIString('Total Duration'), setWaterfallMode.bind(this, waterfall SortIds.Duration),
435 this._activeWaterfallSortId === waterfallSortIds.Duration); 435 this._activeWaterfallSortId === waterfallSortIds.Duration);
436 waterfallSubMenu.appendCheckboxItem( 436 waterfallSubMenu.appendCheckboxItem(
437 WebInspector.UIString('Latency'), setWaterfallMode.bind(this, waterfallS ortIds.Latency), 437 Common.UIString('Latency'), setWaterfallMode.bind(this, waterfallSortIds .Latency),
438 this._activeWaterfallSortId === waterfallSortIds.Latency); 438 this._activeWaterfallSortId === waterfallSortIds.Latency);
439 439
440 contextMenu.show(); 440 contextMenu.show();
441 441
442 /** 442 /**
443 * @param {!WebInspector.NetworkLogViewColumns.WaterfallSortIds} sortId 443 * @param {!Network.NetworkLogViewColumns.WaterfallSortIds} sortId
444 * @this {WebInspector.NetworkLogViewColumns} 444 * @this {Network.NetworkLogViewColumns}
445 */ 445 */
446 function setWaterfallMode(sortId) { 446 function setWaterfallMode(sortId) {
447 var calculator = this._calculatorsMap.get(WebInspector.NetworkLogViewColum ns._calculatorTypes.Time); 447 var calculator = this._calculatorsMap.get(Network.NetworkLogViewColumns._c alculatorTypes.Time);
448 var waterfallSortIds = WebInspector.NetworkLogViewColumns.WaterfallSortIds ; 448 var waterfallSortIds = Network.NetworkLogViewColumns.WaterfallSortIds;
449 if (sortId === waterfallSortIds.Duration || sortId === waterfallSortIds.La tency) 449 if (sortId === waterfallSortIds.Duration || sortId === waterfallSortIds.La tency)
450 calculator = this._calculatorsMap.get(WebInspector.NetworkLogViewColumns ._calculatorTypes.Duration); 450 calculator = this._calculatorsMap.get(Network.NetworkLogViewColumns._cal culatorTypes.Duration);
451 this._networkLogView.setCalculator(calculator); 451 this._networkLogView.setCalculator(calculator);
452 452
453 this._activeWaterfallSortId = sortId; 453 this._activeWaterfallSortId = sortId;
454 this._dataGrid.markColumnAsSortedBy('waterfall', WebInspector.DataGrid.Ord er.Ascending); 454 this._dataGrid.markColumnAsSortedBy('waterfall', UI.DataGrid.Order.Ascendi ng);
455 this._sortHandler(); 455 this._sortHandler();
456 } 456 }
457 } 457 }
458 458
459 _manageCustomHeaderDialog() { 459 _manageCustomHeaderDialog() {
460 var customHeaders = []; 460 var customHeaders = [];
461 for (var columnConfig of this._columns) { 461 for (var columnConfig of this._columns) {
462 if (columnConfig.isResponseHeader) 462 if (columnConfig.isResponseHeader)
463 customHeaders.push({title: columnConfig.title, editable: columnConfig.is CustomHeader}); 463 customHeaders.push({title: columnConfig.title, editable: columnConfig.is CustomHeader});
464 } 464 }
465 var manageCustomHeaders = new WebInspector.NetworkManageCustomHeadersView( 465 var manageCustomHeaders = new Network.NetworkManageCustomHeadersView(
466 customHeaders, headerTitle => !!this._addCustomHeader(headerTitle), this ._changeCustomHeader.bind(this), 466 customHeaders, headerTitle => !!this._addCustomHeader(headerTitle), this ._changeCustomHeader.bind(this),
467 this._removeCustomHeader.bind(this)); 467 this._removeCustomHeader.bind(this));
468 var dialog = new WebInspector.Dialog(); 468 var dialog = new UI.Dialog();
469 manageCustomHeaders.show(dialog.element); 469 manageCustomHeaders.show(dialog.element);
470 dialog.setWrapsContent(true); 470 dialog.setWrapsContent(true);
471 dialog.show(); 471 dialog.show();
472 } 472 }
473 473
474 /** 474 /**
475 * @param {string} headerId 475 * @param {string} headerId
476 * @return {boolean} 476 * @return {boolean}
477 */ 477 */
478 _removeCustomHeader(headerId) { 478 _removeCustomHeader(headerId) {
479 headerId = headerId.toLowerCase(); 479 headerId = headerId.toLowerCase();
480 var index = this._columns.findIndex(columnConfig => columnConfig.id === head erId); 480 var index = this._columns.findIndex(columnConfig => columnConfig.id === head erId);
481 if (index === -1) 481 if (index === -1)
482 return false; 482 return false;
483 var columnConfig = this._columns.splice(index, 1); 483 var columnConfig = this._columns.splice(index, 1);
484 this._dataGrid.removeColumn(headerId); 484 this._dataGrid.removeColumn(headerId);
485 this._saveColumns(); 485 this._saveColumns();
486 this._updateColumns(); 486 this._updateColumns();
487 return true; 487 return true;
488 } 488 }
489 489
490 /** 490 /**
491 * @param {string} headerTitle 491 * @param {string} headerTitle
492 * @param {string=} headerId 492 * @param {string=} headerId
493 * @param {number=} index 493 * @param {number=} index
494 * @return {?WebInspector.NetworkLogViewColumns.Descriptor} 494 * @return {?Network.NetworkLogViewColumns.Descriptor}
495 */ 495 */
496 _addCustomHeader(headerTitle, headerId, index) { 496 _addCustomHeader(headerTitle, headerId, index) {
497 if (!headerId) 497 if (!headerId)
498 headerId = headerTitle.toLowerCase(); 498 headerId = headerTitle.toLowerCase();
499 if (index === undefined) 499 if (index === undefined)
500 index = this._columns.length - 1; 500 index = this._columns.length - 1;
501 501
502 var currentColumnConfig = this._columns.find(columnConfig => columnConfig.id === headerId); 502 var currentColumnConfig = this._columns.find(columnConfig => columnConfig.id === headerId);
503 if (currentColumnConfig) 503 if (currentColumnConfig)
504 return null; 504 return null;
505 505
506 var columnConfig = /** @type {!WebInspector.NetworkLogViewColumns.Descriptor } */ ( 506 var columnConfig = /** @type {!Network.NetworkLogViewColumns.Descriptor} */ (
507 Object.assign(/** @type {!Object} */ ({}), WebInspector.NetworkLogViewCo lumns._defaultColumnConfig, { 507 Object.assign(/** @type {!Object} */ ({}), Network.NetworkLogViewColumns ._defaultColumnConfig, {
508 id: headerId, 508 id: headerId,
509 title: headerTitle, 509 title: headerTitle,
510 isResponseHeader: true, 510 isResponseHeader: true,
511 isCustomHeader: true, 511 isCustomHeader: true,
512 visible: true, 512 visible: true,
513 sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderString Comparator.bind(null, headerId) 513 sortingFunction: Network.NetworkDataGridNode.ResponseHeaderStringCompa rator.bind(null, headerId)
514 })); 514 }));
515 this._columns.splice(index, 0, columnConfig); 515 this._columns.splice(index, 0, columnConfig);
516 if (this._dataGrid) 516 if (this._dataGrid)
517 this._dataGrid.addColumn(WebInspector.NetworkLogViewColumns._convertToData GridDescriptor(columnConfig), index); 517 this._dataGrid.addColumn(Network.NetworkLogViewColumns._convertToDataGridD escriptor(columnConfig), index);
518 this._saveColumns(); 518 this._saveColumns();
519 this._updateColumns(); 519 this._updateColumns();
520 return columnConfig; 520 return columnConfig;
521 } 521 }
522 522
523 /** 523 /**
524 * @param {string} oldHeaderId 524 * @param {string} oldHeaderId
525 * @param {string} newHeaderTitle 525 * @param {string} newHeaderTitle
526 * @param {string=} newHeaderId 526 * @param {string=} newHeaderId
527 * @return {boolean} 527 * @return {boolean}
(...skipping 17 matching lines...) Expand all
545 /** 545 /**
546 * @param {!Element} element 546 * @param {!Element} element
547 * @param {!Event} event 547 * @param {!Event} event
548 * @return {!Element|!AnchorBox|undefined} 548 * @return {!Element|!AnchorBox|undefined}
549 */ 549 */
550 _getPopoverAnchor(element, event) { 550 _getPopoverAnchor(element, event) {
551 if (!this._gridMode) 551 if (!this._gridMode)
552 return; 552 return;
553 var anchor = element.enclosingNodeOrSelfWithClass('network-script-initiated' ); 553 var anchor = element.enclosingNodeOrSelfWithClass('network-script-initiated' );
554 if (anchor && anchor.request) { 554 if (anchor && anchor.request) {
555 var initiator = /** @type {!WebInspector.NetworkRequest} */ (anchor.reques t).initiator(); 555 var initiator = /** @type {!SDK.NetworkRequest} */ (anchor.request).initia tor();
556 if (initiator && initiator.stack) 556 if (initiator && initiator.stack)
557 return anchor; 557 return anchor;
558 } 558 }
559 } 559 }
560 560
561 /** 561 /**
562 * @param {!Element} anchor 562 * @param {!Element} anchor
563 * @param {!WebInspector.Popover} popover 563 * @param {!UI.Popover} popover
564 */ 564 */
565 _showPopover(anchor, popover) { 565 _showPopover(anchor, popover) {
566 var request = /** @type {!WebInspector.NetworkRequest} */ (anchor.request); 566 var request = /** @type {!SDK.NetworkRequest} */ (anchor.request);
567 var initiator = /** @type {!Protocol.Network.Initiator} */ (request.initiato r()); 567 var initiator = /** @type {!Protocol.Network.Initiator} */ (request.initiato r());
568 var content = WebInspector.DOMPresentationUtils.buildStackTracePreviewConten ts( 568 var content = Components.DOMPresentationUtils.buildStackTracePreviewContents (
569 request.target(), this._popupLinkifier, initiator.stack); 569 request.target(), this._popupLinkifier, initiator.stack);
570 popover.setCanShrink(true); 570 popover.setCanShrink(true);
571 popover.showForAnchor(content, anchor); 571 popover.showForAnchor(content, anchor);
572 } 572 }
573 573
574 _onHidePopover() { 574 _onHidePopover() {
575 this._popupLinkifier.reset(); 575 this._popupLinkifier.reset();
576 } 576 }
577 577
578 /** 578 /**
(...skipping 25 matching lines...) Expand all
604 604
605 showEventDividers() { 605 showEventDividers() {
606 this._eventDividersShown = false; 606 this._eventDividersShown = false;
607 this._redrawWaterfallColumn(); 607 this._redrawWaterfallColumn();
608 } 608 }
609 609
610 /** 610 /**
611 * @param {number} time 611 * @param {number} time
612 */ 612 */
613 selectFilmStripFrame(time) { 613 selectFilmStripFrame(time) {
614 this._eventDividers.set(WebInspector.NetworkLogViewColumns._filmStripDivider Color, [time]); 614 this._eventDividers.set(Network.NetworkLogViewColumns._filmStripDividerColor , [time]);
615 this._redrawWaterfallColumn(); 615 this._redrawWaterfallColumn();
616 } 616 }
617 617
618 clearFilmStripFrame() { 618 clearFilmStripFrame() {
619 this._eventDividers.delete(WebInspector.NetworkLogViewColumns._filmStripDivi derColor); 619 this._eventDividers.delete(Network.NetworkLogViewColumns._filmStripDividerCo lor);
620 this._redrawWaterfallColumn(); 620 this._redrawWaterfallColumn();
621 } 621 }
622 }; 622 };
623 623
624 WebInspector.NetworkLogViewColumns._initialSortColumn = 'waterfall'; 624 Network.NetworkLogViewColumns._initialSortColumn = 'waterfall';
625 625
626 /** 626 /**
627 * @typedef {{ 627 * @typedef {{
628 * id: string, 628 * id: string,
629 * title: string, 629 * title: string,
630 * titleDOMFragment: (!DocumentFragment|undefined), 630 * titleDOMFragment: (!DocumentFragment|undefined),
631 * subtitle: (string|null), 631 * subtitle: (string|null),
632 * visible: boolean, 632 * visible: boolean,
633 * weight: number, 633 * weight: number,
634 * hideable: boolean, 634 * hideable: boolean,
635 * nonSelectable: boolean, 635 * nonSelectable: boolean,
636 * sortable: boolean, 636 * sortable: boolean,
637 * align: (?WebInspector.DataGrid.Align|undefined), 637 * align: (?UI.DataGrid.Align|undefined),
638 * isResponseHeader: boolean, 638 * isResponseHeader: boolean,
639 * sortingFunction: (!function(!WebInspector.NetworkDataGridNode, !WebInspec tor.NetworkDataGridNode):number|undefined), 639 * sortingFunction: (!function(!Network.NetworkDataGridNode, !Network.Networ kDataGridNode):number|undefined),
640 * isCustomHeader: boolean 640 * isCustomHeader: boolean
641 * }} 641 * }}
642 */ 642 */
643 WebInspector.NetworkLogViewColumns.Descriptor; 643 Network.NetworkLogViewColumns.Descriptor;
644 644
645 /** @enum {string} */ 645 /** @enum {string} */
646 WebInspector.NetworkLogViewColumns._calculatorTypes = { 646 Network.NetworkLogViewColumns._calculatorTypes = {
647 Duration: 'Duration', 647 Duration: 'Duration',
648 Time: 'Time' 648 Time: 'Time'
649 }; 649 };
650 650
651 /** 651 /**
652 * @type {!Object} column 652 * @type {!Object} column
653 */ 653 */
654 WebInspector.NetworkLogViewColumns._defaultColumnConfig = { 654 Network.NetworkLogViewColumns._defaultColumnConfig = {
655 subtitle: null, 655 subtitle: null,
656 visible: false, 656 visible: false,
657 weight: 6, 657 weight: 6,
658 sortable: true, 658 sortable: true,
659 hideable: true, 659 hideable: true,
660 nonSelectable: true, 660 nonSelectable: true,
661 isResponseHeader: false, 661 isResponseHeader: false,
662 alwaysVisible: false, 662 alwaysVisible: false,
663 isCustomHeader: false 663 isCustomHeader: false
664 }; 664 };
665 665
666 /** 666 /**
667 * @type {!Array.<!WebInspector.NetworkLogViewColumns.Descriptor>} column 667 * @type {!Array.<!Network.NetworkLogViewColumns.Descriptor>} column
668 */ 668 */
669 WebInspector.NetworkLogViewColumns._defaultColumns = [ 669 Network.NetworkLogViewColumns._defaultColumns = [
670 { 670 {
671 id: 'name', 671 id: 'name',
672 title: WebInspector.UIString('Name'), 672 title: Common.UIString('Name'),
673 subtitle: WebInspector.UIString('Path'), 673 subtitle: Common.UIString('Path'),
674 visible: true, 674 visible: true,
675 weight: 20, 675 weight: 20,
676 hideable: false, 676 hideable: false,
677 nonSelectable: false, 677 nonSelectable: false,
678 alwaysVisible: true, 678 alwaysVisible: true,
679 sortingFunction: WebInspector.NetworkDataGridNode.NameComparator 679 sortingFunction: Network.NetworkDataGridNode.NameComparator
680 }, 680 },
681 { 681 {
682 id: 'method', 682 id: 'method',
683 title: WebInspector.UIString('Method'), 683 title: Common.UIString('Method'),
684 sortingFunction: WebInspector.NetworkDataGridNode.RequestPropertyComparator. bind(null, 'requestMethod') 684 sortingFunction: Network.NetworkDataGridNode.RequestPropertyComparator.bind( null, 'requestMethod')
685 }, 685 },
686 { 686 {
687 id: 'status', 687 id: 'status',
688 title: WebInspector.UIString('Status'), 688 title: Common.UIString('Status'),
689 visible: true, 689 visible: true,
690 subtitle: WebInspector.UIString('Text'), 690 subtitle: Common.UIString('Text'),
691 sortingFunction: WebInspector.NetworkDataGridNode.RequestPropertyComparator. bind(null, 'statusCode') 691 sortingFunction: Network.NetworkDataGridNode.RequestPropertyComparator.bind( null, 'statusCode')
692 }, 692 },
693 { 693 {
694 id: 'protocol', 694 id: 'protocol',
695 title: WebInspector.UIString('Protocol'), 695 title: Common.UIString('Protocol'),
696 sortingFunction: WebInspector.NetworkDataGridNode.RequestPropertyComparator. bind(null, 'protocol') 696 sortingFunction: Network.NetworkDataGridNode.RequestPropertyComparator.bind( null, 'protocol')
697 }, 697 },
698 { 698 {
699 id: 'scheme', 699 id: 'scheme',
700 title: WebInspector.UIString('Scheme'), 700 title: Common.UIString('Scheme'),
701 sortingFunction: WebInspector.NetworkDataGridNode.RequestPropertyComparator. bind(null, 'scheme') 701 sortingFunction: Network.NetworkDataGridNode.RequestPropertyComparator.bind( null, 'scheme')
702 }, 702 },
703 { 703 {
704 id: 'domain', 704 id: 'domain',
705 title: WebInspector.UIString('Domain'), 705 title: Common.UIString('Domain'),
706 sortingFunction: WebInspector.NetworkDataGridNode.RequestPropertyComparator. bind(null, 'domain') 706 sortingFunction: Network.NetworkDataGridNode.RequestPropertyComparator.bind( null, 'domain')
707 }, 707 },
708 { 708 {
709 id: 'remoteaddress', 709 id: 'remoteaddress',
710 title: WebInspector.UIString('Remote Address'), 710 title: Common.UIString('Remote Address'),
711 weight: 10, 711 weight: 10,
712 align: WebInspector.DataGrid.Align.Right, 712 align: UI.DataGrid.Align.Right,
713 sortingFunction: WebInspector.NetworkDataGridNode.RemoteAddressComparator 713 sortingFunction: Network.NetworkDataGridNode.RemoteAddressComparator
714 }, 714 },
715 { 715 {
716 id: 'type', 716 id: 'type',
717 title: WebInspector.UIString('Type'), 717 title: Common.UIString('Type'),
718 visible: true, 718 visible: true,
719 sortingFunction: WebInspector.NetworkDataGridNode.TypeComparator 719 sortingFunction: Network.NetworkDataGridNode.TypeComparator
720 }, 720 },
721 { 721 {
722 id: 'initiator', 722 id: 'initiator',
723 title: WebInspector.UIString('Initiator'), 723 title: Common.UIString('Initiator'),
724 visible: true, 724 visible: true,
725 weight: 10, 725 weight: 10,
726 sortingFunction: WebInspector.NetworkDataGridNode.InitiatorComparator 726 sortingFunction: Network.NetworkDataGridNode.InitiatorComparator
727 }, 727 },
728 { 728 {
729 id: 'cookies', 729 id: 'cookies',
730 title: WebInspector.UIString('Cookies'), 730 title: Common.UIString('Cookies'),
731 align: WebInspector.DataGrid.Align.Right, 731 align: UI.DataGrid.Align.Right,
732 sortingFunction: WebInspector.NetworkDataGridNode.RequestCookiesCountCompara tor 732 sortingFunction: Network.NetworkDataGridNode.RequestCookiesCountComparator
733 }, 733 },
734 { 734 {
735 id: 'setcookies', 735 id: 'setcookies',
736 title: WebInspector.UIString('Set Cookies'), 736 title: Common.UIString('Set Cookies'),
737 align: WebInspector.DataGrid.Align.Right, 737 align: UI.DataGrid.Align.Right,
738 sortingFunction: WebInspector.NetworkDataGridNode.ResponseCookiesCountCompar ator 738 sortingFunction: Network.NetworkDataGridNode.ResponseCookiesCountComparator
739 }, 739 },
740 { 740 {
741 id: 'size', 741 id: 'size',
742 title: WebInspector.UIString('Size'), 742 title: Common.UIString('Size'),
743 visible: true, 743 visible: true,
744 subtitle: WebInspector.UIString('Content'), 744 subtitle: Common.UIString('Content'),
745 align: WebInspector.DataGrid.Align.Right, 745 align: UI.DataGrid.Align.Right,
746 sortingFunction: WebInspector.NetworkDataGridNode.SizeComparator 746 sortingFunction: Network.NetworkDataGridNode.SizeComparator
747 }, 747 },
748 { 748 {
749 id: 'time', 749 id: 'time',
750 title: WebInspector.UIString('Time'), 750 title: Common.UIString('Time'),
751 visible: true, 751 visible: true,
752 subtitle: WebInspector.UIString('Latency'), 752 subtitle: Common.UIString('Latency'),
753 align: WebInspector.DataGrid.Align.Right, 753 align: UI.DataGrid.Align.Right,
754 sortingFunction: WebInspector.NetworkDataGridNode.RequestPropertyComparator. bind(null, 'duration') 754 sortingFunction: Network.NetworkDataGridNode.RequestPropertyComparator.bind( null, 'duration')
755 }, 755 },
756 { 756 {
757 id: 'priority', 757 id: 'priority',
758 title: WebInspector.UIString('Priority'), 758 title: Common.UIString('Priority'),
759 sortingFunction: WebInspector.NetworkDataGridNode.InitialPriorityComparator 759 sortingFunction: Network.NetworkDataGridNode.InitialPriorityComparator
760 }, 760 },
761 { 761 {
762 id: 'connectionid', 762 id: 'connectionid',
763 title: WebInspector.UIString('Connection ID'), 763 title: Common.UIString('Connection ID'),
764 sortingFunction: WebInspector.NetworkDataGridNode.RequestPropertyComparator. bind(null, 'connectionId') 764 sortingFunction: Network.NetworkDataGridNode.RequestPropertyComparator.bind( null, 'connectionId')
765 }, 765 },
766 { 766 {
767 id: 'cache-control', 767 id: 'cache-control',
768 isResponseHeader: true, 768 isResponseHeader: true,
769 title: WebInspector.UIString('Cache-Control'), 769 title: Common.UIString('Cache-Control'),
770 sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderStringCompar ator.bind(null, 'cache-control') 770 sortingFunction: Network.NetworkDataGridNode.ResponseHeaderStringComparator. bind(null, 'cache-control')
771 }, 771 },
772 { 772 {
773 id: 'connection', 773 id: 'connection',
774 isResponseHeader: true, 774 isResponseHeader: true,
775 title: WebInspector.UIString('Connection'), 775 title: Common.UIString('Connection'),
776 sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderStringCompar ator.bind(null, 'connection') 776 sortingFunction: Network.NetworkDataGridNode.ResponseHeaderStringComparator. bind(null, 'connection')
777 }, 777 },
778 { 778 {
779 id: 'content-encoding', 779 id: 'content-encoding',
780 isResponseHeader: true, 780 isResponseHeader: true,
781 title: WebInspector.UIString('Content-Encoding'), 781 title: Common.UIString('Content-Encoding'),
782 sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderStringCompar ator.bind(null, 'content-encoding') 782 sortingFunction: Network.NetworkDataGridNode.ResponseHeaderStringComparator. bind(null, 'content-encoding')
783 }, 783 },
784 { 784 {
785 id: 'content-length', 785 id: 'content-length',
786 isResponseHeader: true, 786 isResponseHeader: true,
787 title: WebInspector.UIString('Content-Length'), 787 title: Common.UIString('Content-Length'),
788 align: WebInspector.DataGrid.Align.Right, 788 align: UI.DataGrid.Align.Right,
789 sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderNumberCompar ator.bind(null, 'content-length') 789 sortingFunction: Network.NetworkDataGridNode.ResponseHeaderNumberComparator. bind(null, 'content-length')
790 }, 790 },
791 { 791 {
792 id: 'etag', 792 id: 'etag',
793 isResponseHeader: true, 793 isResponseHeader: true,
794 title: WebInspector.UIString('ETag'), 794 title: Common.UIString('ETag'),
795 sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderStringCompar ator.bind(null, 'etag') 795 sortingFunction: Network.NetworkDataGridNode.ResponseHeaderStringComparator. bind(null, 'etag')
796 }, 796 },
797 { 797 {
798 id: 'keep-alive', 798 id: 'keep-alive',
799 isResponseHeader: true, 799 isResponseHeader: true,
800 title: WebInspector.UIString('Keep-Alive'), 800 title: Common.UIString('Keep-Alive'),
801 sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderStringCompar ator.bind(null, 'keep-alive') 801 sortingFunction: Network.NetworkDataGridNode.ResponseHeaderStringComparator. bind(null, 'keep-alive')
802 }, 802 },
803 { 803 {
804 id: 'last-modified', 804 id: 'last-modified',
805 isResponseHeader: true, 805 isResponseHeader: true,
806 title: WebInspector.UIString('Last-Modified'), 806 title: Common.UIString('Last-Modified'),
807 sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderDateComparat or.bind(null, 'last-modified') 807 sortingFunction: Network.NetworkDataGridNode.ResponseHeaderDateComparator.bi nd(null, 'last-modified')
808 }, 808 },
809 { 809 {
810 id: 'server', 810 id: 'server',
811 isResponseHeader: true, 811 isResponseHeader: true,
812 title: WebInspector.UIString('Server'), 812 title: Common.UIString('Server'),
813 sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderStringCompar ator.bind(null, 'server') 813 sortingFunction: Network.NetworkDataGridNode.ResponseHeaderStringComparator. bind(null, 'server')
814 }, 814 },
815 { 815 {
816 id: 'vary', 816 id: 'vary',
817 isResponseHeader: true, 817 isResponseHeader: true,
818 title: WebInspector.UIString('Vary'), 818 title: Common.UIString('Vary'),
819 sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderStringCompar ator.bind(null, 'vary') 819 sortingFunction: Network.NetworkDataGridNode.ResponseHeaderStringComparator. bind(null, 'vary')
820 }, 820 },
821 // This header is a placeholder to let datagrid know that it can be sorted by this column, but never shown. 821 // This header is a placeholder to let datagrid know that it can be sorted by this column, but never shown.
822 {id: 'waterfall', title: '', visible: false, hideable: false} 822 {id: 'waterfall', title: '', visible: false, hideable: false}
823 ]; 823 ];
824 824
825 WebInspector.NetworkLogViewColumns._filmStripDividerColor = '#fccc49'; 825 Network.NetworkLogViewColumns._filmStripDividerColor = '#fccc49';
826 826
827 /** 827 /**
828 * @enum {string} 828 * @enum {string}
829 */ 829 */
830 WebInspector.NetworkLogViewColumns.WaterfallSortIds = { 830 Network.NetworkLogViewColumns.WaterfallSortIds = {
831 StartTime: 'startTime', 831 StartTime: 'startTime',
832 ResponseTime: 'responseReceivedTime', 832 ResponseTime: 'responseReceivedTime',
833 EndTime: 'endTime', 833 EndTime: 'endTime',
834 Duration: 'duration', 834 Duration: 'duration',
835 Latency: 'latency' 835 Latency: 'latency'
836 }; 836 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698