Commit Graph

50 Commits

Author SHA1 Message Date
Gregory Pappas
3eac12bbd7 Bug 1845311 - Use ChromeUtils.defineLazyGetter in more places r=arai,webdriver-reviewers,geckoview-reviewers,extension-reviewers,application-update-reviewers,credential-management-reviewers,devtools-reviewers,fxview-reviewers,anti-tracking-reviewers,sessionstore-reviewers,pbz,joschmidt,robwu,issammani,bytesized,owlish,dao
Differential Revision: https://phabricator.services.mozilla.com/D184481
2023-07-26 16:28:11 +00:00
Mark Banner
130a655906 Bug 1826062 - Automatic fixes for upgrading Prettier to 2.8.8. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,calu
Differential Revision: https://phabricator.services.mozilla.com/D177027
2023-05-20 12:26:53 +00:00
Julian Descottes
fea56ca2b2 Bug 1830404 - [remote] Support sending message handler commands from windowglobal to root r=webdriver-reviewers,whimboo
Depends on D176713

Differential Revision: https://phabricator.services.mozilla.com/D176714
2023-05-02 20:11:50 +00:00
Julian Descottes
9fa2ad7bd9 Bug 1830404 - [remote] Rename transport helpers referring to frame r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D176713
2023-05-02 20:11:50 +00:00
Julian Descottes
c0f871815e Bug 1826366 - [remote] Manual fixes for valid-jsdoc in remote r=webdriver-reviewers,whimboo
Depends on D174738

Differential Revision: https://phabricator.services.mozilla.com/D174739
2023-04-05 16:25:48 +00:00
Julian Descottes
7ccbffb9f7 Bug 1826366 - [remote] Apply lint --fix for valid-jsdoc in remote r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D174738
2023-04-05 16:25:47 +00:00
Julian Descottes
0232a50aa5 Bug 1823670 - [messagehandler] Destroy MessageHandlers when pages move to BFCache r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D173132
2023-03-22 13:18:22 +00:00
Mark Banner
2ffde1e92f Bug 1792341 - Migrate more toolkit/modules consumers to use direct ES module import. r=Gijs,webdriver-reviewers,perftest-reviewers,necko-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,credential-management-reviewers,sgalich,owlish,bytesized,AlexandruIonescu,whimboo,mconley,mixedpuppy
Mainly automated changes. Some manual ESLint fixes and whitespace cleanup.

Differential Revision: https://phabricator.services.mozilla.com/D158452
2022-10-18 11:21:26 +00:00
Julian Descottes
d1f7dbe55e Bug 1790468 - [remote] Convert /remote/shared JSM modules to ESM r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D158293
2022-09-30 11:08:06 +00:00
Julian Descottes
84dec7594d Bug 1763137 - [messagehandler] Filter events based on context descriptor used to subscribe to them r=webdriver-reviewers,whimboo
Depends on D155070

Differential Revision: https://phabricator.services.mozilla.com/D155243
2022-09-02 12:04:15 +00:00
Julian Descottes
7d8eb136be Bug 1783177 - [messagehandler] Merge internal and protocol events r=webdriver-reviewers,whimboo
We no longer distinguish between internal and protocol events within the framework.
All events now have the same behavior:
- emitted both under their own name and under the name message-handler-event
- bubble up to the root message handler
- the session which owns the RootMessageHandler does not listen for those events

The emitProtocolEvent has been moved to the RootMessageHandler only and can be used to emit events under a specific name "message-handler-protocol-event".
Only those events will be sent over to the actual client.

Internally the session module now keeps track of which events have already been subscribed to, to avoid forwarding duplicated events.
In a followup this will be centralized over in the EventsDispatcher, which can now play a bigger role.

Note that in the same way as for commands, there is still an implicit notion of "internal event", as in "an event which can not be subscribed to by consumers".
For commands this is done by having a "_" before the command name.
For events this is done by listing or not the event in the "supportedEvents" static array of the Module.

