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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js
index 6f8ebed1968055259cff3564f319fb1e41fb6ecb..0220ac00f89c86d868f72e2177e16050c881e22d 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js
@@ -129,6 +129,9 @@ WebInspector.NetworkRequest.WebSocketFrame;
/** @typedef {!{time: number, eventName: string, eventId: string, data: string}} */
WebInspector.NetworkRequest.EventSourceMessage;
+/** @typedef {!{initiators: !Set<!WebInspector.NetworkRequest>, initiated: !Set<!WebInspector.NetworkRequest>}} */
+WebInspector.NetworkRequest.InitiatorGraph;
+
WebInspector.NetworkRequest.prototype = {
/**
* @param {!WebInspector.NetworkRequest} other
@@ -1173,19 +1176,34 @@ WebInspector.NetworkRequest.prototype = {
},
/**
+ * @return {!WebInspector.NetworkRequest.InitiatorGraph}
+ */
+ initiatorGraph: function()
+ {
+ var initiated = new Set();
+ var requests = this._networkLog.requests();
+ for (var request of requests) {
+ var localInitiators = request._initiatorChain();
+ if (localInitiators.has(this))
+ initiated.add(request);
+ }
+ return {initiators: this._initiatorChain(), initiated: initiated};
+ },
+
+ /**
* @return {!Set<!WebInspector.NetworkRequest>}
*/
- initiatorChain: function()
+ _initiatorChain: function()
{
- if (this._initiatorChain)
- return this._initiatorChain;
- this._initiatorChain = new Set();
+ if (this._initiatorChainCache)
+ return this._initiatorChainCache;
+ this._initiatorChainCache = new Set();
var request = this;
while (request) {
- this._initiatorChain.add(request);
+ this._initiatorChainCache.add(request);
request = request.initiatorRequest();
}
- return this._initiatorChain;
+ return this._initiatorChainCache;
},
/**
« 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