chromium/services/network/public/mojom/web_sandbox_flags.mojom

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

module network.mojom;
// Enum types for the sandbox attributes of the main resource.
// TODO(crbug.com/40051217): Parse the flags in the network service.
//
// See content/browser/renderer_host/sandbox_flags.md for more details about how
// the web-layer components (i.e. //content and Blink) consume and apply these
// flags.
//
// These values are persisted to disk, so any changes must be append-only and
// not affect existing values.

[Extensible]
enum WebSandboxFlags {
  kNone                                  =      0,

  kNavigation                            =      1, // 1 << 0
  kPlugins                               =      2, // 1 << 1
  kOrigin                                =      4, // 1 << 2
  kForms                                 =      8, // 1 << 3
  kScripts                               =     16, // 1 << 4
  kTopNavigation                         =     32, // 1 << 5

  // See https://www.w3.org/Bugs/Public/show_bug.cgi?id=12393
  kPopups                                =     64, // 1 << 6

  kAutomaticFeatures                     =    128, // 1 << 7
  kPointerLock                           =    256, // 1 << 8
  kDocumentDomain                        =    512, // 1 << 9

  // See https://w3c.github.io/screen-orientation/#dfn-sandboxed-orientation-lock-browsing-context-flag.
  kOrientationLock                       =   1024, // 1 << 10

  kPropagatesToAuxiliaryBrowsingContexts =   2048, // 1 << 11
  kModals                                =   4096, // 1 << 12

  // See https://w3c.github.io/presentation-api/#sandboxing-and-the-allow-presentation-keyword
  kPresentationController                =   8192, // 1 << 13

  // See https://github.com/WICG/interventions/issues/42.
  kTopNavigationByUserActivation         =  16384, // 1 << 14

  // See https://crbug.com/539938
  kDownloads                             =  32768, // 1 << 15

  kStorageAccessByUserActivation         =  65536, // 1 << 16

  // See https://github.com/whatwg/html/pull/7654
  kTopNavigationToCustomProtocols        = 131072, // 1 << 17

  kAll                                   = -1, // Mask with all bits set.
};