Open Bug 1428130 Opened 7 years ago Updated 3 years ago

remove cookie permission preload after service worker code checks storage access in parent process.

Categories

(Core :: DOM: Service Workers, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: bkelly, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: SW-CLEANUP)

Currently nsDocShell does its own 3rd-party URL, private browsing, etc checks in order to block service worker interception when storage is not allowed. Ideally it should use the nsContentUtils::StorageAllowed*() methods instead. Unfortunately this is not possible currently since nsDocShell sometimes needs this before nsPermissionManager has data in the child process. After we move service worker interception to the parent process we should make sure it uses our proper StorageAllowed code instead of its own side implementation.
We changed plans and are going to preload the cookie permission. Lets use this bug to remove the cookie permission preload once service worker begins checking storage access in the parent process.
Summary: service worker code should use nsContentUtils::StorageAllowed*() methods to block non-subresource interceptions → remove cookie permission preload after service worker code checks storage access in parent process.
Priority: -- → P3
Whiteboard: SW-CLEANUP
No longer blocks: ServiceWorkers-e10s

Not until parent-intercept has stuck. It's only on beta right now and there's some concerns over the performance regressions. Bug 1496997 is where we'll declare victory and start ripping things out.

Flags: needinfo?(bugmail)

We might want to look into removing this code again now, as I believe parent process interception is always on nowadays.

Flags: needinfo?(bugmail)

(In reply to Johann Hofmann [:johannh] from comment #2)

With the blocking bug resolved, can we remove this code again? https://searchfox.org/mozilla-central/rev/ba4fab1cc2f1c9c4e07cdb71542b8d441707c577/extensions/permissions/nsPermissionManager.cpp#120-125

This can be removed now if you want to remove it. Other work to this end is happening in bug 1496997.

Flags: needinfo?(bugmail) → needinfo?(jhofmann)

Unfortunately we're probably using the preload for other things these days, but I lost track of some of the details. Paul is looking into it.

Flags: needinfo?(jhofmann) → needinfo?(pbz)

Preloading of cookie permissions is still a dependency of "cookie" permission OriginAttributes stripping. See comment here: https://searchfox.org/mozilla-central/rev/763b888847ac7291248b62ef3ab99da6ba2332d6/extensions/permissions/PermissionManager.cpp#144-145,148-151
Ideally we wouldn't need to do stripping at all, because we had UI that allowed users to adjust these permissions on a per private browsing / user context level.
Looks like we'll have to keep the preloading for now.

Flags: needinfo?(pbz)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.