We should use the parititoned principal when creating clientSource in
WorkerPrivate if the workerPrivate is in third-party context.
Differential Revision: https://phabricator.services.mozilla.com/D132370
When loading the main worker script, we will need to get the clientInfo
for the loading channel. However, the loading channel is created in
content processes and the `IsThirdPartyContextToTopWindow` won't be set
in this case. So, we will get an incorrect clientInfo with a wrong
foreign patitioned principal.
To resolve this, we have to set the flag in the content processes so
that we can get a correct clientInfo. The flag comes from the
workerPrivate which reflects the fact if the worker was created in a
third-party context. And the loading channel should have the same flag
as the document which creates the worker.
Differential Revision: https://phabricator.services.mozilla.com/D129060
To know if a worker is created under a third-party context, we need to
populate the `IsThirdPartyContextToTopWindow` to WorkerPrivate. This is
needed to get the correct foreign partitioned prinipal when loading
worker script in the content processes.
Differential Revision: https://phabricator.services.mozilla.com/D129059
Introduce a TENTATIVE state for a feature that allows the shell flags
to be used more flexibly: the feature is enabled bug --wasm-whatever
can be used as a no-op. This helps reduce breakage while we're in the
process of enabling a feature by default.
Finesse the EXPERIMENTAL state so that --no-wasm-whatever is accepted
as a no-op.
Differential Revision: https://phabricator.services.mozilla.com/D132017
This commit replaces IPCInternalResponse with three different structs:
ParentToParentInternalResponse, ParentToChildInternalResponse, and
ChildToParentInternalResponse. Doing this lets us convert runtime
checks into compile-time type checks and simplifies relevant code.
Differential Revision: https://phabricator.services.mozilla.com/D131275
We cannot access ClientWebGLContext::mCanvasElement or its associated
nsIPrincipal off the main thread. We use the hash value of the principal
to limit how many WebGL contexts a single domain can create. We can
compute this when the worker is initialized for OffscreenCanvas worker
instances.
Differential Revision: https://phabricator.services.mozilla.com/D128530
OffscreenCanvas can be run on worker threads and is disabled by default.
The existing code trips asserts because we try to use the document,
which is main thread only, directly on the worker thread. This patch
caches the resist fingerprinting status for the worker when it is
created for future reference.
Differential Revision: https://phabricator.services.mozilla.com/D128510
`profiler_thread_is_being_profiled` is used a lot for markers, so it makes sense to have a specialized version, which is a bit shorter, and lives in ProfilerMarkers.h.
Differential Revision: https://phabricator.services.mozilla.com/D130009
When loading the main worker script, we will need to get the clientInfo
for the loading channel. However, the loading channel is created in
content processes and the `IsThirdPartyContextToTopWindow` won't be set
in this case. So, we will get an incorrect clientInfo with a wrong
foreign patitioned principal.
To resolve this, we have to set the flag in the content processes so
that we can get a correct clientInfo. The flag comes from the
workerPrivate which reflects the fact if the worker was created in a
third-party context. And the loading channel should have the same flag
as the document which creates the worker.
Differential Revision: https://phabricator.services.mozilla.com/D129060
To know if a worker is created under a third-party context, we need to
populate the `IsThirdPartyContextToTopWindow` to WorkerPrivate. This is
needed to get the correct foreign partitioned prinipal when loading
worker script in the content processes.
Differential Revision: https://phabricator.services.mozilla.com/D129059
This patch includes changes needed to notify the WebExtensions internals
when a background service worker script has been fully loaded, through a
NotifyWorkerLoadedRunnable (dispatched as low priority) that calls a new
mozIExtensionAPIRequestHandler.onExtensionWorkerLoaded method.
Differential Revision: https://phabricator.services.mozilla.com/D124701
This patch adds additional changes needed to notify, from WorkerPrivate ExecutionReady,
the WebExtensions internals that a new background service worker is ready to be executed,
and its related ExtensionWorkerContextChild should be created and initialized.
Differential Revision: https://phabricator.services.mozilla.com/D124700
This patch introduces the following changes:
- In WorkerPrivate::ExtensionAPIAllowed: removed assertion on StaticPrefs::extensions_backgroundServiceWorker_enabled_AtStartup,
replaced with just ignoring mExtensionAPIAllowed if the feature is turned out by prefs
- Added a new CreateAndDispatchWorkerDestroyedRunnable helper function to create and dispatch
a runnable (as a low priority one) to call a new mozIExtensionAPIRequestHandler.onExtensionWorkerDestroyed
method.
The service worker that has been destroyed is identified by its descriptor ID (the descriptor ID is an integer,
assigned on the main process to each ServiceWorkerPrivate instance, and still available when the worker is
already being destroyed).
Differential Revision: https://phabricator.services.mozilla.com/D124697
This patch includes changes needed to notify the WebExtensions internals
when a background service worker script has been fully loaded, through a
NotifyWorkerLoadedRunnable (dispatched as low priority) that calls a new
mozIExtensionAPIRequestHandler.onExtensionWorkerLoaded method.
Differential Revision: https://phabricator.services.mozilla.com/D124701
This patch adds additional changes needed to notify, from WorkerPrivate ExecutionReady,
the WebExtensions internals that a new background service worker is ready to be executed,
and its related ExtensionWorkerContextChild should be created and initialized.
Differential Revision: https://phabricator.services.mozilla.com/D124700
This patch introduces the following changes:
- In WorkerPrivate::ExtensionAPIAllowed: removed assertion on StaticPrefs::extensions_backgroundServiceWorker_enabled_AtStartup,
replaced with just ignoring mExtensionAPIAllowed if the feature is turned out by prefs
- Added a new CreateAndDispatchWorkerDestroyedRunnable helper function to create and dispatch
a runnable (as a low priority one) to call a new mozIExtensionAPIRequestHandler.onExtensionWorkerDestroyed
method.
The service worker that has been destroyed is identified by its descriptor ID (the descriptor ID is an integer,
assigned on the main process to each ServiceWorkerPrivate instance, and still available when the worker is
already being destroyed).
Differential Revision: https://phabricator.services.mozilla.com/D124697
`profiler_thread_is_being_profiled` is used a lot for markers, so it makes sense to have a specialized version, which is a bit shorter, and lives in ProfilerMarkers.h.
Differential Revision: https://phabricator.services.mozilla.com/D130009