Open Bug 1450284 Opened 2 years ago Updated 3 months ago

Finish conversion of ThreadActor to protocol.js

Categories

(DevTools :: Debugger, task, P3)

task

Tracking

(Not tracked)

People

(Reporter: jryans, Assigned: yulia)

References

(Blocks 1 open bug)

Details

(Keywords: leave-open)

Attachments

(2 files)

In bug 1256397, Eddy landed a few parts of converting ThreadActor to protocol.js, but there's still more work that remains:

* `attach` and potentially other request handlers may need special treatment in protocol.js due to the nested event loops used in the debugger
  * https://bugzilla.mozilla.org/attachment.cgi?id=8730334&action=diff from bug 1256397 is an attempt at this that was never finished
* The spec[1] should actually define the methods
  * File should also be renamed to `thread` to match the actor
* The old-style request handlers[2] should be removed and actor methods renamed, just like other conversions of actors to p.js

Additional conversion tips copied from :ochameau:

* `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.

[1]: https://searchfox.org/mozilla-central/rev/57bbc1ac58816dc054df242948f3ecf75e12df5f/devtools/shared/specs/script.js#11
[2]: https://searchfox.org/mozilla-central/rev/57bbc1ac58816dc054df242948f3ecf75e12df5f/devtools/server/actors/thread.js#1730
Product: Firefox → DevTools
As mentioned in 1473511 -- we should also rename the destroy and exit methods, as they are a bit misleading in what they are doing. Destroy is doing a cleanup of the actor, and is called on detach and onReleaseMany, as well as from exit. The real "destroy" happens in `exit`
Blocks: 1494796
Assignee: nobody → ystartsev
Keywords: leave-open

We need a complete specification in order to move forward with the front conversion. I
think this will also impact other parts of the refactoring, such as some of the thread specific code
in the debugger-client.

Rather straighforward -- as per jryans recommendation, I have renamed the file to reflect
our naming conventions.

Attachment #9060378 - Attachment description: Bug 1450284 - Finish the Spec for Thread; r=ochameau,jdescottes → Bug 1450284 - Complete method set in the Spec for Thread; r=ochameau,jdescottes
Pushed by ystartsev@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dd5b92f89835
Complete method set in the Spec for Thread; r=jdescottes,ochameau
https://hg.mozilla.org/integration/autoland/rev/7e6b874b870a
rename script spec to thread.js; r=jdescottes

Does this still need to remain open (and blocking bug 1494796)?

Flags: needinfo?(ystartsev)

This needs to remain open. there will be more patches landing for this as part of the patch queue for the conversion.

Flags: needinfo?(ystartsev)
Type: enhancement → task
No longer blocks: 1494796
You need to log in before you can comment on or make changes to this bug.