Window handle changes when framescript is moved to a different process
Categories
(Remote Protocol :: Marionette, defect, P1)
Tracking
(Not tracked)
People
(Reporter: ato, Assigned: ato)
References
(Blocks 3 open bugs, )
Details
(Keywords: pi-marionette-server, pi-marionette-spec)
Attachments
(1 file, 2 obsolete files)
164.43 KB,
patch
|
Details | Diff | Splinter Review |
Assignee | ||
Updated•8 years ago
|
Assignee | ||
Updated•8 years ago
|
Assignee | ||
Updated•8 years ago
|
Assignee | ||
Updated•8 years ago
|
Assignee | ||
Comment 5•8 years ago
|
||
Assignee | ||
Comment 7•7 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Assignee | ||
Comment 8•7 years ago
|
||
Assignee | ||
Comment 9•7 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Assignee | ||
Comment 17•7 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Assignee | ||
Comment 19•6 years ago
|
||
In the recent weeks I have come to the conlusion that fixing the
window handles to stay unique following remoteness changes is
somewhat directly related to ensuring Fission compatiblity in
Marionette.
As process swaps get more frequent and as nested browsing contexts
such as <frame> and <iframe> shift from being traversable through
the docshell to becoming remote, there is a pressing need to be
able to uniquely keep track of content browsers (<browser>) across
all processes.
The DOM team is pulling a lot of infrastructure for handling content
browsers from the product frontends (Firefox and Fennec) up to the
platform level. One of the new underlying primitives introduced
is the BrowsingContext interface that is meant to carry the same
meaning as “browsing contexts” in the HTML specification. It assigns
a universally unique identifier to each context, and because they
will be serialisable you can query and reference them from any
process.
BrowsingContext directly comparable to the (wait for it…) BrowsingContext
interfaces I had been working on in this patch. But whereas my
patch had support for Firefox and Fennec using existing toolkit
technology to keep track of content browsers appearing and disappearing,
the new platform BrowsingContext does all of this at the platform
level, which means it will be future-compatible with any new products
(e.g. based on GeckoView).
The second half of the patches I’ve been working on for this bug
were a series of class specialisations to get rid of spaghetti
if-conditions for product-specific behaviour. These are still
relevant and we would like to see these in Marionette long-term.
However, as we discuss implementing a new remote interface in
Firefox, we face the question what to do with the Marionette protocol.
It’s a bigger discussion what to do with Marionette and how to make
it Fission compatible (as it reaches beyond the scope of this bug),
but the addition of BrowsingContext does however render this bug
superfluous.
(In reply to Andreas Tolfsen ⦗:ato⦘ from comment #19)
The DOM team is pulling a lot of infrastructure for handling content
browsers from the product frontends (Firefox and Fennec) up to the
platform level. One of the new underlying primitives introduced
is the BrowsingContext interface that is meant to carry the same
meaning as “browsing contexts” in the HTML specification. It assigns
a universally unique identifier to each context, and because they
will be serialisable you can query and reference them from any
process.
Note that we still have to find the window the wanted browsing context is contained in. Is there an easy way to do that like an API which returns the current window handle for a browsing context? If not we might have to filter all open chrome windows for the requested browsing context id. Maybe internally we can simply store the chrome window handle together with the browsing context id, so we don't have to do the filtering each time.
The second half of the patches I’ve been working on for this bug
were a series of class specialisations to get rid of spaghetti
if-conditions for product-specific behaviour. These are still
relevant and we would like to see these in Marionette long-term.
I have to start working on bug 1496773 for GeckoView soon, which will pull-in at least one more platform. As such more if-conditions will have to be added. Without looking at your full patch, what do you think how much work it is to just get those separations extracted and landed? Would it be worth it? Or should I for now just add the necessary conditions?
It’s a bigger discussion what to do with Marionette and how to make
it Fission compatible (as it reaches beyond the scope of this bug),
but the addition of BrowsingContext does however render this bug
superfluous.
For the Fission work see bug 1518468.
Note that I filed bug 1519335 to investigate the usage of the browsing context id.
Assignee | ||
Comment 22•6 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #20)
Note that we still have to find the window the wanted browsing
context is contained in. Is there an easy way to do that like
an API which returns the current window handle for a browsing
context? If not we might have to filter all open chrome windows
for the requested browsing context id. Maybe internally we can
simply store the chrome window handle together with the browsing
context id, so we don't have to do the filtering each time.
A BrowsingContext is an associated state of the content browser, so
you can find the window a browsing context is contained in the usual
way by traversing up the tree to find the nearest <window> element:
myBrowser = gBrowser.browsers[0]
myBrowser.browsingContext
<- BrowsingContext
myBrowser.closest("window")
<- <window id="main-window" …>
ChromeWindows aren’t browsing contexts, but they also always exist
in the parent process, so their outerWindowIDs won’t change.
I have to start working on bug 1496773 for GeckoView soon,
which will pull-in at least one more platform. As such more
if-conditions will have to be added. Without looking at your full
patch, what do you think how much work it is to just get those
separations extracted and landed? Would it be worth it? Or should
I for now just add the necessary conditions?
If Marionette as we know it is going to be discontinued, it doesn’t
make sense to spend a lot of time on major refactorings.
Comment 23•6 years ago
|
||
If Marionette as we know it is going to be discontinued
What will be alternative?
Assignee | ||
Comment 24•6 years ago
|
||
(In reply to support from comment #23)
If Marionette as we know it is going to be discontinued
What will be alternative?
We should narrow the scope of this discussion to talk about using
the new platform BrowsingContext abstractions for dealing with host
process changes.
To be clear, the future of the Marionette remote protocol has not
yet been decided. We will likely make a decision about that when
doing our H2 planning.
Updated•2 years ago
|
Description
•