https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 7ca7cb4a359d31546505db3b4eb7feb90e69fa4a authored by Marijn Kruisselbrink on 24 May 2018, 23:04:36 UTC
[Mojo Blob URLs] Handle more navigation cases.
Tip revision: 7ca7cb4
cookie-store.idl
// https://github.com/WICG/cookie-store/blob/gh-pages/explainer.md

dictionary CookieListItem {
  USVString name;
  USVString value;
};

typedef sequence<CookieListItem> CookieList;

dictionary CookieChangeEventInit : EventInit {
  CookieList changed;
  CookieList deleted;
};

[
  Exposed=Window,
  Constructor(DOMString type, optional CookieChangeEventInit eventInitDict)
] interface CookieChangeEvent : Event {
  readonly attribute CookieList changed;
  readonly attribute CookieList deleted;
};

dictionary ExtendableCookieChangeEventInit : ExtendableEventInit {
  CookieList changed;
  CookieList deleted;
};

[
  Exposed=ServiceWorker,
  Constructor(DOMString type, optional ExtendableCookieChangeEventInit eventInitDict)
] interface ExtendableCookieChangeEvent : ExtendableEvent {
  readonly attribute CookieList changed;
  readonly attribute CookieList deleted;
};

enum CookieMatchType {
  "equals",
  "startsWith"
};

dictionary CookieStoreGetOptions {
  USVString name;
  USVString url;
  CookieMatchType matchType = "equals";
};

dictionary CookieStoreSetOptions {
  USVString name;
  USVString value;
  DOMTimeStamp? expires = null;
  USVString domain;
  USVString path = "/";
  boolean? secure;
  boolean httpOnly = false;
};

[
  Exposed=(ServiceWorker,Window)
] interface CookieStore : EventTarget {
  Promise<CookieList?> getAll(USVString name, optional CookieStoreGetOptions options);
  Promise<CookieList?> getAll(optional CookieStoreGetOptions options);

  Promise<CookieListItem?> get(USVString name, optional CookieStoreGetOptions options);
  Promise<CookieListItem?> get(optional CookieStoreGetOptions options);

  Promise<boolean> has(USVString name, optional CookieStoreGetOptions options);
  Promise<boolean> has(optional CookieStoreGetOptions options);

  Promise<void> set(USVString name, USVString value, optional CookieStoreSetOptions options);
  Promise<void> set(CookieStoreSetOptions options);

  Promise<void> delete(USVString name, optional CookieStoreSetOptions options);
  Promise<void> delete(CookieStoreSetOptions options);

  [Exposed=ServiceWorker] Promise<void> subscribeToChanges(sequence<CookieStoreGetOptions> subscriptions);

  [Exposed=ServiceWorker] Promise<sequence<CookieStoreGetOptions>> getChangeSubscriptions();

  [Exposed=Window] attribute EventHandler onchange;
};

partial interface Window {
  [Replaceable, SameObject] readonly attribute CookieStore cookieStore;
};

partial interface ServiceWorkerGlobalScope {
  [Replaceable, SameObject] readonly attribute CookieStore cookieStore;
};
back to top