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

Unified Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.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 | « no previous file | third_party/WebKit/Source/devtools/front_end/network/NetworkLogViewColumns.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
index d29d4c6317fade0ef6ce7d885759d6ac3bc2a208..d63772c32e1480fa436f183363f36a6c961aa10e 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
@@ -351,8 +351,9 @@ WebInspector.NetworkLogView.prototype = {
_dataGridMouseMove: function(event)
{
var node = this._dataGrid.dataGridNodeFromNode(event.target);
- this._setHoveredNode(node);
- this._highlightInitiatorChain((event.shiftKey && node) ? node.request() : null);
+ var highlightInitiatorChain = event.shiftKey;
+ this._setHoveredNode(node, highlightInitiatorChain);
+ this._highlightInitiatorChain((highlightInitiatorChain && node) ? node.request() : null);
},
_dataGridMouseLeave: function()
@@ -363,23 +364,26 @@ WebInspector.NetworkLogView.prototype = {
/**
* @param {?WebInspector.NetworkRequest} request
+ * @param {boolean} highlightInitiatorChain
*/
- setHoveredRequest: function(request)
+ setHoveredRequest: function(request, highlightInitiatorChain)
{
- this._setHoveredNode(request ? this._nodesByRequestId.get(request.requestId) : null);
+ this._setHoveredNode(request ? this._nodesByRequestId.get(request.requestId) : null, highlightInitiatorChain);
+ this._highlightInitiatorChain((request && highlightInitiatorChain) ? request : null);
},
/**
* @param {?WebInspector.NetworkDataGridNode} node
+ * @param {boolean=} highlightInitiatorChain
*/
- _setHoveredNode: function(node)
+ _setHoveredNode: function(node, highlightInitiatorChain)
{
if (this._hoveredNode)
this._hoveredNode.element().classList.remove("hover");
this._hoveredNode = node;
if (this._hoveredNode)
this._hoveredNode.element().classList.add("hover");
- this._columns.setHoveredRequest(this._hoveredNode ? this._hoveredNode.request() : null);
+ this._columns.setHoveredRequest(this._hoveredNode ? this._hoveredNode.request() : null, !!highlightInitiatorChain);
},
/**
@@ -409,21 +413,12 @@ WebInspector.NetworkLogView.prototype = {
return;
}
- var initiators = request.initiatorChain();
- var initiated = new Set();
+ var initiatorGraph = request.initiatorGraph();
for (var node of this._nodesByRequestId.values()) {
if (!node.dataGrid)
continue;
- var localInitiators = node.request().initiatorChain();
- if (localInitiators.has(request))
- initiated.add(node.request());
- }
-
- for (var node of this._nodesByRequestId.values()) {
- if (!node.dataGrid)
- continue;
- node.element().classList.toggle("network-node-on-initiator-path", node.request() !== request && initiators.has(node.request()));
- node.element().classList.toggle("network-node-on-initiated-path", node.request() !== request && initiated.has(node.request()));
+ node.element().classList.toggle("network-node-on-initiator-path", node.request() !== request && initiatorGraph.initiators.has(node.request()));
+ node.element().classList.toggle("network-node-on-initiated-path", node.request() !== request && initiatorGraph.initiated.has(node.request()));
}
},
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/network/NetworkLogViewColumns.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698