OLD | NEW |
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 Loading... |
93 /** @type {!Components.Linkifier} */ | 93 /** @type {!Components.Linkifier} */ |
94 this.linkifier = new Components.Linkifier(); | 94 this.linkifier = new Components.Linkifier(); |
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.FrameGrouper(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()); |
| 125 } |
| 126 |
| 127 _updateGroupByFrame() { |
| 128 var value = Common.moduleSetting('network.group-by-frame').get(); |
| 129 this.contentElement.classList.toggle('network-group-by-frame', value); |
| 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 Loading... |
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
; |
358 } | |
359 | |
360 /** | |
361 * @param {string} groupKey | |
362 */ | |
363 setGrouping(groupKey) { | |
364 var groupLookup = this._groupLookups.get(groupKey) || null; | |
365 this._activeGroupLookup = groupLookup; | 367 this._activeGroupLookup = groupLookup; |
366 if (!groupLookup) { | 368 if (!groupLookup) { |
367 this._invalidateAllItems(); | 369 this._invalidateAllItems(); |
368 return; | 370 return; |
369 } | 371 } |
370 groupLookup.initialize().then(() => { | 372 groupLookup.initialize().then(() => { |
371 if (this._activeGroupLookup !== groupLookup) | 373 if (this._activeGroupLookup !== groupLookup) |
372 return; | 374 return; |
373 this._activeGroupLookup.reset(); | 375 this._activeGroupLookup.reset(); |
374 this._invalidateAllItems(); | 376 this._invalidateAllItems(); |
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1831 initialize: function() {}, | 1833 initialize: function() {}, |
1832 | 1834 |
1833 /** | 1835 /** |
1834 * @param {!SDK.NetworkRequest} request | 1836 * @param {!SDK.NetworkRequest} request |
1835 * @return {?Network.NetworkGroupNode} | 1837 * @return {?Network.NetworkGroupNode} |
1836 */ | 1838 */ |
1837 groupNodeForRequest: function(request) {}, | 1839 groupNodeForRequest: function(request) {}, |
1838 | 1840 |
1839 reset: function() {} | 1841 reset: function() {} |
1840 }; | 1842 }; |
OLD | NEW |