chromium/third_party/blink/public/mojom/worker/shared_worker_info.mojom

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module blink.mojom;

import "services/network/public/mojom/content_security_policy.mojom";
import "third_party/blink/public/mojom/loader/fetch_client_settings_object.mojom";
import "third_party/blink/public/mojom/worker/worker_options.mojom";
import "url/mojom/url.mojom";

// This enum indicates which types of SameSite cookies the SharedWorker should
// be allowed to access. kAll allows cookies with same-site Lax, Strict, or
// None to be accessed. kNone just allows cookies with same-site None to be
// accessed. SharedWorkers started in a first-party context can access kAll or
// kNone cookies, while SharedWorkers started in a third-party context can only
// access kNone.
enum SharedWorkerSameSiteCookies {
  kAll,
  kNone
};

// Meta data that is necessary to create a new shared worker context. This
// structure gets populated when a new SharedWorker object is created in the
// parent context (e.g. Document), and passed onto the destination child
// process where the shared worker runs.
struct SharedWorkerInfo {
  url.mojom.Url url;
  WorkerOptions options;
  array<network.mojom.ContentSecurityPolicy> content_security_policies;
  FetchClientSettingsObject outside_fetch_client_settings_object;
  SharedWorkerSameSiteCookies same_site_cookies = SharedWorkerSameSiteCookies.kNone;
};