Граф коммитов

32 Коммитов

Автор SHA1 Сообщение Дата
Andreas Tolfsen 9444fa34c7 bug 1606818: remote: use nsIHttpServer for unregistering handler r=remote-protocol-reviewers,whimboo
nsIHttpServer.registerPathHandler() is designed to take null as
the second argument to unregister path handlers.  This saves us
from having to modify its internal state, and fixes a minor TODO
in the remote agent initialisation code.

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

--HG--
extra : moz-landing-system : lando
2020-01-03 16:19:33 +00:00
Andreas Tolfsen 112d47f40c bug 1565164: remote: rename Targets TargetList r=remote-protocol-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D58609

--HG--
rename : remote/targets/Targets.jsm => remote/targets/TargetList.jsm
extra : moz-landing-system : lando
2020-01-06 09:32:09 +00:00
Andreas Tolfsen 22560f18d6 bug 1590828: remote: return NS exceptions from nsIRemoteAgent r=remote-protocol-reviewers,whimboo,maja_zf
The nsIRemoteAgent interface introduced with bug 1543115 did
not change the exceptions thrown internally by the class. To ensure
better interaction with consumers over XPIDL we should ensure the
JS implementation throws NS exceptions.

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

--HG--
extra : moz-landing-system : lando
2019-12-04 18:26:36 +00:00
Andreas Tolfsen 5602f61d54 bug 1600121: remote: rely on nsIHttpServer.registerPathHandler to assert path r=remote-protocol-reviewers,maja_zf,whimboo
As nsIHttpServer.registerPathHandler now checks that the path is
not empty we can drop our pre-check when target-created is handled.

If target.path does happen to be empty an error is printed to the console.

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

--HG--
extra : moz-landing-system : lando
2019-12-02 09:38:17 +00:00
Andreas Tolfsen a217b583f9 bug 1600111: remote: make nsIRemoteAgent.listen() sync r=remote-protocol-reviewers,maja_zf
Interfaces exposed over XPIDL cannot be marked async, otherwise their
return values get lost.  This patch makes nsIRemoteAgent.listen()
synchronous by removing the use of async/await.

Unfortunately Rust does not yet support deserialising promises sent across
XPIDL, documented in https://bugzilla.mozilla.org/show_bug.cgi?id=1512319.

In an effort to retain the original API internally the function
now returns a promise.  This means the function can be awaited in
JS only, which we make use of in remote/test/browser/head.js.

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

--HG--
extra : moz-landing-system : lando
2019-12-04 11:57:13 +00:00
Andreas Tolfsen 629a3a47dc bug 1600111: remote: make nsIRemoteAgent.close() sync r=remote-protocol-reviewers,whimboo,maja_zf
Interfaces exposed over XPIDL cannot be marked async, otherwise their
return values get lost.  This patch makes nsIRemoteAgent.close()
synchronous by removing the use of async/await.

Unfortunately Rust does not yet support deserialising promises sent
across XPIDL, so in an effort to retain the original API internally
the function now returns a promise.  This means the function can be
awaited in JS only, which we make use of in remote/test/browser/head.js.

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

--HG--
extra : moz-landing-system : lando
2019-12-04 11:57:06 +00:00
Andreas Tolfsen 36f394af15 bug 1543115: remote, toolkit: bootstrap from Rust; r=remote-protocol-reviewers,maja_zf
This bootstraps the remote agent from Rust so that we have access
to write to stderr using the eprintln!() macro.  There is a future
intention to expand Rust usage in the remote agent by delegating
CDP and WebDriver Bi-Di protocol schema validation to serde.

The Rust port is faithful to the JS version in terms of functionality,
and in some places improves on the original design by enforcing
a strict division between flag handling code on one hand, and the
remote agent server on the other.

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

--HG--
extra : moz-landing-system : lando
2019-11-22 08:03:21 +00:00
Andreas Tolfsen 967406480d bug 1543115: remote: introduce nsIRemoteAgent XPIDL interface; r=remote-protocol-reviewers,maja_zf
Adds an XPIDL interface for the remote agent which we will later use to
initialise and start it from a new command-line handler written in Rust.

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

--HG--
extra : moz-landing-system : lando
2019-11-22 08:03:12 +00:00
Andreas Tolfsen 9c0f6722a6 bug 1543115: remote: make RemoteAgent.listen() accept strings; r=remote-protocol-reviewers,maja_zf
Crafting nsIURIs in Rust is complicated.  Allow RemoteAgent.listen()
to accept both strings and nsIURIs when called in JavaScript.

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

--HG--
extra : moz-landing-system : lando
2019-11-22 08:03:10 +00:00
Andreas Tolfsen 7c06462151 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
2019-11-22 08:03:08 +00:00
Andreas Tolfsen 3f618e2eda bug 1543115: remote: set needed prefs earlier at startup; r=remote-protocol-reviewers,maja_zf
Although it currently makes no difference, we should ensure the
required preferences are set sooner, in case any of the internal
remote agent features depend on it.