Differential Revision: https://phabricator.services.mozilla.com/D155025
2022-08-26 14:21:28 +00:00
Julian Descottes
75eac83967 Bug 1770492 - [messagehandler] Support emitting protocol errors from MessageHandler modules r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D151034
2022-07-12 16:19:30 +00:00
Tooru Fujisawa
54623364da Bug 1777486 - Part 2: Migrate XPCOMUtils.jsm consumers with automatic migration. r=webdriver-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,kmag,owlish,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D151214
2022-07-12 04:21:34 +00:00
Andreea Pavel
7738a75fdd Backed out 11 changesets (Bug 1777486) for failing bc at browser_startup.js on a CLOSED TREE
Backed out changeset b6c4c386f1a6 (Bug 1777486)
Backed out changeset 195cc2de8433 (Bug 1777486)
Backed out changeset 20c746fb1648 (Bug 1777486)
Backed out changeset d5fd8173d62d (Bug 1777486)
Backed out changeset 6d758fab5a3e (Bug 1777486)
Backed out changeset e938b601ba15 (Bug 1777486)
Backed out changeset 0c4ea0b9416b (Bug 1777486)
Backed out changeset 0559c53cc668 (Bug 1777486)
Backed out changeset eea573d3a9f9 (Bug 1777486)
Backed out changeset 9ce3a6496a49 (bug 1777486)
Backed out changeset b0867652fc48 (bug 1777486)
2022-07-11 22:24:40 +03:00
Tooru Fujisawa
8cd6ed7409 Bug 1777486 - Part 2: Migrate XPCOMUtils.jsm consumers with automatic migration. r=webdriver-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,kmag,owlish,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D151214
2022-07-11 15:09:13 +00:00
Tooru Fujisawa
f3a8c52c53 Bug 1667455 - Part 4: Stop importing Services.jsm from JSM. r=kmag,webdriver-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,application-update-reviewers,pip-reviewers,twisniewski,devtools-reviewers,m_kato,jdescottes,ochameau,mconley,sfoster,AlexandruIonescu
Differential Revision: https://phabricator.services.mozilla.com/D150893
2022-07-11 12:41:50 +00:00
Alexandra Borovova
147e207e97 Bug 1775463 - Allow windowglobal-in-root modules to intercept events from their corresponding windowglobal module. r=webdriver-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D150107
2022-07-04 06:01:59 +00:00
Tooru Fujisawa
b79dac722c Bug 1607331 - Part 1: Do not use global this in remote/shared/messagehandler/transports/FrameTransport.jsm. r=jdescottes,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D148550
2022-06-13 20:03:01 +00:00
Tooru Fujisawa
f0d1eaf7b1 Bug 1772096 - Part 6: Use plain object for lazy getter in remote/shared/messagehandler/. r=webdriver-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D148003
2022-06-06 07:10:44 +00:00
Julian Descottes
9b0cc99afd Bug 1764314 - [remote] Allow MessageHandler commands to be retried upon AbortError r=webdriver-reviewers,whimboo
Depends on D147713

This adds a "retryOnAbort" property on MessageHandler Commands.
When set to true, this will allow the FrameTransport to retry a command up to 10 times in case of an AbortError.
Difference with Marionette, this doesn't attempt to detect BrowsingContexts in bfcache, because retrying commands
does not make sense in bfcache (this is not a temporary state, retrying in a loop will most likely not help).

A browser mochitest is added to cover various retry scenarios.

Differential Revision: https://phabricator.services.mozilla.com/D147715
2022-06-02 18:42:04 +00:00
Tooru Fujisawa
6b7683af58 Bug 1764688 - Fix this variable in MessageHandlerFrameActor.register. r=jdescottes,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D143713
2022-04-14 23:08:01 +00:00
Julian Descottes
07b6609d7d Bug 1730642 - [webdriver-bidi] Implement a basic browsingContext.navigate command r=webdriver-reviewers,whimboo
Depends on D142514

Differential Revision: https://phabricator.services.mozilla.com/D141583
2022-04-07 13:27:25 +00:00
Kagami Sascha Rosylight
1409f37ca3 Bug 1703953 - Part 2: Apply mozilla/use-isInstance rules for .jsm files r=webdriver-reviewers,pip-reviewers,mhowell,Gijs,whimboo
This replaces all `instanceof` uses for DOM interfaces, since the operator in priviliged context works same as .isInstance().

Differential Revision: https://phabricator.services.mozilla.com/D141785
2022-04-06 11:57:57 +00:00
criss
4eec7e25a3 Backed out 3 changesets (bug 1703953) for causing multiple failures. CLOSED TREE
Backed out changeset 871a1fac289e (bug 1703953)
Backed out changeset 8151244bda18 (bug 1703953)
Backed out changeset eaf6d4c353be (bug 1703953)
2022-03-29 17:01:58 +03:00
Kagami Sascha Rosylight
c8f12f94dc Bug 1703953 - Part 2: Apply mozilla/use-isInstance rules for .jsm files r=webdriver-reviewers,pip-reviewers,mhowell,Gijs,whimboo
This replaces all `instanceof` uses for DOM interfaces, since the operator in priviliged context works same as .isInstance().

