Commit e4ca07a1 authored by Ayu Ishii's avatar Ayu Ishii Committed by Commit Bot

CookieStore: Launch Cookie Store API

This change ships the Cookie Store API to stable.
It also removes some IDL changes that were necessary to
get around an issue caused by the combination of Expose,
partial interface and Origin Trial integration. More
details on this can be found here [1], [2].

Intent 2 Ship: https://groups.google.com/u/2/a/chromium.org/g/blink-dev/c/zOsGZGMGiM4

[1] Work around implementation: https://crrev.com/c/2191240
[2] IDL crbug: https://crbug.com/839117

Bug: 729800
Change-Id: I26ffdabb316ef49f560d78945d818123fd64b39d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2411149
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarMike West <mkwst@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810516}
parent eb701079
......@@ -45,13 +45,6 @@ class ServiceWorkerRegistrationCookiesImpl final
registration_->GetExecutionContext();
DCHECK(execution_context);
// TODO(crbug.com/839117): Remove once Expose on partial interface is
// supported or Origin Trial as ended.
if (!execution_context->IsWindow() &&
!execution_context->IsServiceWorkerGlobalScope()) {
return nullptr;
}
HeapMojoRemote<mojom::blink::CookieStore,
HeapMojoWrapperMode::kWithoutContextObserver>
backend(execution_context);
......
......@@ -3,10 +3,7 @@
// found in the LICENSE file.
[
// TODO(crbug.com/839117): Enable the following [Exposed] on the partial
// interface declaration one it's supported.
//
// Exposed=(ServiceWorker,Window),
Exposed=(ServiceWorker,Window),
RuntimeEnabled=CookieStoreWorker,
ImplementedAs=ServiceWorkerRegistrationCookies
] partial interface ServiceWorkerRegistration {
......
......@@ -383,13 +383,11 @@
},
{
name: "CookieStoreDocument",
origin_trial_feature_name: "CookieStore",
status: "experimental",
status: "stable",
},
{
name: "CookieStoreWorker",
origin_trial_feature_name: "CookieStore",
status: "experimental",
status: "stable",
},
{
name: "CookiesWithoutSameSiteMustBeSecure",
......
This is a testharness.js-based test.
PASS idl_test setup
PASS idl_test validation
PASS Partial interface ServiceWorkerRegistration: original interface defined
PASS Partial interface ServiceWorkerRegistration: valid exposure set
PASS Partial interface ServiceWorkerRegistration: member names are unique
PASS Partial interface Window: original interface defined
PASS Partial interface Window: member names are unique
PASS Partial interface ServiceWorkerGlobalScope: original interface defined
PASS Partial interface ServiceWorkerGlobalScope: member names are unique
PASS Partial interface Window[2]: member names are unique
PASS Window includes GlobalEventHandlers: member names are unique
PASS Window includes WindowEventHandlers: member names are unique
PASS Window includes WindowOrWorkerGlobalScope: member names are unique
PASS Window includes AnimationFrameProvider: member names are unique
PASS Window includes WindowSessionStorage: member names are unique
PASS Window includes WindowLocalStorage: member names are unique
PASS WorkerGlobalScope includes WindowOrWorkerGlobalScope: member names are unique
PASS CookieStore interface: existence and properties of interface object
PASS CookieStoreManager interface: existence and properties of interface object
PASS CookieChangeEvent interface: existence and properties of interface object
PASS ExtendableCookieChangeEvent interface: existence and properties of interface object
FAIL ServiceWorkerRegistration interface: member cookies assert_false: The prototype object must not have a property "cookies" expected false got true
PASS ServiceWorkerGlobalScope interface: existence and properties of interface object
PASS ExtendableEvent interface: existence and properties of interface object
PASS Window interface: existence and properties of interface object
Harness: the test ran to completion.
This is a testharness.js-based test.
PASS idl_test setup
PASS idl_test validation
PASS Partial interface ServiceWorkerRegistration: original interface defined
PASS Partial interface ServiceWorkerRegistration: valid exposure set
PASS Partial interface ServiceWorkerRegistration: member names are unique
PASS Partial interface Window: original interface defined
PASS Partial interface Window: member names are unique
PASS Partial interface ServiceWorkerGlobalScope: original interface defined
PASS Partial interface ServiceWorkerGlobalScope: member names are unique
PASS Partial interface Window[2]: member names are unique
PASS Window includes GlobalEventHandlers: member names are unique
PASS Window includes WindowEventHandlers: member names are unique
PASS Window includes WindowOrWorkerGlobalScope: member names are unique
PASS Window includes AnimationFrameProvider: member names are unique
PASS Window includes WindowSessionStorage: member names are unique
PASS Window includes WindowLocalStorage: member names are unique
PASS WorkerGlobalScope includes WindowOrWorkerGlobalScope: member names are unique
PASS CookieStore interface: existence and properties of interface object
PASS CookieStoreManager interface: existence and properties of interface object
PASS CookieChangeEvent interface: existence and properties of interface object
PASS ExtendableCookieChangeEvent interface: existence and properties of interface object
FAIL ServiceWorkerRegistration interface: member cookies assert_false: The prototype object must not have a property "cookies" expected false got true
PASS ServiceWorkerGlobalScope interface: existence and properties of interface object
PASS ExtendableEvent interface: existence and properties of interface object
PASS Window interface: existence and properties of interface object
Harness: the test ran to completion.
......@@ -3,6 +3,7 @@ Tests access of cached DOMWindow properties after the associated frame is naviga
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS window.cached_cookieStore.onchange is null
FAIL window.cached_location.hash should be (of type string). Was undefined (of type undefined).
FAIL window.cached_location.host should be (of type string). Was undefined (of type undefined).
FAIL window.cached_location.hostname should be (of type string). Was undefined (of type undefined).
......
......@@ -3,6 +3,7 @@ Tests access of cached DOMWindow properties after the associated frame is remove
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS window.cached_cookieStore.onchange is null
FAIL window.cached_location.hash should be (of type string). Was undefined (of type undefined).
FAIL window.cached_location.host should be (of type string). Was undefined (of type undefined).
FAIL window.cached_location.hostname should be (of type string). Was undefined (of type undefined).
......
......@@ -3,6 +3,7 @@ Tests access of cached DOMWindow properties after the associated frame is no lon
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS window.cached_cookieStore.onchange is null
FAIL window.cached_location.hash should be (of type string). Was undefined (of type undefined).
FAIL window.cached_location.host should be (of type string). Was undefined (of type undefined).
FAIL window.cached_location.hostname should be (of type string). Was undefined (of type undefined).
......
......@@ -4,6 +4,7 @@ Tests property access on a cached DOMWindow after the associated frame is naviga
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS oldChildWindow.closed is newChildWindow.closed
PASS oldChildWindow.cookieStore.onchange is newChildWindow.cookieStore.onchange
PASS oldChildWindow.defaultStatus is newChildWindow.defaultStatus
PASS oldChildWindow.defaultstatus is newChildWindow.defaultstatus
PASS oldChildWindow.devicePixelRatio is newChildWindow.devicePixelRatio
......
......@@ -148,6 +148,19 @@ interface CompressionStream
getter readable
getter writable
method constructor
interface CookieStore : EventTarget
attribute @@toStringTag
method constructor
method delete
method get
method getAll
method set
interface CookieStoreManager
attribute @@toStringTag
method constructor
method getSubscriptions
method subscribe
method unsubscribe
interface CountQueuingStrategy
attribute @@toStringTag
getter highWaterMark
......@@ -431,6 +444,11 @@ interface EventTarget
method constructor
method dispatchEvent
method removeEventListener
interface ExtendableCookieChangeEvent : ExtendableEvent
attribute @@toStringTag
getter changed
getter deleted
method constructor
interface ExtendableEvent : Event
attribute @@toStringTag
method constructor
......@@ -1179,6 +1197,7 @@ interface ServiceWorkerRegistration : EventTarget
attribute @@toStringTag
getter active
getter backgroundFetch
getter cookies
getter installing
getter navigationPreload
getter onupdatefound
......@@ -2726,6 +2745,7 @@ interface WritableStreamDefaultWriter
attribute globalThis
attribute internals
getter clients
getter cookieStore
getter onabortpayment
getter onactivate
getter onbackgroundfetchabort
......@@ -2733,6 +2753,7 @@ interface WritableStreamDefaultWriter
getter onbackgroundfetchfail
getter onbackgroundfetchsuccess
getter oncanmakepayment
getter oncookiechange
getter onfetch
getter oninstall
getter onmessage
......@@ -2754,6 +2775,7 @@ interface WritableStreamDefaultWriter
setter onbackgroundfetchfail
setter onbackgroundfetchsuccess
setter oncanmakepayment
setter oncookiechange
setter onfetch
setter oninstall
setter onmessage
......
......@@ -898,6 +898,26 @@ interface ConvolverNode : AudioNode
method constructor
setter buffer
setter normalize
interface CookieChangeEvent : Event
attribute @@toStringTag
getter changed
getter deleted
method constructor
interface CookieStore : EventTarget
attribute @@toStringTag
getter onchange
method constructor
method delete
method get
method getAll
method set
setter onchange
interface CookieStoreManager
attribute @@toStringTag
method constructor
method getSubscriptions
method subscribe
method unsubscribe
interface CountQueuingStrategy
attribute @@toStringTag
getter highWaterMark
......@@ -6984,6 +7004,7 @@ interface ServiceWorkerRegistration : EventTarget
attribute @@toStringTag
getter active
getter backgroundFetch
getter cookies
getter installing
getter navigationPreload
getter onupdatefound
......@@ -9538,6 +9559,7 @@ interface webkitURL
getter caches
getter clientInformation
getter closed
getter cookieStore
getter crypto
getter customElements
getter defaultStatus
......
......@@ -1354,7 +1354,6 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] attribute @@toStringTag
[Worker] getter active
[Worker] getter backgroundFetch
[Worker] getter cookies
[Worker] getter index
[Worker] getter installing
[Worker] getter navigationPreload
......
......@@ -1286,7 +1286,6 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] attribute @@toStringTag
[Worker] getter active
[Worker] getter backgroundFetch
[Worker] getter cookies
[Worker] getter index
[Worker] getter installing
[Worker] getter navigationPreload
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment