blob: 3ec13ca3a0641780b1040135a10e6a1000669949 [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.
module blink.mojom;
import "url/mojo/origin.mojom";
// This mirrors blink::WebSandboxFlags enum bitfield.
[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
kPopups = 64, // 1 << 6
kAutomaticFeatures = 128, // 1 << 7
kPointerLock = 256, // 1 << 8
kDocumentDomain = 512, // 1 << 9
kOrientationLock = 1024, // 1 << 10
kPropagatesToAuxiliaryBrowsingContexts = 2048, // 1 << 11
kModals = 4096, // 1 << 12
kPresentationController = 8192, // 1 << 13
kTopNavigationByUserActivation = 16384, // 1 << 14
kDownloads = 32768, // 1 << 15
};
// These values map to the features which can be controlled by Feature Policy.
//
// Features are defined in
// https://github.com/WICG/feature-policy/blob/gh-pages/features.md. Many of
// these are still under development in blink behind the
// featurePolicyExperimentalFeatures flag.
// This enum is also defined in ./feature_policy_feature.h
enum FeaturePolicyFeature {
kNotFound = 0,
// Controls access to media autoplay.
kAutoplay,
// Controls access to video input devices.
kCamera,
// Controls whether navigator.requestMediaKeySystemAccess is allowed.
kEncryptedMedia,
// Controls whether Element.requestFullscreen is allowed.
kFullscreen,
// Controls access to Geolocation interface.
kGeolocation,
// Controls access to audio input devices.
kMicrophone,
// Controls access to requestMIDIAccess method.
kMidiFeature,
// Controls access to PaymentRequest interface.
kPayment,
// Controls access to audio output devices.
kSpeaker,
// Controls access to navigator.vibrate method.
kVibrate,
// Controls access to document.cookie attribute.
kDocumentCookie,
// Contols access to document.domain attribute.
kDocumentDomain,
// Controls access to document.write and document.writeln methods.
kDocumentWrite,
// Controls whether synchronous script elements will run.
kSyncScript,
// Controls use of synchronous XMLHTTPRequest API.
kSyncXHR,
// Controls access to the WebUSB API.
kUsb,
// Controls access to AOM event listeners.
kAccessibilityEvents,
// Controls use of WebVR API.
kWebVr,
// The following features control access to the corresponding sensor classes.
// Fusion sensor APIs (e.g. LinearAcceleration, OrientationSensor-based
// classes)require all of the features that are inputs into that API to be
// enabled for the feature to be allowed.
kAccelerometer,
kAmbientLightSensor,
kGyroscope,
kMagnetometer,
// Controls the layout size of intrinsically sized images and videos. When
// disabled, default size (300 x 150) is used to prevent relayout.
kUnsizedMedia,
// Controls access to Picture-in-Picture.
kPictureInPicture,
};
// This struct holds feature policy whitelist data that needs to be replicated
// between a RenderFrame and any of its associated RenderFrameProxies. A list of
// these form a ParsedFeaturePolicy.
// NOTE: These types are used for replication frame state between processes.
struct ParsedFeaturePolicyDeclaration {
FeaturePolicyFeature feature;
bool matches_all_origins;
array<url.mojom.Origin> origins;
};