Differential Revision: https://phabricator.services.mozilla.com/D141785
2022-03-29 13:11:00 +00:00
Henrik Skupin
1cf59ce7d1 Bug 1694391 - [remote] Make TabManager.browsers a getter. r=webdriver-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D140723
2022-03-17 10:37:35 +00:00
Julian Descottes
c539f17573 Bug 1758124 - [remote] Rename CONTEXT_DESCRIPTOR_TYPES to follow enum guidelines r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D140343
2022-03-04 15:59:22 +00:00
Julian Descottes
1aac6c54cd Bug 1753939 - [remote] Filter out webextensions in FrameContextUtils::isBrowsingContextCompatible r=rpl,webdriver-reviewers,whimboo
Depends on D138523

Given our current broadcast logic, we should not stumble on webextension contexts during broadcast.
This is because getAllBrowsingContextsInSubtree will not cross process boundaries.

Nevertheless, adding explicit support for WebExtensions in our filter method should be ok, with the added test.
Whenever we lift the JSWindowActor restrictions and rely on isBrowsingContextCompatible for filtering this will help avoid regressions.

Differential Revision: https://phabricator.services.mozilla.com/D138531
2022-02-14 23:07:45 +00:00
Julian Descottes
a881d0f446 Bug 1753939 - [remote] Do not create message handlers for webextension contexts r=webdriver-reviewers,rpl,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D138523
2022-02-14 23:07:45 +00:00
Henrik Skupin
2f01d4dbd4 Bug 1723919 - [remote] MessageHandler has to also support other applications than Firefox desktop. r=webdriver-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D138518
2022-02-11 11:33:22 +00:00
Julian Descottes
0c179363d6 Bug 1747107 - [remote] Replace FrameContextUtils::getOsPid with isParentProcess r=webdriver-reviewers,jgraham,whimboo. CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D134663
2022-02-01 14:35:25 +00:00
Butkovits Atila
c4f5279fc3 Backed out changeset 083b25b3bb4a (bug 1747107) for causing assertion failures at nsHttpChannel.cpp. CLOSED TREE 2022-02-01 21:16:16 +02:00
Julian Descottes
30b25ec353 Bug 1747107 - [remote] Replace FrameContextUtils::getOsPid with isParentProcess r=webdriver-reviewers,jgraham,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D134663
2022-02-01 14:35:25 +00:00
Julian Descottes
892ae10673 Bug 1747222 - [remote] Move browsing context APIs from browser.js and WindowManager to TabManager r=webdriver-reviewers,whimboo
Depends on D135414

Differential Revision: https://phabricator.services.mozilla.com/D135415
2022-01-14 21:19:53 +00:00
Julian Descottes
7d8052e4a0 Bug 1747222 - [remote] Migrate TOP BROWSING CONTEXT to use custom UUID instead of browserId r=webdriver-reviewers,whimboo
We are not supporting the TOP_BROWSING_CONTEXT yet in BiDi, but message handler already supports it, and assumes browser ids. But as discussed we will need to use custom UUIDs, and on the side have a mapping between browser ids and UUIDs, as browserids might be available late.

Differential Revision: https://phabricator.services.mozilla.com/D135414
2022-01-14 21:19:53 +00:00
Henrik Skupin
d85900994d Bug 1749507 - [remote] Add support for internal message handler events. r=webdriver-reviewers,jdescottes
There are two kind of events that can be used by module implementations
to pass information within the message handler framework.

First, with internal events the different modules and the message handlers
themselves can send around information eg. informing the parent process
about specific DOM events happening in the child process. These events
are not intended to be sent to external clients.

Second, with protocol events the different modules can send events with
a payload as specified in the appropriate protocol. These events shouldn't
be intercepted, modified, or ignored and will be sent to external clients.

Differential Revision: https://phabricator.services.mozilla.com/D134264
2022-01-13 09:46:32 +00:00
Julian Descottes
78e5eb0c46 Bug 1742491 - [remote] Filter out parent process frames in MessageHandlerFrameChild r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D131897
2021-12-17 09:48:50 +00:00
Julian Descottes
1fd12674d3 Bug 1725111 - [remote] Add new context descriptor type TOP_BROWSING_CONTEXT r=webdriver-reviewers,whimboo
Depends on D131439

Add a new CONTEXT_DESCRIPTOR_TYPES for top level browsing contexts, called TOP_BROWSING_CONTEXT.
The corresponding context descriptor id should be a browserId.
The FrameTransport is updated to support both CONTEXT_DESCRIPTOR_TYPES: ALL and TOP_BROWSING_CONTEXT.
A browser mochitest is added to check that broadcasts are correctly filtered for a top level browsing context.

