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 ...@@ -45,13 +45,6 @@ class ServiceWorkerRegistrationCookiesImpl final
registration_->GetExecutionContext(); registration_->GetExecutionContext();
DCHECK(execution_context); 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, HeapMojoRemote<mojom::blink::CookieStore,
HeapMojoWrapperMode::kWithoutContextObserver> HeapMojoWrapperMode::kWithoutContextObserver>
backend(execution_context); backend(execution_context);
......
...@@ -3,10 +3,7 @@ ...@@ -3,10 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
[ [
// TODO(crbug.com/839117): Enable the following [Exposed] on the partial Exposed=(ServiceWorker,Window),
// interface declaration one it's supported.
//
// Exposed=(ServiceWorker,Window),
RuntimeEnabled=CookieStoreWorker, RuntimeEnabled=CookieStoreWorker,
ImplementedAs=ServiceWorkerRegistrationCookies ImplementedAs=ServiceWorkerRegistrationCookies
] partial interface ServiceWorkerRegistration { ] partial interface ServiceWorkerRegistration {
......
...@@ -383,13 +383,11 @@ ...@@ -383,13 +383,11 @@
}, },
{ {
name: "CookieStoreDocument", name: "CookieStoreDocument",
origin_trial_feature_name: "CookieStore", status: "stable",
status: "experimental",
}, },
{ {
name: "CookieStoreWorker", name: "CookieStoreWorker",
origin_trial_feature_name: "CookieStore", status: "stable",
status: "experimental",
}, },
{ {
name: "CookiesWithoutSameSiteMustBeSecure", 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 ...@@ -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". 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.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.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). 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 ...@@ -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". 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.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.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). 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 ...@@ -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". 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.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.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). 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 ...@@ -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". On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS oldChildWindow.closed is newChildWindow.closed 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.defaultstatus is newChildWindow.defaultstatus PASS oldChildWindow.defaultstatus is newChildWindow.defaultstatus
PASS oldChildWindow.devicePixelRatio is newChildWindow.devicePixelRatio PASS oldChildWindow.devicePixelRatio is newChildWindow.devicePixelRatio
......
...@@ -148,6 +148,19 @@ interface CompressionStream ...@@ -148,6 +148,19 @@ interface CompressionStream
getter readable getter readable
getter writable getter writable
method constructor 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 interface CountQueuingStrategy
attribute @@toStringTag attribute @@toStringTag
getter highWaterMark getter highWaterMark
...@@ -431,6 +444,11 @@ interface EventTarget ...@@ -431,6 +444,11 @@ interface EventTarget
method constructor method constructor
method dispatchEvent method dispatchEvent
method removeEventListener method removeEventListener
interface ExtendableCookieChangeEvent : ExtendableEvent
attribute @@toStringTag
getter changed
getter deleted
method constructor
interface ExtendableEvent : Event interface ExtendableEvent : Event
attribute @@toStringTag attribute @@toStringTag
method constructor method constructor
...@@ -1179,6 +1197,7 @@ interface ServiceWorkerRegistration : EventTarget ...@@ -1179,6 +1197,7 @@ interface ServiceWorkerRegistration : EventTarget
attribute @@toStringTag attribute @@toStringTag
getter active getter active
getter backgroundFetch getter backgroundFetch
getter cookies
getter installing getter installing
getter navigationPreload getter navigationPreload
getter onupdatefound getter onupdatefound
...@@ -2726,6 +2745,7 @@ interface WritableStreamDefaultWriter ...@@ -2726,6 +2745,7 @@ interface WritableStreamDefaultWriter
attribute globalThis attribute globalThis
attribute internals attribute internals
getter clients getter clients
getter cookieStore
getter onabortpayment getter onabortpayment
getter onactivate getter onactivate
getter onbackgroundfetchabort getter onbackgroundfetchabort
...@@ -2733,6 +2753,7 @@ interface WritableStreamDefaultWriter ...@@ -2733,6 +2753,7 @@ interface WritableStreamDefaultWriter
getter onbackgroundfetchfail getter onbackgroundfetchfail
getter onbackgroundfetchsuccess getter onbackgroundfetchsuccess
getter oncanmakepayment getter oncanmakepayment
getter oncookiechange
getter onfetch getter onfetch
getter oninstall getter oninstall
getter onmessage getter onmessage
...@@ -2754,6 +2775,7 @@ interface WritableStreamDefaultWriter ...@@ -2754,6 +2775,7 @@ interface WritableStreamDefaultWriter
setter onbackgroundfetchfail setter onbackgroundfetchfail
setter onbackgroundfetchsuccess setter onbackgroundfetchsuccess
setter oncanmakepayment setter oncanmakepayment
setter oncookiechange
setter onfetch setter onfetch
setter oninstall setter oninstall
setter onmessage setter onmessage
......
...@@ -898,6 +898,26 @@ interface ConvolverNode : AudioNode ...@@ -898,6 +898,26 @@ interface ConvolverNode : AudioNode
method constructor method constructor
setter buffer setter buffer
setter normalize 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 interface CountQueuingStrategy
attribute @@toStringTag attribute @@toStringTag
getter highWaterMark getter highWaterMark
...@@ -6984,6 +7004,7 @@ interface ServiceWorkerRegistration : EventTarget ...@@ -6984,6 +7004,7 @@ interface ServiceWorkerRegistration : EventTarget
attribute @@toStringTag attribute @@toStringTag
getter active getter active
getter backgroundFetch getter backgroundFetch
getter cookies
getter installing getter installing
getter navigationPreload getter navigationPreload
getter onupdatefound getter onupdatefound
...@@ -9538,6 +9559,7 @@ interface webkitURL ...@@ -9538,6 +9559,7 @@ interface webkitURL
getter caches getter caches
getter clientInformation getter clientInformation
getter closed getter closed
getter cookieStore
getter crypto getter crypto
getter customElements getter customElements
getter defaultStatus getter defaultStatus
......
...@@ -1354,7 +1354,6 @@ Starting worker: resources/global-interface-listing-worker.js ...@@ -1354,7 +1354,6 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] attribute @@toStringTag [Worker] attribute @@toStringTag
[Worker] getter active [Worker] getter active
[Worker] getter backgroundFetch [Worker] getter backgroundFetch
[Worker] getter cookies
[Worker] getter index [Worker] getter index
[Worker] getter installing [Worker] getter installing
[Worker] getter navigationPreload [Worker] getter navigationPreload
......
...@@ -1286,7 +1286,6 @@ Starting worker: resources/global-interface-listing-worker.js ...@@ -1286,7 +1286,6 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] attribute @@toStringTag [Worker] attribute @@toStringTag
[Worker] getter active [Worker] getter active
[Worker] getter backgroundFetch [Worker] getter backgroundFetch
[Worker] getter cookies
[Worker] getter index [Worker] getter index
[Worker] getter installing [Worker] getter installing
[Worker] getter navigationPreload [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