Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookie Store: Rework the SW change events API. #19616

Merged
merged 1 commit into from Nov 27, 2019

Conversation

@chromium-wpt-export-bot
Copy link
Collaborator

chromium-wpt-export-bot commented Oct 10, 2019

Looking into two crashers revealed misconceptions in the initial Cookie
Store API implementation for change events in service works. This CL
reworks the API surface and brings it closer to other features.

The current API shape is that a SW version specifies the cookie changes
it's interested in by calling subscribeToCookieChanges() on the SW
global scope. getChangeSubscriptions() is available on the SW global
scope, and reflects the cumulative effect of all
subscribeToCookieChanges() calls during the install event.
Implementation errors aside, this API shape doesn't have a simple model
for continuously monitoring a cookie's change -- in the window between
deactivating an old SW version and activating the new version, there is
no obvious list of cookie change subscriptions.

The new API shape brings Cookie Store in line with the other SW APIs.
Cookie change subscriptions are associated with the SW registration, and
can be managed using
registration.cookies.{subscribe,unsubscribe,getSubscriptions}().

Unlike other SW APIs, the registration's subscriptions can be managed
from the SW itself, as well as from windows. We expect that most
applications will prefer to manage subscriptions from the SW code. This
exposes a rough edge -- a registration cannot be modified until the
first version of a SW is installed, so the methods listed above will
fail during a SW's first install event, but succeed during later install
events. We intend to evaluate the impact of this rough edge in an Origin
Trial.

Associated spec change: WICG/cookie-store#111

Bug: 729800, 956732, 963042
Change-Id: I106a7d9b2e50a7304c5ad126e0f699ecac1de531
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1837146
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Staphany Park <staphany@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719476}

Copy link
Collaborator

wpt-pr-bot left a comment

Already reviewed downstream.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-1837146 branch 2 times, most recently from dba6836 to 54610a7 Oct 11, 2019
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-1837146 branch 2 times, most recently from d7c8b3b to cfcf365 Oct 29, 2019
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-1837146 branch 5 times, most recently from e29de4f to c721cba Nov 19, 2019
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-1837146 branch 3 times, most recently from 53f3795 to 64738ec Nov 26, 2019
Looking into two crashers revealed misconceptions in the initial Cookie
Store API implementation for change events in service works. This CL
reworks the API surface and brings it closer to other features.

The current API shape is that a SW version specifies the cookie changes
it's interested in by calling subscribeToCookieChanges() on the SW
global scope. getChangeSubscriptions() is available on the SW global
scope, and reflects the cumulative effect of all
subscribeToCookieChanges() calls during the install event.
Implementation errors aside, this API shape doesn't have a simple model
for continuously monitoring a cookie's change -- in the window between
deactivating an old SW version and activating the new version, there is
no obvious list of cookie change subscriptions.

The new API shape brings Cookie Store in line with the other SW APIs.
Cookie change subscriptions are associated with the SW registration, and
can be managed using
registration.cookies.{subscribe,unsubscribe,getSubscriptions}().

Unlike other SW APIs, the registration's subscriptions can be managed
from the SW itself, as well as from windows. We expect that most
applications will prefer to manage subscriptions from the SW code. This
exposes a rough edge -- a registration cannot be modified until the
first version of a SW is installed, so the methods listed above will
fail during a SW's first install event, but succeed during later install
events. We intend to evaluate the impact of this rough edge in an Origin
Trial.

Associated spec change: WICG/cookie-store#111

Bug: 729800, 956732, 963042
Change-Id: I106a7d9b2e50a7304c5ad126e0f699ecac1de531
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1837146
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Staphany Park <staphany@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719476}
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-1837146 branch from 64738ec to 008f050 Nov 27, 2019
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 1139606 into master Nov 27, 2019
13 checks passed
13 checks passed
staging.wpt.fyi - chrome[experimental] Chrome results
Details
wpt.fyi - chrome[experimental] Chrome results
Details
Azure Pipelines #20191127.12 succeeded
Details
Azure Pipelines (./wpt test-jobs) ./wpt test-jobs succeeded
Details
Azure Pipelines (affected tests without changes: Safari Technology Preview) affected tests without changes: Safari Technology Preview succeeded
Details
Azure Pipelines (affected tests: Safari Technology Preview) affected tests: Safari Technology Preview succeeded
Details
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests) wpt.fyi hook: safari-preview-affected-tests succeeded
Details
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests-without-changes) wpt.fyi hook: safari-preview-affected-tests-without-changes succeeded
Details
Community-TC (pull_request) TaskGroup: success
Details
staging.wpt.fyi - firefox[experimental] Firefox results
Details
staging.wpt.fyi - safari[experimental] Safari results
Details
wpt.fyi - firefox[experimental] Firefox results
Details
wpt.fyi - safari[experimental] Safari results
Details
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-1837146 branch Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.