Differential Revision: https://phabricator.services.mozilla.com/D131440
2021-11-23 20:23:09 +00:00
Julian Descottes
a7c7c72e45 Bug 1725111 - [remote] Use contextDescriptor as broadcasting argument for MessageHandler commands r=webdriver-reviewers,whimboo
Instead of using a broadcast boolean flag in the CommandDestination, use a contextDescriptor.
The only context descriptor type supported here is CONTEXT_DESCRIPTOR_TYPES.ALL, and the behavior is unchanged.

Differential Revision: https://phabricator.services.mozilla.com/D131439
2021-11-23 20:23:08 +00:00
criss
e694b076ce Backed out 2 changesets (bug 1725111) for causing failures on browser_session_data_broadcast.js. CLOSED TREE
Backed out changeset 5a48f5832e72 (bug 1725111)
Backed out changeset 9055935bf63f (bug 1725111)
2021-11-23 16:06:16 +02:00
Julian Descottes
883da7e971 Bug 1725111 - [remote] Add new context descriptor type TOP_BROWSING_CONTEXT r=webdriver-reviewers,whimboo
Depends on D131439

Add a new CONTEXT_DESCRIPTOR_TYPES for top level browsing contexts, called TOP_BROWSING_CONTEXT.
The corresponding context descriptor id should be a browserId.
The FrameTransport is updated to support both CONTEXT_DESCRIPTOR_TYPES: ALL and TOP_BROWSING_CONTEXT.
A browser mochitest is added to check that broadcasts are correctly filtered for a top level browsing context.

Differential Revision: https://phabricator.services.mozilla.com/D131440
2021-11-23 13:02:28 +00:00
Julian Descottes
db1ebd69a8 Bug 1725111 - [remote] Use contextDescriptor as broadcasting argument for MessageHandler commands r=webdriver-reviewers,whimboo
Instead of using a broadcast boolean flag in the CommandDestination, use a contextDescriptor.
The only context descriptor type supported here is CONTEXT_DESCRIPTOR_TYPES.ALL, and the behavior is unchanged.

Differential Revision: https://phabricator.services.mozilla.com/D131439
2021-11-23 13:02:27 +00:00
Julian Descottes
4e54c3a7d8 Bug 1731556 - [remote] Apply events from session data for new window globals r=webdriver-reviewers,ochameau,whimboo,jgraham
Depends on D127698

Differential Revision: https://phabricator.services.mozilla.com/D128284
2021-11-19 15:39:12 +00:00
Julian Descottes
e788f6a08c Bug 1713443 - [remote] Support shared global session data that supports BiDi and CDP r=webdriver-reviewers,whimboo,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D127698
2021-11-11 22:01:46 +00:00
Julian Descottes
69fa6f5492 Bug 1726800 - [remote] Verify commands as early as possible in MessageHandler r=webdriver-reviewers,whimboo
Depends on D123655
With this patch, the MessageHandler can immediately check if a command is implemented by the modules, and therefore reject as early as possible.
This is implemented via a checkCommand method on MessageHandler.

Other required changes:
- ModuleRegistry now owns the logic to import BiDi modules.
- ModuleCache exposes a `getAllModuleClasses` to get all the relevant modules for a moduleName+destination pair.

Error messages have been improved and are verified with a dedicated test

Differential Revision: https://phabricator.services.mozilla.com/D123655
2021-10-12 16:48:43 +00:00
Julian Descottes
5d36dcd33d Bug 1722659 - [remote] Stop using singleton for MessageHandlerRegistry r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D123190
2021-09-28 09:23:11 +00:00
Julian Descottes
aed2bec56c Bug 1713442 - [remote] Support events in windowglobal MessageHandlers r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D120640
2021-08-10 21:34:23 +00:00
Julian Descottes
0f5b843f04 Bug 1713441 - [remote] Support MessageHandler broadcasting for WindowGlobal contexts r=webdriver-reviewers,whimboo,jgraham
Differential Revision: https://phabricator.services.mozilla.com/D120585
2021-08-05 11:55:13 +00:00
Julian Descottes
adcaf10cc8 Bug 1713439 - [remote] Add logs to initial MessageHandler classes r=webdriver-reviewers,whimboo
Depends on D119780

Differential Revision: https://phabricator.services.mozilla.com/D120082
2021-07-30 08:17:48 +00:00
Julian Descottes
3f17d3f303 Bug 1713439 - [remote] Add basic MessageHandler support for window global contexts r=webdriver-reviewers,whimboo,jgraham
Differential Revision: https://phabricator.services.mozilla.com/D119780
2021-07-30 08:17:48 +00:00