Remove nsIRemoteTab::windowGlobalParents getter
Categories
(Core :: DOM: Content Processes, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox69 | --- | fixed |
People
(Reporter: mconley, Assigned: rhunt)
References
Details
Attachments
(1 file, 1 obsolete file)
Bug 1549753 introduced a new handy getter, windowGlobalParents, on nsIRemoteTab.
Right now, it returns all WindowGlobalParents for all subtrees.
This was originally in support of my work in bug 1533949 - however, upon testing, there's a slight alteration that we need in order for bug 1533949 to finish.
Specifically, I'm hoping windowGlobalParents can returns only the WindowGlobalParent's from the roots of process-contiguous subtrees.
Hopefully this will help illustrate what I mean by process-contiguous trees:
Suppose that a document has the following frame structure:
a
/ \
b c
/ \ / \
b d c c
/ \
d d
where each letter represents the process that each frame runs in, then we consider
process-contiguous trees of frames to be ones where all frames are directly connected
and running in the same process. Process-contiguous subtrees are denoted in the following
graph with shared numbers.
a1
/ \
b2 c3
/ \ / \
b2 d4 c3 c3
/ \
d4 d5
Specifically, note that the d5 leaf node, while belonging to the same process as the
d4 nodes are not directly connected, so it's not process-contiguous.
| Reporter | ||
Comment 1•7 years ago
|
||
To further illustrate, I've marked the roots of the process contiguous subtrees with a *:
a1*
/ \
b2* c3*
/ \ / \
b2 d4* c3 c3
/ \
d4 d5*
| Assignee | ||
Comment 2•7 years ago
|
||
Thanks for the diagrams, those really helped!
Taking another attempt here, I think we can do this with two pieces.
- <xul:browser>.frameloader.browsingContext.currentWindowGlobalParent (already exists)
a. This should give you 'a' in that diagram - WindowGlobalParent.getNearestRemoteDescendants() (doesn't exist yet)
a. This would give you the closest '' descendants of a given WindowGlobalParent
b. e.g. For a1, you would get [b2*, c3*]. For b2*, you would get [d4*]. For c3*, you would get [d5*].
b. With this you could traverse the contiguous browser tree roots by starting atcurrentWindowGlobalParent
| Assignee | ||
Comment 3•7 years ago
|
||
This commit adds getNearestRemoteDescendants as a way to get the contiguous
browser subtree roots that are descendant from a given WindowGlobalParent.
| Assignee | ||
Comment 4•7 years ago
|
||
This method wasn't correct for what mconley needed and is no longer needed.
Depends on D31505
| Assignee | ||
Comment 5•7 years ago
|
||
Now that bug 1554280 has landed, is it possible to implement this method entirely in JS now?
Roughly something like:
function getNearestRemoteDescendants(frameLoader) {
let result = [];
function visitBC(bc) {
if (!bc) {
return;
}
let wgp = child.currentWindowGlobal;
if (wgp && wgp.isProcessRoot) {
result.push(wgp);
}
for (let child of bc.getChildren()) {
visitBC(child);
}
}
visitBC(frameLoader.browsingContext);
return result;
}
I'm not sure if something additional is needed to filter out BFCache'd WGP's, or if only checking currentWindowGlobal's is enough.
Comment 6•7 years ago
|
||
(In reply to Ryan Hunt [:rhunt] from comment #5)
Now that bug 1554280 has landed, is it possible to implement this method entirely in JS now?
Yeah, it should be doable. Your method is missing a few return calls, (e.g. we shouldn't look at the children of a BC which is also a process root), and has some minor typos (like child instead of bc), but should be correct.
| Reporter | ||
Comment 7•7 years ago
|
||
Cool, yeah, I can use something like that implementation in JS now for the PermitUnload case, so I guess we can close this out as essentially fixed by bug 1554280. Thanks!
Updated•7 years ago
|
| Assignee | ||
Comment 8•7 years ago
|
||
I'm going to reuse this bug to remove the getter that was originally added to solve this problem.
Comment 10•7 years ago
|
||
| bugherder | ||
Description
•