Open Bug 1467565 Opened 2 years ago Updated 1 year ago

Replace `actorPrefix` with `typeName` in actors

Categories

(DevTools :: General, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: jryans, Unassigned)

References

(Blocks 2 open bugs)

Details

At the moment, we have two different fields that might be used in an actor to control the actor's name:

* actorPrefix
* typeName

`actorPrefix` is typically used by older (pre-p.js) actors, while `typeName` is typically used by p.js actors.

However, we always check[1] for both no matter the style of actor.  Since we no longer have add-ons to worry about, we can replace `actorPrefix` with `typeName` throughout the code base now without waiting for other p.js conversion tasks for each actor.

[1]: https://searchfox.org/mozilla-central/rev/cf464eabfeba64e866c1fa36b9fefd674dca9c51/devtools/server/actors/common.js#234
Product: Firefox → DevTools

(In reply to J. Ryan Stinnett [:jryans] from comment #0)

However, we always check[1] for both no matter the style of actor. Since we
no longer have add-ons to worry about, we can replace actorPrefix with
typeName throughout the code base now without waiting for other p.js
conversion tasks for each actor.

This action item is still relevant, we still uses actorPrefix here and there.
Replacing actorPrefix with typeName is simple:
https://searchfox.org/mozilla-central/search?q=actorPrefix&case=false&regexp=false&path=

But this will highlight the few actors that aren't converted to protocol js.

  • Like LongStringActor, which is only used by the console actor:
    https://searchfox.org/mozilla-central/source/devtools/server/actors/webconsole.js#17-19
    There is a bug to convert it to protocol.js, bug 1451019.
  • PauseActor. I'm not 100% sure it is an actor? Does it break anything if we remove the prefix?
  • ChromeDebuggerActor inherits from ThreadActor, which recently switch to protocol.js. So we can probably override typeName instead of actorPrefix.
  • then there is all the tests which are using old fashion actor instead of protocol.js, we should probably refactor them at some point...
You need to log in before you can comment on or make changes to this bug.