Closed Bug 1577092 Opened 5 years ago Closed 5 years ago

Transform *Connector objects in devtools/server/connectors into functions

Categories

(DevTools :: Framework, task, P3)

task

Tracking

(firefox70 fixed)

RESOLVED FIXED
Firefox 70
Tracking Status
firefox70 --- fixed

People

(Reporter: nchevobbe, Assigned: jdescottes)

References

Details

Attachments

(2 files)

In Bug 1572671, we are going to remove the _contentProcessServerStartupScriptLoaded property on the ContentProcessConnector object.
This will mean that the object will only contains a single, startServer property.
This is already the case for the other connectors object in this folder.

I wonder if there would be any blocker to turn those connector objects into functions (i.e. what's in startServer at the moment), since we don't have much advantages having an object for that.

But maybe there's something I'm missing? Let's talk about it

Flags: needinfo?(poirot.alex)
Flags: needinfo?(jdescottes)

I think it's fine to turn them into functions.

Flags: needinfo?(jdescottes)

Another related followup is that the DebuggerServer's only forwarding to connectors right now:
https://searchfox.org/mozilla-central/rev/325c1a707819602feff736f129cb36055ba6d94f/devtools/server/debugger-server.js

  /**
   * See ContentProcessConnector.startServer.
   */
  connectToContentProcess(connection, mm, onDestroy) {
    return ContentProcessConnector.startServer(connection, mm, onDestroy);
  },

  /**
   * See WorkerConnector.startServer.
   */
  connectToWorker(connection, dbg, id, options) {
    return WorkerConnector.startServer(connection, dbg, id, options);
  },

  /**
   * See FrameConnector.startServer.
   */
  connectToFrame(connection, frame, onDestroy, { addonId } = {}) {
    return FrameConnector.startServer(connection, frame, onDestroy, {
      addonId,
    });
  },

We could check if it's not easier to directly call the connectors instead of going through DebuggerServer.

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e30f91bfaec9
Change devtools server connectors to expose connectTo functions r=nchevobbe
https://hg.mozilla.org/integration/autoland/rev/848ac630ed23
Remove connectTo* helpers in debugger-server and use connectors directly r=nchevobbe
Flags: needinfo?(poirot.alex)
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 70
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: