| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 this._recording = false; | 101 this._recording = false; |
| 102 this._preserveLog = false; | 102 this._preserveLog = false; |
| 103 | 103 |
| 104 this._headerHeight = 0; | 104 this._headerHeight = 0; |
| 105 | 105 |
| 106 this._addFilters(); | 106 this._addFilters(); |
| 107 this._resetSuggestionBuilder(); | 107 this._resetSuggestionBuilder(); |
| 108 this._initializeView(); | 108 this._initializeView(); |
| 109 | 109 |
| 110 Common.moduleSetting('networkColorCodeResourceTypes').addChangeListener(this
._invalidateAllItems, this); | 110 Common.moduleSetting('networkColorCodeResourceTypes') |
| 111 .addChangeListener(this._invalidateAllItems.bind(this, false), this); |
| 111 | 112 |
| 112 SDK.targetManager.observeTargets(this); | 113 SDK.targetManager.observeTargets(this); |
| 113 SDK.targetManager.addModelListener( | 114 SDK.targetManager.addModelListener( |
| 114 SDK.NetworkManager, SDK.NetworkManager.Events.RequestStarted, this._onRe
questStarted, this); | 115 SDK.NetworkManager, SDK.NetworkManager.Events.RequestStarted, this._onRe
questStarted, this); |
| 115 SDK.targetManager.addModelListener( | 116 SDK.targetManager.addModelListener( |
| 116 SDK.NetworkManager, SDK.NetworkManager.Events.RequestUpdated, this._onRe
questUpdated, this); | 117 SDK.NetworkManager, SDK.NetworkManager.Events.RequestUpdated, this._onRe
questUpdated, this); |
| 117 SDK.targetManager.addModelListener( | 118 SDK.targetManager.addModelListener( |
| 118 SDK.NetworkManager, SDK.NetworkManager.Events.RequestFinished, this._onR
equestUpdated, this); | 119 SDK.NetworkManager, SDK.NetworkManager.Events.RequestFinished, this._onR
equestUpdated, this); |
| 119 } | 120 } |
| 120 | 121 |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 /** | 526 /** |
| 526 * @override | 527 * @override |
| 527 * @return {!Array.<!Element>} | 528 * @return {!Array.<!Element>} |
| 528 */ | 529 */ |
| 529 elementsToRestoreScrollPositionsFor() { | 530 elementsToRestoreScrollPositionsFor() { |
| 530 if (!this._dataGrid) // Not initialized yet. | 531 if (!this._dataGrid) // Not initialized yet. |
| 531 return []; | 532 return []; |
| 532 return [this._dataGrid.scrollContainer]; | 533 return [this._dataGrid.scrollContainer]; |
| 533 } | 534 } |
| 534 | 535 |
| 536 columnExtensionResolved() { |
| 537 this._invalidateAllItems(true); |
| 538 } |
| 539 |
| 535 _setupDataGrid() { | 540 _setupDataGrid() { |
| 536 /** @type {!DataGrid.SortableDataGrid<!Network.NetworkNode>} */ | 541 /** @type {!DataGrid.SortableDataGrid<!Network.NetworkNode>} */ |
| 537 this._dataGrid = this._columns.dataGrid(); | 542 this._dataGrid = this._columns.dataGrid(); |
| 538 this._dataGrid.setRowContextMenuCallback((contextMenu, node) => { | 543 this._dataGrid.setRowContextMenuCallback((contextMenu, node) => { |
| 539 var request = node.request(); | 544 var request = node.request(); |
| 540 if (request) | 545 if (request) |
| 541 this.handleContextMenuForRequest(contextMenu, request); | 546 this.handleContextMenuForRequest(contextMenu, request); |
| 542 }); | 547 }); |
| 543 this._dataGrid.setStickToBottom(true); | 548 this._dataGrid.setStickToBottom(true); |
| 544 this._dataGrid.setName('networkLog'); | 549 this._dataGrid.setName('networkLog'); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 | 681 |
| 677 clearFilmStripFrame() { | 682 clearFilmStripFrame() { |
| 678 this._columns.clearFilmStripFrame(); | 683 this._columns.clearFilmStripFrame(); |
| 679 } | 684 } |
| 680 | 685 |
| 681 _refreshIfNeeded() { | 686 _refreshIfNeeded() { |
| 682 if (this._needsRefresh) | 687 if (this._needsRefresh) |
| 683 this._refresh(); | 688 this._refresh(); |
| 684 } | 689 } |
| 685 | 690 |
| 686 _invalidateAllItems() { | 691 /** |
| 692 * @param {boolean=} deferUpdate |
| 693 */ |
| 694 _invalidateAllItems(deferUpdate) { |
| 687 var requestIds = this._nodesByRequestId.keysArray(); | 695 var requestIds = this._nodesByRequestId.keysArray(); |
| 688 for (var i = 0; i < requestIds.length; ++i) | 696 for (var i = 0; i < requestIds.length; ++i) |
| 689 this._staleRequestIds[requestIds[i]] = true; | 697 this._staleRequestIds[requestIds[i]] = true; |
| 690 this._refresh(); | 698 if (deferUpdate) |
| 699 this.scheduleRefresh(); |
| 700 else |
| 701 this._refresh(); |
| 691 } | 702 } |
| 692 | 703 |
| 693 /** | 704 /** |
| 694 * @return {!Network.NetworkTimeCalculator} | 705 * @return {!Network.NetworkTimeCalculator} |
| 695 */ | 706 */ |
| 696 timeCalculator() { | 707 timeCalculator() { |
| 697 return this._timeCalculator; | 708 return this._timeCalculator; |
| 698 } | 709 } |
| 699 | 710 |
| 700 /** | 711 /** |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 return this._dataGrid.rootNode(); | 877 return this._dataGrid.rootNode(); |
| 867 | 878 |
| 868 var groupName = this._activeGroupLookup.lookup(node.request()); | 879 var groupName = this._activeGroupLookup.lookup(node.request()); |
| 869 if (!groupName) | 880 if (!groupName) |
| 870 return this._dataGrid.rootNode(); | 881 return this._dataGrid.rootNode(); |
| 871 | 882 |
| 872 var group = this._nodeGroups.get(groupName); | 883 var group = this._nodeGroups.get(groupName); |
| 873 if (group) | 884 if (group) |
| 874 return group; | 885 return group; |
| 875 group = new Network.NetworkGroupNode(this, groupName); | 886 group = new Network.NetworkGroupNode(this, groupName); |
| 887 group.setColumnExtensions(this._columns.columnExtensions()); |
| 876 this._nodeGroups.set(groupName, group); | 888 this._nodeGroups.set(groupName, group); |
| 877 return group; | 889 return group; |
| 878 } | 890 } |
| 879 | 891 |
| 880 reset() { | 892 reset() { |
| 881 this._requestWithHighlightedInitiators = null; | 893 this._requestWithHighlightedInitiators = null; |
| 882 this.dispatchEventToListeners(Network.NetworkLogView.Events.RequestSelected,
null); | 894 this.dispatchEventToListeners(Network.NetworkLogView.Events.RequestSelected,
null); |
| 883 | 895 |
| 884 this._clearSearchMatchedList(); | 896 this._clearSearchMatchedList(); |
| 885 | 897 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 927 return; | 939 return; |
| 928 var request = /** @type {!SDK.NetworkRequest} */ (event.data); | 940 var request = /** @type {!SDK.NetworkRequest} */ (event.data); |
| 929 this._appendRequest(request); | 941 this._appendRequest(request); |
| 930 } | 942 } |
| 931 | 943 |
| 932 /** | 944 /** |
| 933 * @param {!SDK.NetworkRequest} request | 945 * @param {!SDK.NetworkRequest} request |
| 934 */ | 946 */ |
| 935 _appendRequest(request) { | 947 _appendRequest(request) { |
| 936 var node = new Network.NetworkRequestNode(this, request); | 948 var node = new Network.NetworkRequestNode(this, request); |
| 949 node.setColumnExtensions(this._columns.columnExtensions()); |
| 937 node[Network.NetworkLogView._isFilteredOutSymbol] = true; | 950 node[Network.NetworkLogView._isFilteredOutSymbol] = true; |
| 938 node[Network.NetworkLogView._isMatchingSearchQuerySymbol] = false; | 951 node[Network.NetworkLogView._isMatchingSearchQuerySymbol] = false; |
| 939 | 952 |
| 940 // In case of redirect request id is reassigned to a redirected | 953 // In case of redirect request id is reassigned to a redirected |
| 941 // request and we need to update _nodesByRequestId and search results. | 954 // request and we need to update _nodesByRequestId and search results. |
| 942 var originalRequestNode = this._nodesByRequestId.get(request.requestId()); | 955 var originalRequestNode = this._nodesByRequestId.get(request.requestId()); |
| 943 if (originalRequestNode) | 956 if (originalRequestNode) |
| 944 this._nodesByRequestId.set(originalRequestNode.request().requestId(), orig
inalRequestNode); | 957 this._nodesByRequestId.set(originalRequestNode.request().requestId(), orig
inalRequestNode); |
| 945 this._nodesByRequestId.set(request.requestId(), node); | 958 this._nodesByRequestId.set(request.requestId(), node); |
| 946 | 959 |
| (...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1795 */ | 1808 */ |
| 1796 Network.NetworkGroupLookupInterface = function() {}; | 1809 Network.NetworkGroupLookupInterface = function() {}; |
| 1797 | 1810 |
| 1798 Network.NetworkGroupLookupInterface.prototype = { | 1811 Network.NetworkGroupLookupInterface.prototype = { |
| 1799 /** | 1812 /** |
| 1800 * @param {!SDK.NetworkRequest} request | 1813 * @param {!SDK.NetworkRequest} request |
| 1801 * @return {?string} | 1814 * @return {?string} |
| 1802 */ | 1815 */ |
| 1803 lookup(request) {} | 1816 lookup(request) {} |
| 1804 }; | 1817 }; |
| OLD | NEW |