gecko-dev/dom/workers
Perry Jiang 87c3eb5a96 Bug 1575185 - Subscribe content processes spawning Service Workers to permission updates r=asuth
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
2019-10-09 02:23:41 +00:00
..
remoteworkers Bug 1575185 - Subscribe content processes spawning Service Workers to permission updates r=asuth 2019-10-09 02:23:41 +00:00
sharedworkers
test Bug 1581710 - Update WebGPU IDL bindings r=jgilbert,bzbarsky 2019-10-02 16:46:03 +00:00
ChromeWorker.cpp
ChromeWorker.h
ChromeWorkerScope.cpp
ChromeWorkerScope.h
JSSettings.h
MessageEventRunnable.cpp
MessageEventRunnable.h
moz.build
nsIWorkerDebugger.idl
nsIWorkerDebuggerManager.idl
Principal.cpp Bug 1576254 - Cut WorkerPrincipal over to a real object and implement isSystemOrAddonPrincipal r=baku 2019-10-04 17:37:09 +00:00
Principal.h Bug 1576254 - Cut WorkerPrincipal over to a real object and implement isSystemOrAddonPrincipal r=baku 2019-10-04 17:37:09 +00:00
Queue.h
RegisterBindings.cpp
RuntimeService.cpp Bug 1583949 - Add a check for IsEvalAllowed to the worker callpath for eval() r=ckerschb,baku 2019-10-08 17:31:35 +00:00
RuntimeService.h
ScriptLoader.cpp
ScriptLoader.h
Worker.cpp Bug 1562663 - P4a - Deny sharing memery by default for DataClonePolicy; r=nika,lth 2019-09-26 13:27:25 +00:00
Worker.h
WorkerCommon.h
WorkerCSPEventListener.cpp
WorkerCSPEventListener.h
WorkerDebugger.cpp
WorkerDebugger.h
WorkerDebuggerManager.cpp
WorkerDebuggerManager.h
WorkerError.cpp
WorkerError.h
WorkerEventTarget.cpp
WorkerEventTarget.h
WorkerLoadInfo.cpp Bug 1576254 - Cut WorkerPrincipal over to a real object and implement isSystemOrAddonPrincipal r=baku 2019-10-04 17:37:09 +00:00
WorkerLoadInfo.h Bug 1576254 - Cut WorkerPrincipal over to a real object and implement isSystemOrAddonPrincipal r=baku 2019-10-04 17:37:09 +00:00
WorkerLocation.cpp
WorkerLocation.h
WorkerNavigator.cpp Bug 1581710 - Update WebGPU IDL bindings r=jgilbert,bzbarsky 2019-10-02 16:46:03 +00:00
WorkerNavigator.h Bug 1581710 - Update WebGPU IDL bindings r=jgilbert,bzbarsky 2019-10-02 16:46:03 +00:00
WorkerPrivate.cpp Bug 1576254 - Move Clamping and Jittering from RealmCreationOptions to Behaviors r=luke 2019-10-04 17:35:26 +00:00
WorkerPrivate.h Bug 1576254 - Cut WorkerPrincipal over to a real object and implement isSystemOrAddonPrincipal r=baku 2019-10-04 17:37:09 +00:00
WorkerRef.cpp
WorkerRef.h
WorkerRunnable.cpp
WorkerRunnable.h
WorkerScope.cpp Backed out changeset 41c6b7e917fd (bug 1367251) for mochitest failures at test_conformance__textures__image_bitmap_from_blob__tex-2d-luminance-luminance-unsigned_byte.html. CLOSED TREE 2019-10-07 04:46:13 +03:00
WorkerScope.h Backed out changeset 41c6b7e917fd (bug 1367251) for mochitest failures at test_conformance__textures__image_bitmap_from_blob__tex-2d-luminance-luminance-unsigned_byte.html. CLOSED TREE 2019-10-07 04:46:13 +03:00
WorkerStatus.h
WorkerThread.cpp
WorkerThread.h