Closed Bug 1623283 Opened 4 years ago Closed 4 years ago

Rename Pool#actor method

Categories

(DevTools :: Framework, task, P3)

task

Tracking

(firefox80 fixed)

RESOLVED FIXED
Firefox 80
Tracking Status
firefox80 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

Attachments

(1 file)

I always have a hard time figuring out that actor is actually a method, as its name doesn't indicate.

We could rename it to make it more obvious what it does, especially when called from a class that extend Pool (i.e. Front and Actor)

  • getActor
  • getActorFromID
  • getActorInPool
  • getActorInPoolFromID
  • something better?

Yes please! getActorFromID or getActorByID sound good to me.

what about getChildByID ? this method can retrieve Fronts or Actors, so child might be more self-explanatory?

We should also remove Pool#get and switch callsite to the renamed method.

this work is revealing a couple of bugs, one of them around the EnvironmentFront (Bug 1649710), and the other one in the AccessibilityPanel/reps (need to be investigated)

Depends on: 1649710

We take this opportunity to remove Pool.get as well,
which was doing exactly the same thing as Pool.actor

This highlighted a couple issues in Reps:

  • LongString were relying on the isGrip function, which was only checking that
    the actor property was truthy. So it was matching LongStringFront which had
    the actor method. This is modified by using the isLongString helper instead.
  • The Object rep was building all the reps for the object properties, even in
    TINY mode, where the result was only used to check the length. In the Accessibility
    panel, it can happen that an plain object containing front properties is passed
    to Rep. It was fine before because this was short-circuited by the Accessor rep
    which was only checking the truthiness of a get property. With get being
    removed, the default Rep was used, which is Object, and we were hitting a
    recursion loop, as some of the properties of fronts are cycle references.
    There should be a fix in the Accessibility panel to not pass fronts, but we
    also "fix" it from here by simply not building sub-properties for the object
    when we're in TINY mode.
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/76b698ec608a
Rename Pool#actor into getActorByID. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 80
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: