It looks like there could be a race condition where GetTerminationPromise()
is called at the same time on two threads on an empty MozPromiseHolder, and one
of the MozPromises created by MozPromiseHolder::Ensure if leaked (and its
chained callbacks never called).
Additionally, I don't think the ParentStatusProtected() > Running check is
necessary because for ServiceWorkers, the global can't call close(), so the
parent status is at least "Canceling", making the CloseWorkerOnMainThread call
unnecessary (which just calls WorkerPrivate::Cancel). The parent process also
will always send a termination operation as the last operation, so we can just
rely on that to make sure the worker is fully terminated.
Differential Revision: https://phabricator.services.mozilla.com/D56277
--HG--
extra : moz-landing-system : lando
Also, StructuredCloneHolder::CustomWriteTransferHandler() no longer appends an
unused element to mPortIdentifiers when MessagePort::CanBeCloned() returns
false.
Differential Revision: https://phabricator.services.mozilla.com/D55213
--HG--
extra : moz-landing-system : lando
Also, StructuredCloneHolder::CustomWriteTransferHandler() no longer appends an
unused element to mPortIdentifiers when MessagePort::CanBeCloned() returns
false.
Differential Revision: https://phabricator.services.mozilla.com/D55213
--HG--
extra : moz-landing-system : lando
Preventing RemoteWorkerService from existing in "web COOP+COEP" content
processes prevents Shared/ServiceWorkers from being spawned in them because there
won't be an associated RemoteWorkerServiceParent that registers with the parent
process RemoteWorkerManager.
Differential Revision: https://phabricator.services.mozilla.com/D50815
--HG--
extra : moz-landing-system : lando
Previously, Service Workers could spawn in a process that isn't subscribed
to permission updates, which could happen if that process hadn't loaded any
same-origin documents. To address this, parent-process logic for spawning
Service Workers would snapshot the permissions state to be sent to a content
process.
Unfortunately, this approach could lead to outdated, unsynchronized permissions.
Note that nsIPermissionManager::SetPermissionsWithKey is only used to initialize
permissions for a given key and is a no-op if already called with the same key
in a given process. As a result, the following sequence of events could happen:
Assume a content process CP that isn't subscribed to permission changes for an
origin A:
1) Parent process decides to spawn an origin A Service Worker in CP,
snapshotting a value V for permission P.
2) The Service Worker is spawned in CP, setting CP's permission manager's
permission P to value V (for origin A).
3) Parent process updates its permission P to a value A', which is not
broadcasted to CP (because it's not subscribed).
4) By now, the initial Service Worker has been terminated, and the parent
process decides once again to spawn an origin A Service Worker in CP.
5) The Service Worker is spawned in CP, but the call to SetPermissionsWithKey
is a no-op, leaving CP1 with a mismatched value for permission P.
An additional scenario is if the parent process updates a permission during a
remote Service Worker's lifetime.
This patch, which would subscribe CP1 to permission updates when the parent
process knows a Service Worker would be spawned in CP1, prevents these problems.
Differential Revision: https://phabricator.services.mozilla.com/D48620
--HG--
extra : moz-landing-system : lando
With Fission, the remote type can have the form webIsolated= in
addition to web. IsWebRemoteType() handles both of these cases.
Differential Revision: https://phabricator.services.mozilla.com/D45378
--HG--
extra : moz-landing-system : lando
Dedicated workers should be in the same agent cluster with its parent/creator.
The other workers (ShareWorker/ServiceWorker/ChromeWorker) create another agent
cluster when they are created from the creator.
Differential Revision: https://phabricator.services.mozilla.com/D43241
--HG--
extra : moz-landing-system : lando
The args are sent from the parent process main thread to the parent process
background thread and then from the background thread to a content process
worker launcher thread.
Differential Revision: https://phabricator.services.mozilla.com/D26173
--HG--
extra : moz-landing-system : lando
The args are sent from the parent process main thread to the parent process
background thread and then from the background thread to a content process
worker launcher thread.
Differential Revision: https://phabricator.services.mozilla.com/D26173
--HG--
extra : moz-landing-system : lando
The args are sent from the parent process main thread to the parent process
background thread and then from the background thread to a content process
worker launcher thread.
Differential Revision: https://phabricator.services.mozilla.com/D26173
--HG--
extra : moz-landing-system : lando
The args are sent from the parent process main thread to the parent process
background thread and then from the background thread to a content process
worker launcher thread.
Differential Revision: https://phabricator.services.mozilla.com/D26173
--HG--
extra : moz-landing-system : lando