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
This commit is contained in:
Andreas Tolfsen 2019-11-22 08:03:08 +00:00
Родитель 3f618e2eda
Коммит 7c06462151
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -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);