This changes how ProcessIsolation handles the generic "web" remote type
within private browsing windows or container tabs, such that these
processes are now allocated as `web=^userContextId=1` or similar, rather
than the generic `web` process.
This shouldn't change process isolation for most content, but will impact
how things like toplevel data URIs are loaded within private browsing
windows or container tabs.
Differential Revision: https://phabricator.services.mozilla.com/D282085
This reverts commit ba92fe5024.
Revert "Bug 2011326 - Part 4: Switch test_sitepolicies to a data URI, r=mossop"
This reverts commit 8eab4714b1.
Revert "Bug 2011326 - Part 3: Remove the test-only canLoadURIInRemoteType function, r=firefox-desktop-core-reviewers ,tabbrowser-reviewers,mossop,sthompson"
This reverts commit 8ce4078eed.
Revert "Bug 2011326 - Part 2: Predict remote types with ProcessIsolation, r=whimboo,geckoview-reviewers,extension-reviewers,tabbrowser-reviewers,omc-reviewers,layout-reviewers,tcampbell,robwu,sthompson,emilio,mimi"
This reverts commit df59bd116e.
Revert "Bug 2011326 - Part 1: Remove test for separatePrivilegedContentProcess=false, r=firefox-desktop-core-reviewers ,tabbrowser-reviewers,mossop,sthompson"
This reverts commit 879157d4f7.
Revert "Bug 2011307 - Remove test-only support for marking chrome:// URI as needing to be loaded remotely, r=smaug,tabbrowser-reviewers,nsharpley"
This reverts commit 2d20aa53d9.
This changes how ProcessIsolation handles the generic "web" remote type
within private browsing windows or container tabs, such that these
processes are now allocated as `web=^userContextId=1` or similar, rather
than the generic `web` process.
This shouldn't change process isolation for most content, but will impact
how things like toplevel data URIs are loaded within private browsing
windows or container tabs.
Differential Revision: https://phabricator.services.mozilla.com/D282085
This changes how ProcessIsolation handles the generic "web" remote type
within private browsing windows or container tabs, such that these
processes are now allocated as `web=^userContextId=1` or similar, rather
than the generic `web` process.
This shouldn't change process isolation for most content, but will impact
how things like toplevel data URIs are loaded within private browsing
windows or container tabs.
Differential Revision: https://phabricator.services.mozilla.com/D282085
This is the last usage of UpdateReflectorGlobal. It was added to bug
1391110 with this commit message:
> We allow swapping frameloaders between unrelated documents, so we need
> to reparent wrappers when the owner content changes.
It seems better to not parent them to a window object and parent them to
the privileged junk scope just like BrowsingContext objects are for
example.
Differential Revision: https://phabricator.services.mozilla.com/D298608
Looking at the existing callers, it seems like basically all of them
actually wanted `CanSend()`, and didn't want this function. This method
is misleading, as it is just a value which returns `true` until
`ActorDestroy()` has been called.
Differential Revision: https://phabricator.services.mozilla.com/D294218
- primary / nodefaultsrc / allowscriptstoclose / forcemessagemanager
are already used as true or not present, so no behavior change.
- remote can be a regular XUL attr, but needs some consumers to change.
While at it remove the unused mozframetype attr, just use type for both
XUL and privileged iframes.
Differential Revision: https://phabricator.services.mozilla.com/D286522
- primary / nodefaultsrc / allowscriptstoclose / forcemessagemanager
are already used as true or not present, so no behavior change.
- remote can be a regular XUL attr, but needs some consumers to change.
While at it remove the unused mozframetype attr, just use type for both
XUL and privileged iframes.
Differential Revision: https://phabricator.services.mozilla.com/D286522
Commit automatically generated through clang-tidy's
performance-use-std-move new pass.
- Maybe type has a dedicated move operator
- And TimingParams also have a dedicated move operator because of Maybe
members
- OwningAnimationTarget benefits from being moved
- nsCOMPtr benefits from being moved
- std::vector benefits from being moved
- std::string benefits from being moved
- SMILTimeValueSpecParams benefits from being moved
Differential Revision: https://phabricator.services.mozilla.com/D285674
Commit automatically generated through clang-tidy's
performance-use-std-move new pass.
- Maybe type has a dedicated move operator
- And TimingParams also have a dedicated move operator because of Maybe
members
- OwningAnimationTarget benefits from being moved
- nsCOMPtr benefits from being moved
- std::vector benefits from being moved
- std::string benefits from being moved
- SMILTimeValueSpecParams benefits from being moved
Differential Revision: https://phabricator.services.mozilla.com/D285674
This patch is to remove the ClonedMessageData type which is currently
frequently used for sending a StructuredCloneData over IPC manually. Instead,
under the new approach, the StructuredCloneData is transferred directly using
its serializer.
This allows for simplification of various types across the codebase which
previously needed complex handling for this manual {de-}serialization step,
especially around keeping the borrowed-from buffers alive in some cases.
As part of this, the type has also been changed to be a threadsafe refcounted
object. This is in part possible due to earlier parts, which have made it safe
to Read() from the same StructuredCloneData object concurrently from multiple
threads (so long as it does not support transferrables).
The underlying data storage within StructuredCloneData was previously already
reference counted (due to SharedJSAllocatedData).
In addition to StructuredCloneData, other data structures (e.g.
nsStructuredCloneContainer and SharedMessageBody) have also been updated to be
serialized directly, avoiding now-unnecessary intermediate objects.
Differential Revision: https://phabricator.services.mozilla.com/D281115
This reverts commit 72c32e25bf.
Revert "Bug 2013389 - Part 11: Make attachment arrays more consistent in StructuredCloneHolder, r=asuth"
This reverts commit c0912428c7.
Revert "Bug 2013389 - Part 10: Fix version tracking in nsStructuredCloneContainer, r=asuth,extension-reviewers,spidermonkey-reviewers,sfink,robwu"
This reverts commit f2e9691831.
Revert "Bug 2013389 - Part 9: Remove the now-unused ReadFromBuffer method, r=asuth"
This reverts commit 6eb034458e.
Revert "Bug 2013389 - Part 8: Avoid the unnecessary ClonedMessageData intermediate, r=asuth,mccr8,extension-reviewers,dom-worker-reviewers,robwu"
This reverts commit 4dd6f1d6ea.
Revert "Bug 2013389 - Part 7: Only deserialize once in nsFrameMessageManager, r=asuth"
This reverts commit 65d16af619.
Revert "Bug 2013389 - Part 6: Remove weak listener support from MessageManager, r=smaug"
This reverts commit 66f4b308a0.
Revert "Bug 2013389 - Part 5: Broadcasting MessageManagers cannot support transferrables, r=asuth"
This reverts commit e95e1a5a6c.
Revert "Bug 2013389 - Part 4: Avoid depending on mErrorMessage when deserializing StructuredCloneHolder, r=asuth,dom-worker-reviewers"
This reverts commit ae78c69357.
Revert "Bug 2013389 - Part 3: Remove aGlobal argument from StructuredCloneHolder::Read, r=asuth,dom-worker-reviewers"
This reverts commit 066bd37bfd.
Revert "Bug 2013389 - Part 2: Stop tracking mGlobal within StructuredCloneHolder::Read, r=asuth"
This reverts commit 6b4f3a43c0.
Revert "Bug 2013389 - Part 1: Add an Adopt API to StructuredCloneHolder, r=asuth"
This reverts commit 8624db71c2.
This patch is to remove the ClonedMessageData type which is currently
frequently used for sending a StructuredCloneData over IPC manually. Instead,
under the new approach, the StructuredCloneData is transferred directly using
its serializer.
This allows for simplification of various types across the codebase which
previously needed complex handling for this manual {de-}serialization step,
especially around keeping the borrowed-from buffers alive in some cases.
As part of this, the type has also been changed to be a threadsafe refcounted
object. This is in part possible due to earlier parts, which have made it safe
to Read() from the same StructuredCloneData object concurrently from multiple
threads (so long as it does not support transferrables).
The underlying data storage within StructuredCloneData was previously already
reference counted (due to SharedJSAllocatedData).
In addition to StructuredCloneData, other data structures (e.g.
nsStructuredCloneContainer and SharedMessageBody) have also been updated to be
serialized directly, avoiding now-unnecessary intermediate objects.
Differential Revision: https://phabricator.services.mozilla.com/D281115
This reverts commit 5c5cf7465b.
Revert "Bug 2013389 - Part 10: Fix version tracking in nsStructuredCloneContainer, r=asuth,extension-reviewers,spidermonkey-reviewers,sfink,robwu"
This reverts commit c87a327d86.
Revert "Bug 2013389 - Part 9: Remove the now-unused ReadFromBuffer method, r=asuth"
This reverts commit 5adf49e5d8.
Revert "Bug 2013389 - Part 8: Avoid the unnecessary ClonedMessageData intermediate, r=asuth,mccr8,extension-reviewers,dom-worker-reviewers,robwu"
This reverts commit f6d12563fe.
Revert "Bug 2013389 - Part 7: Only deserialize once in nsFrameMessageManager, r=asuth"
This reverts commit 44c1325d76.
Revert "Bug 2013389 - Part 6: Remove weak listener support from MessageManager, r=smaug"
This reverts commit 1d1b495c91.
Revert "Bug 2013389 - Part 5: Broadcasting MessageManagers cannot support transferrables, r=asuth"
This reverts commit e2eb75ff8f.
Revert "Bug 2013389 - Part 4: Avoid depending on mErrorMessage when deserializing StructuredCloneHolder, r=asuth,dom-worker-reviewers"
This reverts commit d9a234ad7b.
Revert "Bug 2013389 - Part 3: Remove aGlobal argument from StructuredCloneHolder::Read, r=asuth,dom-worker-reviewers"
This reverts commit 48279cea50.
Revert "Bug 2013389 - Part 2: Stop tracking mGlobal within StructuredCloneHolder::Read, r=asuth"
This reverts commit 27162e5046.
Revert "Bug 2013389 - Part 1: Add an Adopt API to StructuredCloneHolder, r=asuth"
This reverts commit e3a9f32716.
This patch is to remove the ClonedMessageData type which is currently
frequently used for sending a StructuredCloneData over IPC manually. Instead,
under the new approach, the StructuredCloneData is transferred directly using
its serializer.
This allows for simplification of various types across the codebase which
previously needed complex handling for this manual {de-}serialization step,
especially around keeping the borrowed-from buffers alive in some cases.
As part of this, the type has also been changed to be a threadsafe refcounted
object. This is in part possible due to earlier parts, which have made it safe
to Read() from the same StructuredCloneData object concurrently from multiple
threads (so long as it does not support transferrables).
The underlying data storage within StructuredCloneData was previously already
reference counted (due to SharedJSAllocatedData).
In addition to StructuredCloneData, other data structures (e.g.
nsStructuredCloneContainer and SharedMessageBody) have also been updated to be
serialized directly, avoiding now-unnecessary intermediate objects.
Differential Revision: https://phabricator.services.mozilla.com/D281115
This commit removes the unsuccessful deferring of notifications around
BrowserChild::Init and and narrows when we ignore a failure in
nsDocShell::Initialize.
Differential Revision: https://phabricator.services.mozilla.com/D279293
After the previous patches, nsViewManager is basically a backpointer to
its pres shell.
Remove it and just make PresShell manage the root view directly. After
this is done, we can decide what to do about nsView (which is itself
little more than a widget listener that forwards to pres shell right
now).
This technically starts listening to mParentWidget slightly later (on
pres shell creation), but I think that's ok.
Differential Revision: https://phabricator.services.mozilla.com/D272890
This allows to clean up even more view code, since views now are just a
link between layout and widget at the root and little else (so the whole
view children and so on can go), but that will be done in separate
patches since these patches are not risk-free.
Notable changes:
* PresShell::WillPaint() now recurses into subdocuments. That was done
previously via CallWillPaintOnObservers().
* Embedder frame is tracked directly by nsSubDocumentFrame an
PresShell. It might be possible to simplify this further,
if bug 1997773 sticks.
Differential Revision: https://phabricator.services.mozilla.com/D232057
Yeah, I know... non-trivial one-liner.
I found some weirdness while looking at bug 1994942. Issue is that I
tried to remove the nsView dependency by looking at the embedder
element (right now layout goes from child to parent frame via the view
tree).
This mostly works, except when the presshell is destroyed after the
frameloader. This patch prevents that from happening and makes the
timing a bit more predictable between subframes / reframes and process
switches, even though I ultimately found a workaround for that bug.
Differential Revision: https://phabricator.services.mozilla.com/D270957
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706