Because we also cannot control when the nsICommandLineHandler for
the remote agent is invoked, setting it sooner rather than later,
seems a lot safer.

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

--HG--
extra : moz-landing-system : lando
2019-11-22 08:03:05 +00:00
Andreas Tolfsen d25d3a1256 bug 1543115: remote: make RemoteAgent.close() safer; r=remote-protocol-reviewers,maja_zf
close() is meant to be failsafe in the sense that it should be
possible to call without side-effects.

We are currently setting up a lot of state in listen() that is not
cleaned up if the server eventually fails to start.  Calling close()
when this happens will ensure any state listen() has accrued is reset.

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

--HG--
extra : moz-landing-system : lando
2019-11-22 08:03:03 +00:00
Andreas Tolfsen 795f248c54 bug 1543115: remote: merge init() and listen(); r=remote-protocol-reviewers,maja_zf
Having init() as a separate function leads to inconsistencies about
how the required state is checked.

init() prevents the remote agent from being loaded when the
remote.enabled preference is false or it is attempted loaded into a
child process, but listen() already manipulates state before these
checks are run.  This is probably not the intention, but an easy
mistake to make when the code flow is not crystal clear.

Since we never have a need to call init() independently, this patch
merges init() into listen().

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

--HG--
extra : moz-landing-system : lando
2019-11-22 08:02:56 +00:00
Daniel Varga 420bc7e3b5 Backed out 9 changesets (bug 1543115) for build bustage with fatal error: 'nsIRemoteAgent.h' file not found. On a CLOSED TREE
Backed out changeset df184d5f766a (bug 1543115)
Backed out changeset 0316a7fa9d37 (bug 1543115)
Backed out changeset 99ae1cdbaa69 (bug 1543115)
Backed out changeset 825f6b55865a (bug 1543115)
Backed out changeset 6480cdbd004c (bug 1543115)
Backed out changeset 4ecb2e70e855 (bug 1543115)
Backed out changeset 76ebc0f74bff (bug 1543115)
Backed out changeset 8a931eb7b0c8 (bug 1543115)
Backed out changeset 72c162fff80c (bug 1543115)

--HG--
rename : remote/components.conf => remote/RemoteAgent.conf
2019-11-19 15:54:15 +02:00
Andreas Tolfsen d79e42a0ef bug 1543115: remote: bootstrap from Rust; r=remote-protocol-reviewers,maja_zf
This bootstraps the remote agent from Rust so that we have access
to write to stderr using the eprintln!() macro.  There is a future
intention to expand Rust usage in the remote agent by delegating
CDP and WebDriver Bi-Di protocol schema validation to serde.

The Rust port is faithful to the JS version in terms of functionality,
and in some places improves on the original design by enforcing
a strict division between flag handling code on one hand, and the
remote agent server on the other.

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

--HG--
extra : moz-landing-system : lando
2019-11-19 12:33:06 +00:00
Andreas Tolfsen 24f7b88ad4 bug 1543115: remote: introduce nsIRemoteAgent XPIDL interface; r=remote-protocol-reviewers,maja_zf
Adds an XPIDL interface for the remote agent which we will later use to
initialise and start it from a new command-line handler written in Rust.

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

--HG--
extra : moz-landing-system : lando
2019-11-19 12:32:48 +00:00
Andreas Tolfsen e02175a9ab bug 1543115: remote: make RemoteAgent.listen() accept strings; r=remote-protocol-reviewers,maja_zf
Crafting nsIURIs in Rust is complicated.  Allow RemoteAgent.listen()
to accept both strings and nsIURIs when called in JavaScript.

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

--HG--
extra : moz-landing-system : lando
2019-11-19 12:32:46 +00:00
Andreas Tolfsen e29e510bb0 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
2019-11-19 12:32:44 +00:00
Andreas Tolfsen a293581c87 bug 1543115: remote: set needed prefs earlier at startup; r=remote-protocol-reviewers,maja_zf
Although it currently makes no difference, we should ensure the
required preferences are set sooner, in case any of the internal
remote agent features depend on it.

Because we also cannot control when the nsICommandLineHandler for
the remote agent is invoked, setting it sooner rather than later,
seems a lot safer.

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

--HG--
extra : moz-landing-system : lando
2019-11-19 12:32:41 +00:00
Andreas Tolfsen a30223fe5e bug 1543115: remote: make RemoteAgent.close() safer; r=remote-protocol-reviewers,maja_zf
close() is meant to be failsafe in the sense that it should be
possible to call without side-effects.

We are currently setting up a lot of state in listen() that is not
cleaned up if the server eventually fails to start.  Calling close()
when this happens will ensure any state listen() has accrued is reset.

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

--HG--
extra : moz-landing-system : lando
2019-11-19 12:32:39 +00:00
Andreas Tolfsen 17705e0460 bug 1543115: remote: merge init() and listen(); r=remote-protocol-reviewers,maja_zf
Having init() as a separate function leads to inconsistencies about
how the required state is checked.

