Closed Bug 1755094 Opened 3 years ago Closed 3 years ago

Fission Android: eventDispatcher is not available in xorigin iframes

Categories

(GeckoView :: Sandboxing, defect, P1)

Unspecified
All

Tracking

(firefox98 disabled, firefox99 disabled, firefox100 disabled, firefox101 disabled, firefox102 fixed)

RESOLVED FIXED
102 Branch
Tracking Status
firefox98 --- disabled
firefox99 --- disabled
firefox100 --- disabled
firefox101 --- disabled
firefox102 --- fixed

People

(Reporter: agi, Assigned: agi)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fission:android:m2] [geckoview:m99] [geckoview:m100] [geckoview:m101] [geckoview:m102])

Attachments

(5 files)

IIUC cpmm is not available on xorigin iframes (and shouldn't be used in general). We need to rewrite Messaging.jsm to use the child Actor`s messaging instead. https://searchfox.org/mozilla-central/rev/fc4d4a8d01b0e50d20c238acbb1739ccab317ebc/mobile/android/modules/geckoview/Messaging.jsm#23

Whiteboard: [fission:android:m2]

To do this we need to remove all instances of the message manager, which in particular means that we have to migrate GeckoViewPermission to actor.

Depends on: 1755541
Severity: -- → S3
Priority: -- → P1
Whiteboard: [fission:android:m2] → [fission:android:m2][geckoview:m99]
Depends on: 1756049
Blocks: 1755541, 1756049
No longer depends on: 1755541, 1756049
Blocks: 1756056

The existing EventDispatcher messaging infrastracture uses cpmm (content
process message manager) which is deprecated and will be removed for Fission.

The current behavior with fission is that cpmm is available only on in-frame
frames, so on any oop frame we're not able to send or receive eventDispatcher
messages.

To allow OOP frames actors to send messages, this patch implements a new type
of dispatcher, called ChildActorDispatcher which routes messages through the
actor messaging system.

We then catch these messages on the parent actor side and send them to Java.

To be able to reroute messages from the Parent actor we need to make sure that
each actor that we define extends GeckoViewActorParent, so we define an actor
parent for each missing child actor.

In the future we could consider moving GeckoViewActorParent to a native
implementation for performance reasons.

Assignee: nobody → agi
Status: NEW → ASSIGNED
Whiteboard: [fission:android:m2][geckoview:m99] → [fission:android:m2][geckoview:m99][geckoview:m100]
Flags: needinfo?(calu)
Flags: needinfo?(agi)

This needs some depending bugs to land together with.

Flags: needinfo?(calu)
Flags: needinfo?(agi)

ActorDispatcher does not support receiving multiple callbacks for one message
so we need to change the strategy a little bit.

We need to centralize handling actions are each sequential ID is incremented
independently for each child, so it won't work for iframes.

To avoid this problem in the future, the sequential ID is no just a
randomly-generated UUID.

We also do all the checking on the parent process, so we don't need to check in
the child again whether we got a message that was out-of-date.

Whiteboard: [fission:android:m2][geckoview:m99][geckoview:m100] → [fission:android:m2][geckoview:m99][geckoview:m100] [geckoview:m101]

There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:agi, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit auto_nag documentation.

Flags: needinfo?(calu)
Flags: needinfo?(agi)

This allows waiting for an arbitrary condition in waitUntilCalled. To make
this happen, we need to execute delegate calls as they happen, rather than
replaying them all at the end, this is why we need to change a little bit more
code than expected in GeckoSessionTestRule.

This also fixes some weird behavior when calling waitUntilCalled while
waiting on a condition that depends on the behavior of the delegate in
waitUntilCalled.

This is a minor API fix wherby we call onSessionStart, onNodeAdd instead of
having a single onAutofill call that passes in the type of call. This aligns
the API with all our other delegates.

Note that because this API is normally implemented inside GeckoView itself,
we dont expect any action on embedders for this change.

Before this patch, the autofill tree was mutable, which makes it hard to follow
updates and reason about state.

This change makes the autofill tree immutable and adds a separate HashMap to
track mutable values like value, callback.

This change also modifies the way we track nodes internally, using exclusevely
the UUID of the node rather then the int autofill ID which is now only used at
the boundary of the Autofill API.

Flags: needinfo?(calu)
Whiteboard: [fission:android:m2][geckoview:m99][geckoview:m100] [geckoview:m101] → [fission:android:m2] [geckoview:m99] [geckoview:m100] [geckoview:m101] [geckoview:m102]
Pushed by asferro@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6350cfac6324 Add ShouldContinue to wait for an arbitrary condition. r=owlish
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch

Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.

Forgot to set leave-open

Status: RESOLVED → REOPENED
Flags: needinfo?(agi)
Resolution: FIXED → ---
Pushed by asferro@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fe2864aaa7ac Implement ChildActorDispatcher. r=calu https://hg.mozilla.org/integration/autoland/rev/7c9fba1576c5 Adjust SelectionActionDelegate for ActorDispatcher. r=owlish https://hg.mozilla.org/integration/autoland/rev/a8dd33d43779 Use separate methods instead of onAutofill. r=owlish https://hg.mozilla.org/integration/autoland/rev/1023e45ecd5c Make autofill tree immutable. r=owlish

Backed out for causing lint failures in Autofill

Backout link: https://hg.mozilla.org/integration/autoland/rev/1254448a9518995f5922080912755262c984bdfd

Pushed by asferro@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/63a68fd79bfd Implement ChildActorDispatcher. r=calu https://hg.mozilla.org/integration/autoland/rev/1c1defb1f014 Adjust SelectionActionDelegate for ActorDispatcher. r=owlish https://hg.mozilla.org/integration/autoland/rev/cce65aa3dddd Use separate methods instead of onAutofill. r=owlish https://hg.mozilla.org/integration/autoland/rev/b50f41d22259 Make autofill tree immutable. r=owlish

Moving Android Fission bugs to the new GeckoView::Sandboxing component.

Component: General → Sandboxing
Regressions: 1781180
Regressions: 1786862
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: