Allow restricting JS Window Actors to specific remoteTypes
Categories
(Core :: IPC, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: nika, Assigned: jdai)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 2 obsolete files)
This could look something like this:
dictionary WindowActorOptions {
// ...
// Optional list of regular expressions for remoteTypes which are
// allowed to instantiate this actor. If not passed, all content
// processes are allowed to instantiate the actor.
sequence<DOMString> remoteTypes;
};
Updated•6 years ago
|
Comment 1•6 years ago
|
||
Nika said she'll be adding more pointers for jdai's work here.
Reporter | ||
Comment 2•6 years ago
|
||
This check should be added to the same Matches
function which you added in bug 1523982. Information about the remote type which is being considered will have to be passed in as an extra const nsString& aRemoteType
parameter.
For a WindowGlobalParent
the remote type can be fetched like this:
RefPtr<WindowGlobalParent> wgp = ...;
nsAutoString remoteType;
if (RefPtr<TabParent> tp = wgp->GetTabParent()) {
remoteType = tp->Manager()->GetRemoteType();
} else {
remoteType = VoidString();
}
For a WindowGlobalChild
, the remote type can be fetched like this:
nsAutoString remoteType;
if (XRE_IsContentProcess()) {
remoteType = ContentChild::GetSingleton()->GetRemoteType();
} else {
remoteType = VoidString();
}
The field should be on the WindowActorOptions
dictionary:
dictionary WindowActorOptions {
// ...
DOMString? remoteType;
};
The type in native will be Optional<nsString>
. If WasPassed()
is false, we ignore the remoteType
, otherwise check that it matches the value retrieved above, and return false otherwise.
Assignee | ||
Comment 3•6 years ago
|
||
Thank you for your valuable input. :)
Assignee | ||
Comment 4•6 years ago
|
||
Assignee | ||
Comment 5•6 years ago
|
||
Depends on D24733
Assignee | ||
Comment 6•6 years ago
|
||
Assignee | ||
Comment 7•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 8•6 years ago
|
||
My old patches were base on bug 1523982 since bug 1523982 was landed, I was trying to rebase my patches to central, but it seems that I can't update patches from arc/phlay to different parent, hence, I send new patches for review. Sorry for any inconvenience.
Comment 10•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/99c4c6989e06
https://hg.mozilla.org/mozilla-central/rev/28c8708ee20e
Description
•