Web Inspector: debuggerPresentatioModel.linkifyLocation leaks updateAnchor closure...
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Oct 2011 11:41:07 +0000 (11:41 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Oct 2011 11:41:07 +0000 (11:41 +0000)
commit8f3a3ce29739a61463fd5b6bc749c0d911cb1a5e
treea50027804ab2f0f3ce7bdfe457f77e64564998ac
parent7a186475cdb12691cf1b338c53eaed4782423a2d
Web Inspector: debuggerPresentatioModel.linkifyLocation leaks updateAnchor closure instances.
https://bugs.webkit.org/show_bug.cgi?id=69146

In many places we use linkifyLocation function to produce a link node which updates automatically when the source file is changed on the fly.
Such changes happen when we use pretty print or another operation that changes the source code somehow.
linkifyLocation associates a new instance of updateAnchor closure with the each link node and add the closure to the SourceMappingUpdated event's list.
As the result the node<->closure pairs wouldn't be collected until reset the UI and DebuggerPresentationModel.

Reviewed by Pavel Feldman.

Source/WebCore:

Test: inspector/debugger/linkifier.html

* inspector/front-end/ConsoleMessage.js:
(WebInspector.ConsoleMessageImpl):
(WebInspector.ConsoleMessageImpl.prototype._linkifyLocation):
* inspector/front-end/ConsoleView.js:
(WebInspector.ConsoleView.prototype._consoleCleared):
(WebInspector.ConsoleCommandResult):
(WebInspector.ConsoleMessage.create):
(WebInspector.ConsoleMessage.createTextMessage):
* inspector/front-end/DebuggerPresentationModel.js:
(WebInspector.DebuggerPresentationModel.prototype.createLinkifier):
(WebInspector.DebuggerPresentationModel.Linkifier):
(WebInspector.DebuggerPresentationModel.Linkifier.prototype.linkifyLocation):
(WebInspector.DebuggerPresentationModel.Linkifier.prototype.reset):
(WebInspector.DebuggerPresentationModel.Linkifier.prototype._updateSourceAnchors):
(WebInspector.DebuggerPresentationModel.Linkifier.prototype._updateAnchor):
* inspector/front-end/EventListenersSidebarPane.js:
(WebInspector.EventListenersSidebarPane.prototype.update.callback):
(WebInspector.EventListenersSidebarPane.prototype.update):
():
* inspector/front-end/NetworkPanel.js:
(WebInspector.NetworkLogView):
(WebInspector.NetworkLogView.prototype._reset):
(WebInspector.NetworkDataGridNode.prototype._refreshInitiatorCell):
* inspector/front-end/ProfileDataGridTree.js:
(WebInspector.ProfileDataGridNode.prototype.createCell):
* inspector/front-end/ProfileView.js:
(WebInspector.CPUProfileView):
(WebInspector.CPUProfileView.prototype._resetClicked):
* inspector/front-end/TimelinePanel.js:
(WebInspector.TimelinePanel):
(WebInspector.TimelinePanel.prototype._linkifyLocation):
(WebInspector.TimelinePanel.prototype._linkifyCallFrame):
(WebInspector.TimelinePanel.prototype._clearPanel):
(WebInspector.TimelinePanel.FormattedRecord):
(WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent):
(WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails):
(WebInspector.TimelinePanel.PopupContentHelper):
(WebInspector.TimelinePanel.PopupContentHelper.prototype._appendLinkRow):
(WebInspector.TimelinePanel.PopupContentHelper.prototype._appendStackTrace):
* inspector/front-end/inspector.js:

LayoutTests:

* inspector/debugger/linkifier-expected.txt: Added.
* inspector/debugger/linkifier.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@96694 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/debugger/linkifier-expected.txt [new file with mode: 0644]
LayoutTests/inspector/debugger/linkifier.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/ConsoleMessage.js
Source/WebCore/inspector/front-end/ConsoleView.js
Source/WebCore/inspector/front-end/DebuggerPresentationModel.js
Source/WebCore/inspector/front-end/EventListenersSidebarPane.js
Source/WebCore/inspector/front-end/NetworkPanel.js
Source/WebCore/inspector/front-end/ProfileDataGridTree.js
Source/WebCore/inspector/front-end/ProfileView.js
Source/WebCore/inspector/front-end/TimelinePanel.js
Source/WebCore/inspector/front-end/inspector.js