Closed Bug 1648022 Opened 1 year ago Closed 1 year ago

Resources aren't unwatched on target destruction


(DevTools :: Framework, defect, P1)



(firefox79 fixed)

Firefox 79
Tracking Status
firefox79 --- fixed


(Reporter: nchevobbe, Assigned: nchevobbe)



(Whiteboard: dt-fission-m2-mvp)


(1 file, 2 obsolete files)

In browsingContext's destroy function ( devtools/server/actors/targets/browsing-context.js#600,604-606 ), we're calling unwatchTargetResources, using this._resourceWatchers.keys() to get the resources to be unwatched.
The issue is that we never populate this._resourceWatchers (, so we pass an empty array, and as a result we don't call the destroy method of the watcher, which might lead to a leak.

This removes the unpopulated _resourceWatchers attributes from
the browsing context, and instead uses a new function on the
Resource module (unwatchAllTargetResources)

getActor (which is called by DevToolsServer.searchAllConnectionsForActor) wasn't
returning self-managed actors.
In this patch we're adding a new findInPools method to DevToolsServerConnection
which allows to loop through the pools. We then use it to search for self-managed
actors in getActor.

Depends on D79983

Pushed by
Unwatch resources on target destruction. r=ochameau.
Blocks: 1648458

Comment on attachment 9159195 [details]
Bug 1648022 - Search for self-managed pools in DevToolsServerConnection.getActor. r=ochameau.

Revision D81033 was moved to bug 1648458. Setting attachment 9159195 [details] to obsolete.

Attachment #9159195 - Attachment is obsolete: true

Comment on attachment 9159197 [details]
Bug 1648022 - Add a test to assert resource watcher destruction when associated target actor is destroyed. r=ochameau.

Revision D81034 was moved to bug 1648458. Setting attachment 9159197 [details] to obsolete.

Attachment #9159197 - Attachment is obsolete: true
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 79
You need to log in before you can comment on or make changes to this bug.