This patch changes how BrowsingContextGroups track CrossOriginIsolated
status such that it should be more consistently tracked and easier to
assert in the places which depend on it. In the new state of the world,
a flag is stored within the BCG's ID which tracks whether it was
created for cross-origin isolated documents, and that is also checked
when making decisions about how to isolate initial about:blank
documents, and whether to allow certain changes to
CrossOriginOpenerPolicy.
This flag is stashed within the ID, as it needs to be preserved if the
BCG is destroyed and then re-created from the ID (which may be e.g.
round-tripped through JS code). I also considered making the ID be a
string instead, to make it easier to include extra information like
this, and more clear where the information is stored, however :kmag
generally preferred using a bit within the integer ID.
These new assertions should now be less likely to spuriously fail due to
a DocShell disappearing or similar as well, which should help fix the
original issue.
Differential Revision: https://phabricator.services.mozilla.com/D152695
After the previous changes there was only one consumer left of the Shmem
version of GetSurfaceData, which could easily be changed to use BigBuffer,
removing the need for that overload.
After that consumer is removed, the interface was also simplified as the
generic logic in the implementation was no longer necessary.
Differential Revision: https://phabricator.services.mozilla.com/D151854
The ShmemImage type was previously implemented using a Shmem, however due to
the usage patterns, `BigBuffer` is probably a better fit, and allows unifying
more code in nsContentUtils.
Differential Revision: https://phabricator.services.mozilla.com/D151853
The IPCDataTransfer type is used to transfer Clipboard/Drag & Drop payloads
over IPC to allow them to be written to or read from the relevant system
interfaces. Previously, the system which was used was somewhat complex, and
tried to use Shmem in some cases to store buffers out of line. Now that
BigBuffer is available, it can be simplified substantially.
In addition, this change removed the memory buffer overload of GetSurfaceData,
as the only consumer was using it to immediately send the payload over IPC as a
nsCString. It was changed to instead use `BigBuffer` as that is more efficient
in a large buffer situation, and reduces the number of required copies.
Differential Revision: https://phabricator.services.mozilla.com/D151852
After the previous changes there was only one consumer left of the Shmem
version of GetSurfaceData, which could easily be changed to use BigBuffer,
removing the need for that overload.
After that consumer is removed, the interface was also simplified as the
generic logic in the implementation was no longer necessary.
Differential Revision: https://phabricator.services.mozilla.com/D151854
The ShmemImage type was previously implemented using a Shmem, however due to
the usage patterns, `BigBuffer` is probably a better fit, and allows unifying
more code in nsContentUtils.
Differential Revision: https://phabricator.services.mozilla.com/D151853
The IPCDataTransfer type is used to transfer Clipboard/Drag & Drop payloads
over IPC to allow them to be written to or read from the relevant system
interfaces. Previously, the system which was used was somewhat complex, and
tried to use Shmem in some cases to store buffers out of line. Now that
BigBuffer is available, it can be simplified substantially.
In addition, this change removed the memory buffer overload of GetSurfaceData,
as the only consumer was using it to immediately send the payload over IPC as a
nsCString. It was changed to instead use `BigBuffer` as that is more efficient
in a large buffer situation, and reduces the number of required copies.
Differential Revision: https://phabricator.services.mozilla.com/D151852
We want to signal content processes to cancel content JS unconditionally on shutdown.
In the case of parent shutdown this has to happen as early as "quit-application-granted", given that both extensions and session storage shutdown rely on the possibility to interact with content processes (which is not possible when they are inside long running JS).
In addition in the case of a normal child shutdown we cancel content JS execution, too.
For now we put this behind the pref "dom.abort_script_on_child_shutdown" which remains default off.
Depends on D150539
Differential Revision: https://phabricator.services.mozilla.com/D150598
These flags are usually initialized very early on, but because child processes are
pre-allocated and then later specialized for a specific process type, we need to
reset them later. This patch adds a new API for this that has some extra assertions.
Differential Revision: https://phabricator.services.mozilla.com/D152373
We want to signal content processes to cancel content JS unconditionally on shutdown.
In the case of parent shutdown this has to happen as early as "quit-application-granted", given that both extensions and session storage shutdown rely on the possibility to interact with content processes (which is not possible when they are inside long running JS).
In addition in the case of a normal child shutdown we cancel content JS execution, too.
For now we put this behind the pref "dom.abort_script_on_child_shutdown" which remains default off.
Depends on D150539
Differential Revision: https://phabricator.services.mozilla.com/D150598
This patch moves EqualsIgnoreCase to ns[T]StringObsolete, and removes
the aCount argument, instead migrating callers to use `StringBeginsWith`
with a case-insensitive comparator.
In addition, nsTStringRepr::Compare was removed and replaced with either
calls to methods like `StringBeginsWith` or the global `Compare` method.
These changes required some modifications at call-sites but should make
the behaviour less surprising and more consistent.
Differential Revision: https://phabricator.services.mozilla.com/D148299
This prevents copies and avoids the hack we have to avoid this, which
right now is using nsDependent{C,}String.
Non-virtual actors can still use `nsString` if they need to on the
receiving end.
Differential Revision: https://phabricator.services.mozilla.com/D152519
Instead of trying to send a too-big message, send a short message starting
with '*', which the parent can put into the profileGatheringLog.
Note: The `CollectProfileOrEmptyString` is now only used by GrabShutdownProfile
(it was previously also used by RecvGatherProfile before it went async). Since
this patch is completely changing its implementation, we may as well fold it
back into its only caller.
Differential Revision: https://phabricator.services.mozilla.com/D152027
We want to signal content processes to cancel content JS unconditionally on shutdown.
In the case of parent shutdown this has to happen as early as "quit-application-granted", given that both extensions and session storage shutdown rely on the possibility to interact with content processes (which is not possible when they are inside long running JS).
In addition in the case of a normal child shutdown we cancel content JS execution, too.
For now we put this behind the pref "dom.abort_script_on_child_shutdown" which remains default off.
Depends on D150539
Differential Revision: https://phabricator.services.mozilla.com/D150598
When the session storage prefs are enabled, GeckoSession updateSessionState will provide the bundle of information, including zoom, scroll, and form data, to the delegate. Currently works for Fission and on Fenix.
Differential Revision: https://phabricator.services.mozilla.com/D148215
When setting focus to input element, Gecko sets focused element to central via
`zoomToFocusedInput`. So when we receives `focusin` event, content may be
scrolled and zoomed. To pass correct element rectangle, we have to wait until
it is completed.
Fennec added `PanZoom:StateChange` event to listen APZ state. So GV should use
same way.
Differential Revision: https://phabricator.services.mozilla.com/D150453
When the session storage prefs are enabled, GeckoSession updateSessionState will provide the bundle of information, including zoom, scroll, and form data, to the delegate. Currently works for Fission and on Fenix.
Differential Revision: https://phabricator.services.mozilla.com/D148215
When setting focus to input element, Gecko sets focused element to central via
`zoomToFocusedInput`. So when we receives `focusin` event, content may be
scrolled and zoomed. To pass correct element rectangle, we have to wait until
it is completed.
Fennec added `PanZoom:StateChange` event to listen APZ state. So GV should use
same way.
Differential Revision: https://phabricator.services.mozilla.com/D150453
Before this patch, we would set REPLACE_HISTORY loading flag by calling SetLoadFlags which did not result in replacing history item and would add a new history item instead. That would lead to SSL error if navigating back after https-only error bypass. This patch corrects that by setting the flag on the load type instead (that is what used to happen under the hood before patch for 1697866 was merged)
Differential Revision: https://phabricator.services.mozilla.com/D151182
The current implementation of TimelineConsumers contains some unnecessary
complexity due to how it is initialized as a singleton, and the need for it to
be initialized and used in a threadsafe way. This patch attempts to simplify it
by making all members static, and removing the need to explicitly observe
shutdown for cleanup.
In addition, this approach avoids the risk of the type being accessed from
off-main-thread during initialization or shutdown.
Depends on D150442
Differential Revision: https://phabricator.services.mozilla.com/D150443
The main goal here is to get the wireframe test to work with
parent-controlled navigation.
This means we don't need to collect the wireframe any more in
PersistLayoutHistoryState, I think, because it is redundant.
I think we need to clear the wireframe in finish restore for
when we navigate back.
As a result of these changes, the two todo subtests in the
wireframe test now pass.
Differential Revision: https://phabricator.services.mozilla.com/D146252
This patch aims to be minimally invasive. In order to do this it deals a lot with raw JSON strings. This makes the end product be rather unfortunate indentation wise. Considering this is processed by our testing infrastructure internally at this point it seems reasonable to defer 'prettifying' this, since it would be quite a complicated task.
Differential Revision: https://phabricator.services.mozilla.com/D149949
When the session storage prefs are enabled, GeckoSession updateSessionState will provide the bundle of information, including zoom, scroll, and form data, to the delegate. Currently works for Fission and on Fenix.
Differential Revision: https://phabricator.services.mozilla.com/D148215
When the session storage prefs are enabled, GeckoSession updateSessionState will provide the bundle of information, including zoom, scroll, and form data, to the delegate. Currently works for Fission and on Fenix.
Differential Revision: https://phabricator.services.mozilla.com/D148215
It was needed before we had remote lookandfeel and non-native theme, but now we
no longer call any of the APIs in child processes.
Differential Revision: https://phabricator.services.mozilla.com/D149907
We want to skip InitRendering only when parent side does not requested to connect layers. Current implementation is not clear about meaning of "mLayersConnected == Some(false)". It has the following 2 meanings.
[1] parent side does not request to connect layers.
[2] parent side requested to connect layers, but the connect was failed.
We need to distinguish between [1] and [2]. mLayersConnectRequested is added for it.
Differential Revision: https://phabricator.services.mozilla.com/D149637
In bug 1728062 we made it so that we that we skip
BrowserChild::ReinitRendering if the BrowserChild is not connected to
a compositor. This was in order to avoid initializing the compositor
for windowless browsers.
However, in cases where the GPU process dies before an initial
InitRendering has completed, then the BrowserChild will also be left
not connected to a compositor, with mLayersConnected == Some(false).
ReinitRendering will be called once the new GPU process has been
launched, but due to this condition we will exit early, and the tab
will be left in an unusable state.
To fix this, this patch changes the early return condition to only
check for mLayersConnected.isNothing(), ie we never even attempted to
initialize rendering. When it is Some(false), ie we attempted and
failed, then ReinitializeRendering is still executed.
Differential Revision: https://phabricator.services.mozilla.com/D149619