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

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

Issue 1842323002: [DevTools] Fix stale requests in Network panel not being refreshed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 955
956 var oldBoundary = this.calculator().boundary(); 956 var oldBoundary = this.calculator().boundary();
957 this._timeCalculator.updateBoundariesForEventTime(this._mainRequestLoadT ime); 957 this._timeCalculator.updateBoundariesForEventTime(this._mainRequestLoadT ime);
958 this._durationCalculator.updateBoundariesForEventTime(this._mainRequestL oadTime); 958 this._durationCalculator.updateBoundariesForEventTime(this._mainRequestL oadTime);
959 this._timeCalculator.updateBoundariesForEventTime(this._mainRequestDOMCo ntentLoadedTime); 959 this._timeCalculator.updateBoundariesForEventTime(this._mainRequestDOMCo ntentLoadedTime);
960 this._durationCalculator.updateBoundariesForEventTime(this._mainRequestD OMContentLoadedTime); 960 this._durationCalculator.updateBoundariesForEventTime(this._mainRequestD OMContentLoadedTime);
961 961
962 var dataGrid = this._dataGrid; 962 var dataGrid = this._dataGrid;
963 var rootNode = dataGrid.rootNode(); 963 var rootNode = dataGrid.rootNode();
964 var nodesToInsert = []; 964 var nodesToInsert = [];
965 var nodesToRefresh = [];
pfeldman 2016/04/01 17:47:13 You should annotate this array as !Array<WebInspec
Matt Zeunert 2016/04/01 18:47:06 Done.
965 for (var requestId in this._staleRequestIds) { 966 for (var requestId in this._staleRequestIds) {
966 var node = this._nodesByRequestId.get(requestId); 967 var node = this._nodesByRequestId.get(requestId);
967 if (!node) 968 if (!node)
968 continue; 969 continue;
969 var isFilteredOut = !this._applyFilter(node); 970 var isFilteredOut = !this._applyFilter(node);
970 if (node[WebInspector.NetworkLogView._isFilteredOutSymbol] !== isFil teredOut) { 971 if (node[WebInspector.NetworkLogView._isFilteredOutSymbol] !== isFil teredOut) {
971 if (!node[WebInspector.NetworkLogView._isFilteredOutSymbol]) 972 if (!node[WebInspector.NetworkLogView._isFilteredOutSymbol])
972 rootNode.removeChild(node); 973 rootNode.removeChild(node);
973 974
974 node[WebInspector.NetworkLogView._isFilteredOutSymbol] = isFilte redOut; 975 node[WebInspector.NetworkLogView._isFilteredOutSymbol] = isFilte redOut;
975 976
976 if (!node[WebInspector.NetworkLogView._isFilteredOutSymbol]) 977 if (!node[WebInspector.NetworkLogView._isFilteredOutSymbol])
977 nodesToInsert.push(node); 978 nodesToInsert.push(node);
978 } 979 }
980 if (!isFilteredOut) {
pfeldman 2016/04/01 17:47:13 This should be in the else branch - otherwise you
Matt Zeunert 2016/04/01 18:47:06 I removed the refresh call from inside the nodesTo
981 nodesToRefresh.push(node);
982 }
979 var request = node.request(); 983 var request = node.request();
980 this._timeCalculator.updateBoundaries(request); 984 this._timeCalculator.updateBoundaries(request);
981 this._durationCalculator.updateBoundaries(request); 985 this._durationCalculator.updateBoundaries(request);
982 } 986 }
983 987
984 for (var i = 0; i < nodesToInsert.length; ++i) { 988 for (var i = 0; i < nodesToInsert.length; ++i) {
985 var node = nodesToInsert[i]; 989 var node = nodesToInsert[i];
986 var request = node.request(); 990 var request = node.request();
987 dataGrid.insertChild(node); 991 dataGrid.insertChild(node);
992 node[WebInspector.NetworkLogView._isMatchingSearchQuerySymbol] = thi s._matchRequest(request);
993 }
994
995 for (var i = 0; i < nodesToRefresh.length; ++i) {
996 var node = nodesToRefresh[i];
988 node.refresh(); 997 node.refresh();
pfeldman 2016/04/01 17:47:13 We are now using "for of" for non performance crit
Matt Zeunert 2016/04/01 18:47:06 Done.
989 node[WebInspector.NetworkLogView._isMatchingSearchQuerySymbol] = thi s._matchRequest(request);
990 } 998 }
991 999
992 this._highlightNthMatchedRequestForSearch(this._updateMatchCountAndFindM atchIndex(this._currentMatchedRequestNode), false); 1000 this._highlightNthMatchedRequestForSearch(this._updateMatchCountAndFindM atchIndex(this._currentMatchedRequestNode), false);
993 1001
994 if (!this.calculator().boundary().equals(oldBoundary)) { 1002 if (!this.calculator().boundary().equals(oldBoundary)) {
995 // The boundaries changed, so all item graphs are stale. 1003 // The boundaries changed, so all item graphs are stale.
996 this._updateDividersIfNeeded(); 1004 this._updateDividersIfNeeded();
997 var nodes = this._nodesByRequestId.valuesArray(); 1005 var nodes = this._nodesByRequestId.valuesArray();
998 for (var i = 0; i < nodes.length; ++i) 1006 for (var i = 0; i < nodes.length; ++i)
999 nodes[i].refreshGraph(); 1007 nodes[i].refreshGraph();
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
2166 return false; 2174 return false;
2167 return true; 2175 return true;
2168 } 2176 }
2169 2177
2170 WebInspector.NetworkLogView.EventTypes = { 2178 WebInspector.NetworkLogView.EventTypes = {
2171 RequestSelected: "RequestSelected", 2179 RequestSelected: "RequestSelected",
2172 SearchCountUpdated: "SearchCountUpdated", 2180 SearchCountUpdated: "SearchCountUpdated",
2173 SearchIndexUpdated: "SearchIndexUpdated", 2181 SearchIndexUpdated: "SearchIndexUpdated",
2174 UpdateRequest: "UpdateRequest" 2182 UpdateRequest: "UpdateRequest"
2175 }; 2183 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698