| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> | 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> |
| 4 * Copyright (C) 2011 Google Inc. All rights reserved. | 4 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 this._splitWidget.setSidebarWidget(this._dataGrid.asWidget()); | 287 this._splitWidget.setSidebarWidget(this._dataGrid.asWidget()); |
| 288 | 288 |
| 289 this._summaryBarElement = this.element.createChild("div", "network-s
ummary-bar"); | 289 this._summaryBarElement = this.element.createChild("div", "network-s
ummary-bar"); |
| 290 | 290 |
| 291 this._timelineWidget = new WebInspector.VBox(); | 291 this._timelineWidget = new WebInspector.VBox(); |
| 292 this._createTimelineHeader(); | 292 this._createTimelineHeader(); |
| 293 this._timelineWidget.element.classList.add("network-timeline-view"); | 293 this._timelineWidget.element.classList.add("network-timeline-view"); |
| 294 this._splitWidget.setMainWidget(this._timelineWidget); | 294 this._splitWidget.setMainWidget(this._timelineWidget); |
| 295 | 295 |
| 296 this._timelineColumn = new WebInspector.NetworkTimelineColumn(this,
this._dataGrid); | 296 this._timelineColumn = new WebInspector.NetworkTimelineColumn(this,
this._dataGrid); |
| 297 this._timelineColumn.addEventListener(WebInspector.NetworkTimelineCo
lumn.Events.RequestHovered, requestHovered.bind(this)); |
| 297 this._timelineColumn.show(this._timelineWidget.element); | 298 this._timelineColumn.show(this._timelineWidget.element); |
| 298 this.switchViewMode(false); | 299 this.switchViewMode(false); |
| 299 } else { | 300 } else { |
| 300 this._createTable(); | 301 this._createTable(); |
| 301 this._dataGrid.asWidget().show(this.element); | 302 this._dataGrid.asWidget().show(this.element); |
| 302 this._summaryBarElement = this.element.createChild("div", "network-s
ummary-bar"); | 303 this._summaryBarElement = this.element.createChild("div", "network-s
ummary-bar"); |
| 303 } | 304 } |
| 304 | 305 |
| 305 this._columns.sortByCurrentColumn(); | 306 this._columns.sortByCurrentColumn(); |
| 306 this._updateRowsSize(); | 307 this._updateRowsSize(); |
| 308 |
| 309 /** |
| 310 * @param {!WebInspector.Event} event |
| 311 * @this {WebInspector.NetworkLogView} |
| 312 */ |
| 313 function requestHovered(event) |
| 314 { |
| 315 var request = /** @type {?WebInspector.NetworkRequest} */ (event.dat
a); |
| 316 var node = request ? this._nodesByRequestId.get(request.requestId) :
null; |
| 317 this._setHoveredNode(node || null); |
| 318 } |
| 307 }, | 319 }, |
| 308 | 320 |
| 309 _showRecordingHint: function() | 321 _showRecordingHint: function() |
| 310 { | 322 { |
| 311 this._hideRecordingHint(); | 323 this._hideRecordingHint(); |
| 312 this._recordingHint = this.element.createChild("div", "network-status-pa
ne fill"); | 324 this._recordingHint = this.element.createChild("div", "network-status-pa
ne fill"); |
| 313 var hintText = this._recordingHint.createChild("div", "recording-hint"); | 325 var hintText = this._recordingHint.createChild("div", "recording-hint"); |
| 314 var reloadShortcutNode = this._recordingHint.createChild("b"); | 326 var reloadShortcutNode = this._recordingHint.createChild("b"); |
| 315 reloadShortcutNode.textContent = WebInspector.shortcutRegistry.shortcutD
escriptorsForAction("main.reload")[0].name; | 327 reloadShortcutNode.textContent = WebInspector.shortcutRegistry.shortcutD
escriptorsForAction("main.reload")[0].name; |
| 316 | 328 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 347 _createTable: function() | 359 _createTable: function() |
| 348 { | 360 { |
| 349 this._dataGrid = this._columns.createGrid(this._timeCalculator, this._du
rationCalculator); | 361 this._dataGrid = this._columns.createGrid(this._timeCalculator, this._du
rationCalculator); |
| 350 this._dataGrid.setStickToBottom(true); | 362 this._dataGrid.setStickToBottom(true); |
| 351 this._dataGrid.setName("networkLog"); | 363 this._dataGrid.setName("networkLog"); |
| 352 this._dataGrid.setResizeMethod(WebInspector.DataGrid.ResizeMethod.Last); | 364 this._dataGrid.setResizeMethod(WebInspector.DataGrid.ResizeMethod.Last); |
| 353 this._dataGrid.element.classList.add("network-log-grid"); | 365 this._dataGrid.element.classList.add("network-log-grid"); |
| 354 this._dataGrid.element.addEventListener("contextmenu", this._contextMenu
.bind(this), true); | 366 this._dataGrid.element.addEventListener("contextmenu", this._contextMenu
.bind(this), true); |
| 355 this._dataGrid.element.addEventListener("mousedown", this._dataGridMouse
Down.bind(this), true); | 367 this._dataGrid.element.addEventListener("mousedown", this._dataGridMouse
Down.bind(this), true); |
| 356 this._dataGrid.element.addEventListener("mousemove", this._dataGridMouse
Move.bind(this), true); | 368 this._dataGrid.element.addEventListener("mousemove", this._dataGridMouse
Move.bind(this), true); |
| 357 this._dataGrid.element.addEventListener("mouseleave", this._highlightIni
tiatorChain.bind(this, null), true); | 369 this._dataGrid.element.addEventListener("mouseleave", this._dataGridMous
eLeave.bind(this), true); |
| 370 }, |
| 371 |
| 372 /** |
| 373 * @param {!Event} event |
| 374 */ |
| 375 _dataGridMouseMove: function(event) |
| 376 { |
| 377 var node = this._dataGrid.dataGridNodeFromNode(event.target); |
| 378 this._setHoveredNode(node); |
| 379 this._highlightInitiatorChain((event.shiftKey && node) ? node.request()
: null); |
| 380 }, |
| 381 |
| 382 _dataGridMouseLeave: function() |
| 383 { |
| 384 this._setHoveredNode(null); |
| 385 this._highlightInitiatorChain(null); |
| 386 }, |
| 387 |
| 388 /** |
| 389 * @param {?WebInspector.NetworkDataGridNode} node |
| 390 */ |
| 391 _setHoveredNode: function(node) |
| 392 { |
| 393 if (this._hoveredNode) |
| 394 this._hoveredNode.element().classList.remove("hover"); |
| 395 this._hoveredNode = node; |
| 396 if (this._hoveredNode) |
| 397 this._hoveredNode.element().classList.add("hover"); |
| 398 this._timelineColumn.setHoveredRequest(this._hoveredNode ? this._hovered
Node.request() : null); |
| 358 }, | 399 }, |
| 359 | 400 |
| 360 /** | 401 /** |
| 361 * @param {!Event} event | 402 * @param {!Event} event |
| 362 */ | 403 */ |
| 363 _dataGridMouseDown: function(event) | 404 _dataGridMouseDown: function(event) |
| 364 { | 405 { |
| 365 if ((!this._dataGrid.selectedNode && event.button) || event.target.enclo
singNodeOrSelfWithNodeName("a")) | 406 if ((!this._dataGrid.selectedNode && event.button) || event.target.enclo
singNodeOrSelfWithNodeName("a")) |
| 366 event.consume(); | 407 event.consume(); |
| 367 }, | 408 }, |
| 368 | 409 |
| 369 /** | 410 /** |
| 370 * @param {!Event} event | |
| 371 */ | |
| 372 _dataGridMouseMove: function(event) | |
| 373 { | |
| 374 var node = event.shiftKey ? this._dataGrid.dataGridNodeFromNode(event.ta
rget) : null; | |
| 375 this._highlightInitiatorChain(node ? node.request() : null); | |
| 376 }, | |
| 377 | |
| 378 /** | |
| 379 * @param {?WebInspector.NetworkRequest} request | 411 * @param {?WebInspector.NetworkRequest} request |
| 380 */ | 412 */ |
| 381 _highlightInitiatorChain: function(request) | 413 _highlightInitiatorChain: function(request) |
| 382 { | 414 { |
| 383 if (this._requestWithHighlightedInitiators === request) | 415 if (this._requestWithHighlightedInitiators === request) |
| 384 return; | 416 return; |
| 385 this._requestWithHighlightedInitiators = request; | 417 this._requestWithHighlightedInitiators = request; |
| 386 | 418 |
| 387 if (!request) { | 419 if (!request) { |
| 388 for (var node of this._nodesByRequestId.values()) { | 420 for (var node of this._nodesByRequestId.values()) { |
| (...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1817 * @return {boolean} | 1849 * @return {boolean} |
| 1818 */ | 1850 */ |
| 1819 WebInspector.NetworkLogView._requestTimeFilter = function(windowStart, windowEnd
, request) | 1851 WebInspector.NetworkLogView._requestTimeFilter = function(windowStart, windowEnd
, request) |
| 1820 { | 1852 { |
| 1821 if (request.issueTime() > windowEnd) | 1853 if (request.issueTime() > windowEnd) |
| 1822 return false; | 1854 return false; |
| 1823 if (request.endTime !== -1 && request.endTime < windowStart) | 1855 if (request.endTime !== -1 && request.endTime < windowStart) |
| 1824 return false; | 1856 return false; |
| 1825 return true; | 1857 return true; |
| 1826 } | 1858 } |
| OLD | NEW |