blob: 7f2a1d9e7528e31d4e38ec98768efa99060e9b0d [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://wicg.github.io/cookie-store/explainer.html
[
Exposed=(ServiceWorker,Window),
RuntimeEnabled=CookieStore,
SecureContext
] interface CookieStore : EventTarget {
// https://wicg.github.io/cookie-store/explainer.html#the-query-api
[CallWith=ScriptState, Measure, RaisesException] Promise<CookieListItem?> get(
USVString name);
[CallWith=ScriptState, Measure, RaisesException] Promise<CookieListItem?> get(
optional CookieStoreGetOptions options);
[CallWith=ScriptState, Measure, RaisesException] Promise<CookieList> getAll(
USVString name);
[CallWith=ScriptState, Measure, RaisesException] Promise<CookieList> getAll(
optional CookieStoreGetOptions options);
// https://wicg.github.io/cookie-store/explainer.html#the-modifications-api
[CallWith=ScriptState, Measure, RaisesException] Promise<void> set(
USVString name, USVString value, optional CookieStoreSetOptions options);
[CallWith=ScriptState, Measure, RaisesException] Promise<void> set(
CookieStoreSetExtraOptions options);
[CallWith=ScriptState, ImplementedAs=Delete, Measure, RaisesException]
Promise<void> delete(USVString name);
[CallWith=ScriptState, ImplementedAs=Delete, Measure, RaisesException]
Promise<void> delete(CookieStoreDeleteOptions options);
// https://wicg.github.io/cookie-store/explainer.html#the-change-events-api
[Exposed=ServiceWorker, CallWith=ScriptState, Measure, RaisesException]
Promise<void> subscribeToChanges(
sequence<CookieStoreGetOptions> subscriptions);
[Exposed=ServiceWorker, CallWith=ScriptState, Measure, RaisesException]
Promise<sequence<CookieStoreGetOptions>> getChangeSubscriptions();
[Exposed=Window] attribute EventHandler onchange;
};