init() prevents the remote agent from being loaded when the
remote.enabled preference is false or it is attempted loaded into a
child process, but listen() already manipulates state before these
checks are run.  This is probably not the intention, but an easy
mistake to make when the code flow is not crystal clear.

Since we never have a need to call init() independently, this patch
merges init() into listen().

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

--HG--
extra : moz-landing-system : lando
2019-11-19 12:32:31 +00:00
Alexandre Poirot 6deb23fefc Bug 1563689 - Release DOM event listeners set on top level windows. r=remote-protocol-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D38205

--HG--
extra : moz-landing-system : lando
2019-07-18 09:48:18 +00:00
Alexandre Poirot 111854b5a5 Bug 1563689 - Revamp how targets are watched and reported. r=remote-protocol-reviewers,ato,jdescottes
* TabObserver is rather an helper class of Targets rather than RemoteAgent.
  Targets is the class which holds all the targets and reports about their
  creation and destructor. It feels legitimate to have it directly integrate
  with TabObserver.
* To better sort of the files. i.e. avoid having "random files" in /remote/
  I'm renaming and moving TabObserver according to its usage.
* We were emitting "connect" and "disconnect" event when a target was created
  or destroyed. But this is misleading as there is no connection to anything
  being made. Only later, a CDP client might connect to a target HTTP endpoint
  and initiate a connection. These events are making this hard to understand
  that the connection actually happens when Target.handle is called.

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

--HG--
rename : remote/WindowManager.jsm => remote/targets/TabObserver.jsm
extra : moz-landing-system : lando
2019-07-18 12:30:10 +00:00
Alexandre Poirot 2cb94420be Bug 1563687 - Rename Targets.disconnect to destructor to better match project's conventions. r=remote-protocol-reviewers,jdescottes,ato
Connect and disconnect in misleading here as a target aren't connected/disconnected,
but instead, being unregistered and destroyed. The fact that they are "disconnected"
is a side effect of this destruction. Also note that a Target is never "connected",
it is only a Connection and its related sessions which really are connected to a remote client.

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

--HG--
extra : moz-landing-system : lando
2019-07-10 16:32:35 +00:00
Victor Porof 991b3c93c6 Bug 1561435 - Format remote/, a=automatic-formatting
# ignore-this-changeset

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

--HG--
extra : source : b793788d0f38244b33eb59ea36e2c6624dbd12c5
2019-07-05 10:56:48 +02:00
Alexandre Poirot cf99fa36d0 Bug 1536862 - Register RemoteAgent JS XPCOM by using new registration method. r=ato
Differential Revision: https://phabricator.services.mozilla.com/D24228

--HG--
extra : moz-landing-system : lando
2019-06-26 20:25:43 +00:00
Julian Descottes 2456aa785c Bug 1535102 - Implement Page.bringToFront and introduce parent Page domain r=ato
Differential Revision: https://phabricator.services.mozilla.com/D32538

--HG--
extra : moz-landing-system : lando
2019-05-27 08:52:03 +00:00
Alexandre Poirot 6908d17662 Bug 1551689 - Print listener address with a new-line. r=remote-protocol-reviewers,ato
Differential Revision: https://phabricator.services.mozilla.com/D31127

--HG--
extra : moz-landing-system : lando
2019-05-14 22:00:11 +00:00
Andreas Tolfsen 5485cb24b1 bug 1551188: remote: print listening address similarly to chrome; r=remote-protocol-reviewers,ochameau
Puppeteer parses stderr looking for the regular expression
^DevTools listening on (ws:\/\/.*)$.  For Puppeteer to be able
to connect to Firefox, we need to change the line we print slightly
to conform with this expression.

The remote agent also uses Log.jsm to print it, but we cannot rely
on logging always being enabled, e.g. if remote.log.level is set
to Warn or above.  For this reason we should use dump().

The patch also instantiates the main target before starting the HTTPD.

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

--HG--
extra : moz-landing-system : lando
2019-05-13 14:43:21 +00:00
Alexandre Poirot b45bb32493 Bug 1537768 - Simplify RemoteAgent initialization. r=remote-protocol-reviewers,ato
Start the `TabObserver` from `RemoteAgent.listen` in order to prevent
having the tests to manually start it.
Start it from `listen` instead of `init` as we do stop the `TabObserver` from
`stop` and `stop` is the reverse of `listen`, not the reverse of `init`.

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

--HG--
extra : moz-landing-system : lando
2019-05-02 12:00:37 +00:00
Alexandre Poirot 5cae2c807d Bug 1539221 - Register main process target on server start. r=ato
Depends on D25556

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

--HG--
rename : remote/test/browser/browser_target.js => remote/test/browser/browser_main_target.js
extra : moz-landing-system : lando
2019-04-04 11:16:27 +00:00
Alexandre Poirot 26d0c79caa Bug 1536888 - Move the remote agent to a JSM. r=ato
This will later help register the component statically in bug 1536862.
And already ease using the remote agent from other JSM files.

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

--HG--
rename : remote/RemoteAgent.js => remote/RemoteAgent.jsm
extra : moz-landing-system : lando
2019-03-22 09:46:50 +00:00