Chromium Code Reviews| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 this._mainRequestLoadTime = -1; | 79 this._mainRequestLoadTime = -1; |
| 80 /** @type {number} */ | 80 /** @type {number} */ |
| 81 this._mainRequestDOMContentLoadedTime = -1; | 81 this._mainRequestDOMContentLoadedTime = -1; |
| 82 this._matchedRequestCount = 0; | 82 this._matchedRequestCount = 0; |
| 83 this._highlightedSubstringChanges = []; | 83 this._highlightedSubstringChanges = []; |
| 84 | 84 |
| 85 /** @type {!Array.<!Network.NetworkLogView.Filter>} */ | 85 /** @type {!Array.<!Network.NetworkLogView.Filter>} */ |
| 86 this._filters = []; | 86 this._filters = []; |
| 87 /** @type {?Network.NetworkLogView.Filter} */ | 87 /** @type {?Network.NetworkLogView.Filter} */ |
| 88 this._timeFilter = null; | 88 this._timeFilter = null; |
| 89 this._hoveredNode = null; | |
| 89 | 90 |
| 90 this._currentMatchedRequestNode = null; | 91 this._currentMatchedRequestNode = null; |
| 91 this._currentMatchedRequestIndex = -1; | 92 this._currentMatchedRequestIndex = -1; |
| 92 | 93 |
| 93 /** @type {!Components.Linkifier} */ | 94 /** @type {!Components.Linkifier} */ |
| 94 this.linkifier = new Components.Linkifier(); | 95 this.linkifier = new Components.Linkifier(); |
| 95 | 96 |
| 96 this._recording = false; | 97 this._recording = false; |
| 97 this._preserveLog = false; | 98 this._preserveLog = false; |
| 98 | 99 |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 524 this._setHoveredNode(node, highlightInitiatorChain); | 525 this._setHoveredNode(node, highlightInitiatorChain); |
| 525 this._highlightInitiatorChain((highlightInitiatorChain && node) ? node.reque st() : null); | 526 this._highlightInitiatorChain((highlightInitiatorChain && node) ? node.reque st() : null); |
| 526 } | 527 } |
| 527 | 528 |
| 528 _dataGridMouseLeave() { | 529 _dataGridMouseLeave() { |
| 529 this._setHoveredNode(null); | 530 this._setHoveredNode(null); |
| 530 this._highlightInitiatorChain(null); | 531 this._highlightInitiatorChain(null); |
| 531 } | 532 } |
| 532 | 533 |
| 533 /** | 534 /** |
| 534 * @param {?SDK.NetworkRequest} request | 535 * @param {?Network.LogEntry} logEntry |
| 535 * @param {boolean} highlightInitiatorChain | 536 * @param {boolean} highlightInitiatorChain |
| 536 */ | 537 */ |
| 537 setHoveredRequest(request, highlightInitiatorChain) { | 538 setHoveredLogEntry(logEntry, highlightInitiatorChain) { |
| 538 this._setHoveredNode(request ? this._nodesByRequestId.get(request.requestId) : null, highlightInitiatorChain); | 539 // TODO(allada) Move this into LogEntry/NetworkDataGridNode. |
| 539 this._highlightInitiatorChain((request && highlightInitiatorChain) ? request : null); | 540 this._setHoveredNode(/** @type {?Network.NetworkDataGridNode} */ (logEntry), highlightInitiatorChain); |
| 541 this._highlightInitiatorChain((logEntry && highlightInitiatorChain) ? logEnt ry.request() : null); | |
| 540 } | 542 } |
| 541 | 543 |
| 542 /** | 544 /** |
| 543 * @param {?Network.NetworkDataGridNode} node | 545 * @param {?Network.NetworkDataGridNode} node |
| 544 * @param {boolean=} highlightInitiatorChain | 546 * @param {boolean=} highlightInitiatorChain |
| 545 */ | 547 */ |
| 546 _setHoveredNode(node, highlightInitiatorChain) { | 548 _setHoveredNode(node, highlightInitiatorChain) { |
| 547 if (this._hoveredNode) | 549 if (this._hoveredNode) |
| 548 this._hoveredNode.element().classList.remove('hover'); | 550 this._hoveredNode.element().classList.remove('hover'); |
| 549 this._hoveredNode = node; | 551 this._hoveredNode = node; |
| 550 if (this._hoveredNode) | 552 if (this._hoveredNode) |
| 551 this._hoveredNode.element().classList.add('hover'); | 553 this._hoveredNode.element().classList.add('hover'); |
| 552 this._columns.setHoveredRequest(this._hoveredNode ? this._hoveredNode.reques t() : null, !!highlightInitiatorChain); | 554 this._columns.setHoveredLogEntry(this._hoveredNode, !!highlightInitiatorChai n); |
| 553 } | 555 } |
| 554 | 556 |
| 555 /** | 557 /** |
| 556 * @param {!Event} event | 558 * @param {!Event} event |
| 557 */ | 559 */ |
| 558 _dataGridMouseDown(event) { | 560 _dataGridMouseDown(event) { |
| 559 if ((!this._dataGrid.selectedNode && event.button) || event.target.enclosing NodeOrSelfWithNodeName('a')) | 561 if ((!this._dataGrid.selectedNode && event.button) || event.target.enclosing NodeOrSelfWithNodeName('a')) |
| 560 event.consume(); | 562 event.consume(); |
| 561 } | 563 } |
| 562 | 564 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 771 this._columns.wasShown(); | 773 this._columns.wasShown(); |
| 772 } | 774 } |
| 773 | 775 |
| 774 /** | 776 /** |
| 775 * @override | 777 * @override |
| 776 */ | 778 */ |
| 777 willHide() { | 779 willHide() { |
| 778 this._columns.willHide(); | 780 this._columns.willHide(); |
| 779 } | 781 } |
| 780 | 782 |
| 783 /** | |
| 784 * @return {!Network.LogEntry} | |
|
dgozman
2016/11/21 23:31:27
Incorrect annotation.
allada
2016/11/22 00:00:21
Done.
| |
| 785 */ | |
| 786 nodesList() { | |
|
dgozman
2016/11/21 23:31:27
flatNodesList to have the same name everywhere?
allada
2016/11/22 00:00:21
Done.
| |
| 787 return this._dataGrid.flatNodesList(); | |
| 788 } | |
| 789 | |
| 781 _refresh() { | 790 _refresh() { |
| 782 this._needsRefresh = false; | 791 this._needsRefresh = false; |
| 783 | 792 |
| 784 if (this._refreshRequestId) { | 793 if (this._refreshRequestId) { |
| 785 this.element.window().cancelAnimationFrame(this._refreshRequestId); | 794 this.element.window().cancelAnimationFrame(this._refreshRequestId); |
| 786 delete this._refreshRequestId; | 795 delete this._refreshRequestId; |
| 787 } | 796 } |
| 788 | 797 |
| 789 this.removeAllNodeHighlights(); | 798 this.removeAllNodeHighlights(); |
| 790 | 799 |
| (...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1705 Running: 'running', | 1714 Running: 'running', |
| 1706 FromCache: 'from-cache' | 1715 FromCache: 'from-cache' |
| 1707 }; | 1716 }; |
| 1708 | 1717 |
| 1709 /** @type {!Array<string>} */ | 1718 /** @type {!Array<string>} */ |
| 1710 Network.NetworkLogView._searchKeys = | 1719 Network.NetworkLogView._searchKeys = |
| 1711 Object.keys(Network.NetworkLogView.FilterType).map(key => Network.NetworkLog View.FilterType[key]); | 1720 Object.keys(Network.NetworkLogView.FilterType).map(key => Network.NetworkLog View.FilterType[key]); |
| 1712 | 1721 |
| 1713 /** @typedef {function(!SDK.NetworkRequest): boolean} */ | 1722 /** @typedef {function(!SDK.NetworkRequest): boolean} */ |
| 1714 Network.NetworkLogView.Filter; | 1723 Network.NetworkLogView.Filter; |
| OLD | NEW |