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

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

Issue 2436953003: [Devtools] Highlight navigation request in network timeline exp (Closed)
Patch Set: [Devtools] Highlight navigation request in network timeline exp 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
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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 function requestHovered(event) 322 function requestHovered(event)
323 { 323 {
324 var request = /** @type {?WebInspector.NetworkRequest} */ (event.dat a); 324 var request = /** @type {?WebInspector.NetworkRequest} */ (event.dat a);
325 var node = request ? this._nodesByRequestId.get(request.requestId) : null; 325 var node = request ? this._nodesByRequestId.get(request.requestId) : null;
326 this._setHoveredNode(node || null); 326 this._setHoveredNode(node || null);
327 } 327 }
328 }, 328 },
329 329
330 _redrawTimelineColumn: function() 330 _redrawTimelineColumn: function()
331 { 331 {
332 if (this._timelineRequestsAreStale) 332 if (!this._timelineRequestsAreStale) {
333 this._timelineColumn.setRequests(this._getOrderedRequests()); 333 this._timelineColumn.draw();
334 return;
335 }
336
337 var currentNode = this._dataGrid.rootNode();
338 var requestData = [];
339 var navigationRequest = null;
340 while (currentNode = currentNode.traverseNextNode(true)) {
341 if (currentNode.isNavigationRequest())
342 navigationRequest = currentNode.request();
343 requestData.push(currentNode.request());
344 }
345 this._timelineColumn.setRequests(requestData, navigationRequest);
334 this._timelineColumn.draw(); 346 this._timelineColumn.draw();
335 }, 347 },
336 348
337 _showRecordingHint: function() 349 _showRecordingHint: function()
338 { 350 {
339 this._hideRecordingHint(); 351 this._hideRecordingHint();
340 this._recordingHint = this.element.createChild("div", "network-status-pa ne fill"); 352 this._recordingHint = this.element.createChild("div", "network-status-pa ne fill");
341 var hintText = this._recordingHint.createChild("div", "recording-hint"); 353 var hintText = this._recordingHint.createChild("div", "recording-hint");
342 var reloadShortcutNode = this._recordingHint.createChild("b"); 354 var reloadShortcutNode = this._recordingHint.createChild("b");
343 reloadShortcutNode.textContent = WebInspector.shortcutRegistry.shortcutD escriptorsForAction("main.reload")[0].name; 355 reloadShortcutNode.textContent = WebInspector.shortcutRegistry.shortcutD escriptorsForAction("main.reload")[0].name;
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 nodes[i].refreshGraph(); 734 nodes[i].refreshGraph();
723 } 735 }
724 736
725 this._staleRequestIds = {}; 737 this._staleRequestIds = {};
726 this._updateSummaryBar(); 738 this._updateSummaryBar();
727 739
728 if (Runtime.experiments.isEnabled("canvasNetworkTimeline")) 740 if (Runtime.experiments.isEnabled("canvasNetworkTimeline"))
729 this._timelineRequestsAreStale = true; 741 this._timelineRequestsAreStale = true;
730 }, 742 },
731 743
732 _getOrderedRequests: function()
733 {
734 var currentNode = this._dataGrid.rootNode();
735 var requestData = [];
736 while (currentNode = currentNode.traverseNextNode(true))
737 requestData.push(currentNode.request());
738 return requestData;
739 },
740
741 reset: function() 744 reset: function()
742 { 745 {
743 this._requestWithHighlightedInitiators = null; 746 this._requestWithHighlightedInitiators = null;
744 this.dispatchEventToListeners(WebInspector.NetworkLogView.Events.Request Selected, null); 747 this.dispatchEventToListeners(WebInspector.NetworkLogView.Events.Request Selected, null);
745 748
746 this._clearSearchMatchedList(); 749 this._clearSearchMatchedList();
747 750
748 this._columns.reset(); 751 this._columns.reset();
749 752
750 this._hoveredNode = null; 753 this._hoveredNode = null;
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1892 * @return {boolean} 1895 * @return {boolean}
1893 */ 1896 */
1894 WebInspector.NetworkLogView._requestTimeFilter = function(windowStart, windowEnd , request) 1897 WebInspector.NetworkLogView._requestTimeFilter = function(windowStart, windowEnd , request)
1895 { 1898 {
1896 if (request.issueTime() > windowEnd) 1899 if (request.issueTime() > windowEnd)
1897 return false; 1900 return false;
1898 if (request.endTime !== -1 && request.endTime < windowStart) 1901 if (request.endTime !== -1 && request.endTime < windowStart)
1899 return false; 1902 return false;
1900 return true; 1903 return true;
1901 } 1904 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698