Commit 7c064621 authored by Andreas Tolfsen's avatar Andreas Tolfsen
Browse files

bug 1543115: remote: emit "remote-listening" system notification on startup;...

bug 1543115: remote: emit "remote-listening" system notification on startup; r=remote-protocol-reviewers,maja_zf

When calling RemoteAgent.listen() across XPIDL the function is run
asynchronously.  In order to find out when the remote agent has started
listening we introduce a "remote-listening" system observer notification.

Differential Revision: https://phabricator.services.mozilla.com/D50285

--HG--
extra : moz-landing-system : lando
parent 3f618e2e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -91,6 +91,11 @@ class RemoteAgentClass {

      this.server._start(port, host);
      dump(`DevTools listening on ${mainTarget.wsDebuggerURL}\n`);
      Services.obs.notifyObservers(
        null,
        "remote-listening",
        mainTarget.wsDebuggerURL
      );
    } catch (e) {
      await this.close();
      throw new Error(`Unable to start remote agent: ${e.message}`, e);