Changeset 188679 in webkit
- Timestamp:
- Aug 19, 2015 9:09:14 PM (9 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r188678 r188679 1 2015-08-19 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: DOMTree leaks on main resource changes 4 https://bugs.webkit.org/show_bug.cgi?id=148158 5 6 Reviewed by Timothy Hatcher. 7 8 * UserInterface/Models/DOMTree.js: 9 (WebInspector.DOMTree.prototype.disconnect): 10 Add a way to disconnect the DOMTree and allow it to get garbage collected. 11 12 (WebInspector.DOMTree.prototype.invalidate.performInvalidate): 13 (WebInspector.DOMTree.prototype.invalidate): 14 (WebInspector.DOMTree.prototype._requestRootDOMNode): 15 (WebInspector.DOMTree.prototype._framePageExecutionContextChanged): 16 Remove some uses of the delete operator. 17 18 * UserInterface/Models/Frame.js: 19 (WebInspector.Frame.prototype.removeChildFrame): 20 (WebInspector.Frame.prototype.removeAllChildFrames): 21 (WebInspector.Frame.prototype._detachFromParentFrame): 22 When a frame gets removed from its parent, disconnect its DOMTree. 23 1 24 2015-08-19 Devin Rousso <drousso@apple.com> 2 25 -
trunk/Source/WebInspectorUI/UserInterface/Models/DOMTree.js
r185638 r188679 68 68 } 69 69 70 disconnect() 71 { 72 WebInspector.domTreeManager.removeEventListener(null, null, this); 73 this._frame.removeEventListener(null, null, this); 74 } 75 70 76 invalidate() 71 77 { … … 75 81 // Clear the pending callbacks. It is the responsibility of the client to listen for 76 82 // the RootDOMNodeInvalidated event and request the root DOM node again. 77 delete this._pendingRootDOMNodeRequests;83 this._pendingRootDOMNodeRequests = null; 78 84 79 85 if (this._invalidateTimeoutIdentifier) … … 82 88 function performInvalidate() 83 89 { 84 delete this._invalidateTimeoutIdentifier;90 this._invalidateTimeoutIdentifier = undefined; 85 91 86 92 this.dispatchEventToListeners(WebInspector.DOMTree.Event.RootDOMNodeInvalidated); … … 198 204 for (var i = 0; i < this._pendingRootDOMNodeRequests.length; ++i) 199 205 this._pendingRootDOMNodeRequests[i](this._rootDOMNode); 200 delete this._pendingRootDOMNodeRequests;206 this._pendingRootDOMNodeRequests = null; 201 207 } 202 208 … … 243 249 console.assert(this._pendingRootDOMNodeRequests && this._pendingRootDOMNodeRequests.length); 244 250 245 delete this._rootDOMNodeRequestWaitingForExecutionContext;251 this._rootDOMNodeRequestWaitingForExecutionContext = false; 246 252 247 253 this._requestRootDOMNode(); -
trunk/Source/WebInspectorUI/UserInterface/Models/Frame.js
r181769 r188679 332 332 delete this._childFrameIdentifierMap[childFrame._id]; 333 333 334 childFrame._ parentFrame = null;334 childFrame._detachFromParentFrame(); 335 335 336 336 this.dispatchEventToListeners(WebInspector.Frame.Event.ChildFrameWasRemoved, {childFrame}); … … 342 342 return; 343 343 344 for ( var i = 0; i < this._childFrames.length; ++i)345 this._childFrames[i]._parentFrame = null;344 for (let childFrame of this._childFrames) 345 childFrame._detachFromParentFrame(); 346 346 347 347 this._childFrames = []; … … 446 446 447 447 // Private 448 449 _detachFromParentFrame() 450 { 451 if (this._domTree) { 452 this._domTree.disconnect(); 453 this._domTree = null; 454 } 455 456 this._parentFrame = null; 457 } 448 458 449 459 _isProvisionalResource(resource)
Note: See TracChangeset
for help on using the changeset viewer.