Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @implements {Network.GroupLookupInterface} | 6 * @implements {Network.GroupLookupInterface} |
| 7 */ | 7 */ |
| 8 Network.NetworkFrameGrouper = class { | 8 Network.NetworkFrameGrouper = class { |
| 9 /** | 9 /** |
| 10 * @param {!Network.NetworkLogView} parentView | 10 * @param {!Network.NetworkLogView} parentView |
| 11 */ | 11 */ |
| 12 constructor(parentView) { | 12 constructor(parentView) { |
| 13 this._parentView = parentView; | 13 this._parentView = parentView; |
| 14 /** @type {!Map<!SDK.ResourceTreeFrame, !Network.FrameGroupNode>} */ | 14 this._frameGroupNodeSymbol = Symbol('FrameGroupNode'); |
|
allada
2017/06/08 21:24:25
I needed to change this because a frame may now go
| |
| 15 this._activeGroups = new Map(); | |
| 16 } | 15 } |
| 17 | 16 |
| 18 /** | 17 /** |
| 19 * @override | 18 * @override |
| 20 * @param {!SDK.NetworkRequest} request | 19 * @param {!SDK.NetworkRequest} request |
| 21 * @return {?Network.NetworkGroupNode} | 20 * @return {?Network.NetworkGroupNode} |
| 22 */ | 21 */ |
| 23 groupNodeForRequest(request) { | 22 groupNodeForRequest(request) { |
| 24 var frame = SDK.ResourceTreeModel.frameForRequest(request); | 23 var frame = SDK.ResourceTreeModel.frameForRequest(request); |
| 25 if (!frame || frame.isMainFrame()) | 24 if (!frame || frame.isMainFrame()) |
| 26 return null; | 25 return null; |
| 27 var groupNode = this._activeGroups.get(frame); | 26 var groupNode = frame[this._frameGroupNodeSymbol]; |
| 28 if (groupNode) | 27 if (groupNode) |
| 29 return groupNode; | 28 return groupNode; |
| 30 groupNode = new Network.FrameGroupNode(this._parentView, frame); | 29 groupNode = new Network.FrameGroupNode(this._parentView, frame); |
| 31 this._activeGroups.set(frame, groupNode); | 30 frame[this._frameGroupNodeSymbol] = groupNode; |
| 32 return groupNode; | 31 return groupNode; |
| 33 } | 32 } |
| 34 | |
| 35 /** | |
| 36 * @override | |
| 37 */ | |
| 38 reset() { | |
| 39 this._activeGroups.clear(); | |
| 40 } | |
| 41 }; | 33 }; |
| 42 | 34 |
| 43 Network.FrameGroupNode = class extends Network.NetworkGroupNode { | 35 Network.FrameGroupNode = class extends Network.NetworkGroupNode { |
| 44 /** | 36 /** |
| 45 * @param {!Network.NetworkLogView} parentView | 37 * @param {!Network.NetworkLogView} parentView |
| 46 * @param {!SDK.ResourceTreeFrame} frame | 38 * @param {!SDK.ResourceTreeFrame} frame |
| 47 */ | 39 */ |
| 48 constructor(parentView, frame) { | 40 constructor(parentView, frame) { |
| 49 super(parentView); | 41 super(parentView); |
| 50 this._frame = frame; | 42 this._frame = frame; |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 80 this._productBadge = this.parentView().badgePool.badgeForFrame(this._fra me); | 72 this._productBadge = this.parentView().badgePool.badgeForFrame(this._fra me); |
| 81 this._productBadge.classList.add('network-frame-group-badge'); | 73 this._productBadge.classList.add('network-frame-group-badge'); |
| 82 } | 74 } |
| 83 cell.appendChild(UI.Icon.create('largeicon-navigator-frame', 'network-fram e-group-icon')); | 75 cell.appendChild(UI.Icon.create('largeicon-navigator-frame', 'network-fram e-group-icon')); |
| 84 cell.appendChild(this._productBadge); | 76 cell.appendChild(this._productBadge); |
| 85 cell.createTextChild(name); | 77 cell.createTextChild(name); |
| 86 cell.title = name; | 78 cell.title = name; |
| 87 } | 79 } |
| 88 } | 80 } |
| 89 }; | 81 }; |
| OLD | NEW |