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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js

Issue 2470593002: [Devtools] New network canvas timeline now properly shows initiators (Closed)
Patch Set: changes 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js ('k') | 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 * @return {?WebInspector.NetworkRequest} 1166 * @return {?WebInspector.NetworkRequest}
1167 */ 1167 */
1168 initiatorRequest: function() 1168 initiatorRequest: function()
1169 { 1169 {
1170 if (this._initiatorRequest === undefined) 1170 if (this._initiatorRequest === undefined)
1171 this._initiatorRequest = this._networkLog.requestForURL(this.initiat orInfo().url); 1171 this._initiatorRequest = this._networkLog.requestForURL(this.initiat orInfo().url);
1172 return this._initiatorRequest; 1172 return this._initiatorRequest;
1173 }, 1173 },
1174 1174
1175 /** 1175 /**
1176 * @return {!{initiators: !Set<!WebInspector.NetworkRequest>, initiated: !Se t<!WebInspector.NetworkRequest>}}
dgozman 2016/11/01 01:31:15 Let's typedef this.
allada 2016/11/01 01:37:51 Done.
1177 */
1178 initiatorGraph: function()
1179 {
1180 var initiated = new Set();
1181 var requests = this._networkLog.requests();
1182 for (var request of requests) {
1183 var localInitiators = request._initiatorChain();
1184 if (localInitiators.has(this))
1185 initiated.add(request);
1186 }
1187 return {initiators: this._initiatorChain(), initiated: initiated};
1188 },
1189
1190 /**
1176 * @return {!Set<!WebInspector.NetworkRequest>} 1191 * @return {!Set<!WebInspector.NetworkRequest>}
1177 */ 1192 */
1178 initiatorChain: function() 1193 _initiatorChain: function()
1179 { 1194 {
1180 if (this._initiatorChain) 1195 if (this._initiatorChainCache)
1181 return this._initiatorChain; 1196 return this._initiatorChainCache;
1182 this._initiatorChain = new Set(); 1197 this._initiatorChainCache = new Set();
1183 var request = this; 1198 var request = this;
1184 while (request) { 1199 while (request) {
1185 this._initiatorChain.add(request); 1200 this._initiatorChainCache.add(request);
1186 request = request.initiatorRequest(); 1201 request = request.initiatorRequest();
1187 } 1202 }
1188 return this._initiatorChain; 1203 return this._initiatorChainCache;
1189 }, 1204 },
1190 1205
1191 /** 1206 /**
1192 * @return {!Array.<!WebInspector.NetworkRequest.WebSocketFrame>} 1207 * @return {!Array.<!WebInspector.NetworkRequest.WebSocketFrame>}
1193 */ 1208 */
1194 frames: function() 1209 frames: function()
1195 { 1210 {
1196 return this._frames; 1211 return this._frames;
1197 }, 1212 },
1198 1213
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 /** 1277 /**
1263 * @return {!WebInspector.NetworkManager} 1278 * @return {!WebInspector.NetworkManager}
1264 */ 1279 */
1265 networkManager: function() 1280 networkManager: function()
1266 { 1281 {
1267 return this._networkManager; 1282 return this._networkManager;
1268 }, 1283 },
1269 1284
1270 __proto__: WebInspector.SDKObject.prototype 1285 __proto__: WebInspector.SDKObject.prototype
1271 }; 1286 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698