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

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

Issue 2876983002: DevTools: group by frame, not product in the network panel. (Closed)
Patch Set: more code removed Created 3 years, 7 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
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 this.linkifier = new Components.Linkifier(); 93 this.linkifier = new Components.Linkifier();
94 this.badgePool = new ProductRegistry.BadgePool(); 94 this.badgePool = new ProductRegistry.BadgePool();
95 95
96 this._recording = false; 96 this._recording = false;
97 this._preserveLog = false; 97 this._preserveLog = false;
98 98
99 this._headerHeight = 0; 99 this._headerHeight = 0;
100 100
101 /** @type {!Map<string, !Network.GroupLookupInterface>} */ 101 /** @type {!Map<string, !Network.GroupLookupInterface>} */
102 this._groupLookups = new Map(); 102 this._groupLookups = new Map();
103 this._groupLookups.set('Frame', new Network.FrameGrouper(this)); 103 this._groupLookups.set('Frame', new Network.NetworkFrameGrouper(this));
104 104
105 /** @type {?Network.GroupLookupInterface} */ 105 /** @type {?Network.GroupLookupInterface} */
106 this._activeGroupLookup = null; 106 this._activeGroupLookup = null;
107 107
108 this._addFilters(); 108 this._addFilters();
109 this._resetSuggestionBuilder(); 109 this._resetSuggestionBuilder();
110 this._initializeView(); 110 this._initializeView();
111 111
112 Common.moduleSetting('networkColorCodeResourceTypes') 112 Common.moduleSetting('networkColorCodeResourceTypes')
113 .addChangeListener(this._invalidateAllItems.bind(this, false), this); 113 .addChangeListener(this._invalidateAllItems.bind(this, false), this);
114 114
115 SDK.targetManager.observeModels(SDK.NetworkManager, this); 115 SDK.targetManager.observeModels(SDK.NetworkManager, this);
116 SDK.targetManager.addModelListener( 116 SDK.targetManager.addModelListener(
117 SDK.NetworkManager, SDK.NetworkManager.Events.RequestStarted, this._onRe questStarted, this); 117 SDK.NetworkManager, SDK.NetworkManager.Events.RequestStarted, this._onRe questStarted, this);
118 SDK.targetManager.addModelListener( 118 SDK.targetManager.addModelListener(
119 SDK.NetworkManager, SDK.NetworkManager.Events.RequestUpdated, this._onRe questUpdated, this); 119 SDK.NetworkManager, SDK.NetworkManager.Events.RequestUpdated, this._onRe questUpdated, this);
120 SDK.targetManager.addModelListener( 120 SDK.targetManager.addModelListener(
121 SDK.NetworkManager, SDK.NetworkManager.Events.RequestFinished, this._onR equestUpdated, this); 121 SDK.NetworkManager, SDK.NetworkManager.Events.RequestFinished, this._onR equestUpdated, this);
122
123 this._updateGroupByFrame();
124 Common.moduleSetting('network.group-by-frame').addChangeListener(() => this. _updateGroupByFrame());
dgozman 2017/05/13 00:32:34 (..., this._updateGroupByFrame, this)
pfeldman 2017/05/15 14:53:02 I am now using these, because I think performance-
125 }
126
127 _updateGroupByFrame() {
128 var value = Common.moduleSetting('network.group-by-frame').get();
129 this.contentElement.classList.toggle('network-group-by-frame', value);
dgozman 2017/05/13 00:32:34 Is this class ever used?
pfeldman 2017/05/15 14:53:02 Done.
130 this._setGrouping(value ? 'Frame' : null);
122 } 131 }
123 132
124 /** 133 /**
125 * @param {!Network.NetworkLogView.Filter} filter 134 * @param {!Network.NetworkLogView.Filter} filter
126 * @param {!SDK.NetworkRequest} request 135 * @param {!SDK.NetworkRequest} request
127 * @return {boolean} 136 * @return {boolean}
128 */ 137 */
129 static _negativeFilter(filter, request) { 138 static _negativeFilter(filter, request) {
130 return !filter(request); 139 return !filter(request);
131 } 140 }
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 */ 353 */
345 static _requestTimeFilter(windowStart, windowEnd, request) { 354 static _requestTimeFilter(windowStart, windowEnd, request) {
346 if (request.issueTime() > windowEnd) 355 if (request.issueTime() > windowEnd)
347 return false; 356 return false;
348 if (request.endTime !== -1 && request.endTime < windowStart) 357 if (request.endTime !== -1 && request.endTime < windowStart)
349 return false; 358 return false;
350 return true; 359 return true;
351 } 360 }
352 361
353 /** 362 /**
354 * @return {!Map<string, !Network.GroupLookupInterface>} 363 * @param {?string} groupKey
355 */ 364 */
356 groupLookups() { 365 _setGrouping(groupKey) {
357 return this._groupLookups; 366 var groupLookup = groupKey ? this._groupLookups.get(groupKey) || null : null ;
367 this._activeGroupLookup = groupLookup;
368 if (groupLookup)
369 groupLookup.reset();
370 this._invalidateAllItems();
358 } 371 }
359 372
360 /** 373 /**
361 * @param {string} groupKey
362 */
363 setGrouping(groupKey) {
364 var groupLookup = this._groupLookups.get(groupKey) || null;
365 this._activeGroupLookup = groupLookup;
366 if (!groupLookup) {
367 this._invalidateAllItems();
368 return;
369 }
370 groupLookup.initialize().then(() => {
371 if (this._activeGroupLookup !== groupLookup)
372 return;
373 this._activeGroupLookup.reset();
374 this._invalidateAllItems();
375 });
376 }
377
378 /**
379 * @param {!SDK.NetworkRequest} request 374 * @param {!SDK.NetworkRequest} request
380 * @return {?Network.NetworkRequestNode} 375 * @return {?Network.NetworkRequestNode}
381 */ 376 */
382 nodeForRequest(request) { 377 nodeForRequest(request) {
383 return this._nodesByRequestId.get(request.requestId()); 378 return this._nodesByRequestId.get(request.requestId());
384 } 379 }
385 380
386 /** 381 /**
387 * @return {number} 382 * @return {number}
388 */ 383 */
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after
1817 /** @typedef {function(!SDK.NetworkRequest): boolean} */ 1812 /** @typedef {function(!SDK.NetworkRequest): boolean} */
1818 Network.NetworkLogView.Filter; 1813 Network.NetworkLogView.Filter;
1819 1814
1820 /** 1815 /**
1821 * @interface 1816 * @interface
1822 */ 1817 */
1823 Network.GroupLookupInterface = function() {}; 1818 Network.GroupLookupInterface = function() {};
1824 1819
1825 Network.GroupLookupInterface.prototype = { 1820 Network.GroupLookupInterface.prototype = {
1826 /** 1821 /**
1827 * @return {!Promise}
1828 */
1829 initialize: function() {},
1830
1831 /**
1832 * @param {!SDK.NetworkRequest} request 1822 * @param {!SDK.NetworkRequest} request
1833 * @return {?Network.NetworkGroupNode} 1823 * @return {?Network.NetworkGroupNode}
1834 */ 1824 */
1835 groupNodeForRequest: function(request) {}, 1825 groupNodeForRequest: function(request) {},
1836 1826
1837 reset: function() {} 1827 reset: function() {}
1838 }; 1828 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698