Open Bug 1289193 Opened 4 years ago Updated 1 month ago

[meta] Convert remaining devtools actors to protocol.js

Categories

(DevTools :: General, enhancement, P5)

46 Branch
enhancement

Tracking

(Not tracked)

People

(Reporter: bgrins, Unassigned)

References

(Depends on 3 open bugs, Blocks 3 open bugs)

Details

(Keywords: meta)

This is a meta bug for converting the rest of the devtools actors to protocol.js
Summary: [meta] Convert remaining devtools actors to protocol.js → [meta-html] Convert remaining devtools actors to protocol.js
Severity: normal → enhancement
Summary: [meta-html] Convert remaining devtools actors to protocol.js → Convert remaining devtools actors to protocol.js
Whiteboard: [meta]
A quick overview of the last actors still not using protocol.js:
https://searchfox.org/mozilla-central/search?q=requestTypes&case=false&regexp=false&path=devtools%2Fserver%2Factors%2F

There is 3 big buckets.
Here is the list of all the actors, with information about which actor and method instanciate them:
* RootActor and the various TabActor sub classes it instanciates
  - RootActor

  - TabActor (never directly instanciated, only via sub-classes)
      ContentActor -> RootActor.getTab and RootActor.listTabs via BrowserTabActor.connect() and child.js
      ChromeActor -> RootActor.getProcess(0)
        WebExtensionChildActor -> (WebExtensionParentActor/webExtensionSpec).connect() via child.js
      WindowActor -> RootActor.getWindow()

  - BrowserAddonActor -> RootActor.listAddons
      AddonConsoleActor -> in BrowserAddonActor.form(), so during RootActor.listAddons

  - ChildProcessActor -> RootActor.getProcess via content-server.jsm

* ObjectActor and related
  - ObjectActor -> From most methods of PromisesActor and WebConsoleActor
      PausedScopedObjectActor -> From most methods of EnvironmentActor, FrameActor, SourceActor and ThreadActor
  - SymbolActor -> via createValueGrip, so similar to ObjectActor and PauseScopedObjectActor
  - LongStringActor -> via createValueGrip, so similar to ObjectActor and PauseScopedObjectActor
                    -> StyleSheetActor.getText, NodeActor.getNodeValue, Device.getWallpaper/screenshotToDataURL
                    -> From many methods of WebConsoleActor, StorageActors
                
  - PropertyIteratorActor -> ObjectActor.enumProperties/enumEntries
  - SymbolIteratorActor -> ObjectActor.enumSymbols

* Various ones
  Related to debugger:
  - ArrayBufferActor -> SourceActor.onSource
  - ThreadActor -> TabActor.attach and WorkerActor.connect

  Related to console and netmon:
  - WebConsoleActor -> As a tab actor, so created automagically from here:
                       https://searchfox.org/mozilla-central/source/devtools/server/main.js#1610
  - NetworkEventActor -> Emitted by WebConsoleActor in networkEvent events, and returned by WebConsoleActor.sendHTTPRequest

I'm expecting the second bucket to be the more tedious one as these actor are used in many places.
The first bucket may not be naive as well as RootActor's code to instanciate the TabActors is quite abstracted.
I imagine we should use the same approach Eddy had, by first refactoring only the actors to use protocol.js and eventually convert the clients to use fronts in followups.
Here is the lessons learned from bug 1449162:

* `actorPrefix` becomes `typeName` on the spec object,
* `grip()` function becomes `form()` on the actor,
* We can remove `from` attributes in all in returned responses and only keep actual data you want to send to the client,
* remember calling `protocol.Actor.prototype.initialize.call(this, conn);` from your actor's `initialize` method to get events to work as expected and `protocol.Actor.prototype.destroy.call(this);` if you overload `destroy` method, in order to cleans things up correctly.
Priority: P3 → P5
Summary: Convert remaining devtools actors to protocol.js → [meta] Convert remaining devtools actors to protocol.js
Thanks Alex for summarizing the remaining work to convert the actor side to protocol.js.  I have tried to clean up the bug zoo left behind during various prior attempts at this.

Bug 1037992 and dependencies cover debugger-related actors.
Bug 1265736 and dependencies cover console and network event related actors.
Bug 1274681 covers the add-on actor.
For other actors, there's no bug filed yet.  

Yulia, maybe you could start by filing bugs for the remaining actors from Alex's list without bugs, so we have a complete picture of the work?  If it's not clear what to file or where they should go, let's talk about it!

All such actor conversion bugs should fall somewhere under this bug directly or one it depends on, so that they appear in the dependency tree:

https://bugzilla.mozilla.org/showdependencytree.cgi?id=1289193&hide_resolved=1

Everything under this bug is just about actors only.  Old-style clients should also be converted to protocol.js fronts as well.  I have filed bug 1450150 to track the conversion to fronts.
Flags: needinfo?(ystartsev)
Sure, I can do that!
Flags: needinfo?(ystartsev)
Depends on: 1450943
Depends on: 1450944
Depends on: 1462561
Product: Firefox → DevTools
Depends on: 1495728
Depends on: 1564134

It looks like as of today, the only two actors which are not converted to protocol.js are:

You need to log in before you can comment on or make changes to this bug.