Open Bug 1717815 Opened 4 years ago Updated 1 month ago

Simplify ThreadActor management of Frames

Categories

(DevTools :: Debugger, task, P3)

task

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned)

References

(Blocks 1 open bug)

Details

Follow up from the discussion at https://phabricator.services.mozilla.com/D118471#inline-655997

Currently, the ThreadActor holds Frame actors in several maps/objects:

  • framesPool a typical pool holding "live" frame actors
  • frameActors an array of "live" frame actors, updated more or less in sync with framesPool
  • _frameActorMap WeakMap of frame -> FrameActor that holds each and every FrameActor created by the ThreadActor

We should simplify this and try to reduce the duplicated maps/pools/arrays storing identical information.

Note that _frameActorMap is a weakMap but it's probably buggy. The key is a frame and the value is a FrameActor. However the FrameActor has frame as a property. This should create a circular reference which means that this WeakMap is probably never ever shrinking and is just accumulating FrameActors forever.
Edit: WeakMap should support circular references fine, and this shouldn't prevent garbage collection

Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.