| Index: third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp b/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp
|
| index 8e0a1bd25206510d00c0c22d048714952a622c2b..d5260ee36f14dfb649fb1cb2b361dd771a2989bc 100644
|
| --- a/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp
|
| +++ b/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp
|
| @@ -20,7 +20,7 @@
|
| #include "bindings/modules/v8/V8WindowPartial.h"
|
| #include "bindings/modules/v8/V8WorkerNavigatorPartial.h"
|
| #include "core/dom/ExecutionContext.h"
|
| -#include "core/origin_trials/OriginTrialContext.h"
|
| +#include "core/origin_trials/OriginTrials.h"
|
|
|
| namespace blink {
|
|
|
| @@ -43,82 +43,63 @@ void installConditionalFeaturesForModules(
|
| ExecutionContext* executionContext = scriptState->getExecutionContext();
|
| if (!executionContext)
|
| return;
|
| - OriginTrialContext* originTrialContext = OriginTrialContext::from(
|
| - executionContext, OriginTrialContext::DontCreateIfNotExists);
|
| v8::Isolate* isolate = scriptState->isolate();
|
| const DOMWrapperWorld& world = scriptState->world();
|
| v8::Local<v8::Object> global = scriptState->context()->Global();
|
| if (wrapperTypeInfo == &V8Navigator::wrapperTypeInfo) {
|
| - if (RuntimeEnabledFeatures::webBluetoothEnabled() ||
|
| - (originTrialContext &&
|
| - originTrialContext->isTrialEnabled("WebBluetooth"))) {
|
| + if (OriginTrials::webBluetoothEnabled(executionContext)) {
|
| V8NavigatorPartial::installWebBluetooth(isolate, world,
|
| v8::Local<v8::Object>(),
|
| prototypeObject, interfaceObject);
|
| }
|
| - if (RuntimeEnabledFeatures::webShareEnabled() ||
|
| - (originTrialContext &&
|
| - originTrialContext->isTrialEnabled("WebShare"))) {
|
| + if (OriginTrials::webShareEnabled(executionContext)) {
|
| V8NavigatorPartial::installWebShare(isolate, world,
|
| v8::Local<v8::Object>(),
|
| prototypeObject, interfaceObject);
|
| }
|
| - if (RuntimeEnabledFeatures::webUSBEnabled() ||
|
| - (originTrialContext && originTrialContext->isTrialEnabled("WebUSB"))) {
|
| + if (OriginTrials::webUSBEnabled(executionContext)) {
|
| V8NavigatorPartial::installWebUSB(isolate, world, v8::Local<v8::Object>(),
|
| prototypeObject, interfaceObject);
|
| }
|
| - if (RuntimeEnabledFeatures::webVREnabled() ||
|
| - (originTrialContext && originTrialContext->isTrialEnabled("WebVR"))) {
|
| + if (OriginTrials::webVREnabled(executionContext)) {
|
| V8NavigatorPartial::installWebVR(isolate, world, global, prototypeObject,
|
| interfaceObject);
|
| }
|
| } else if (wrapperTypeInfo == &V8Window::wrapperTypeInfo) {
|
| - if (RuntimeEnabledFeatures::webBluetoothEnabled() ||
|
| - (originTrialContext &&
|
| - originTrialContext->isTrialEnabled("WebBluetooth"))) {
|
| + if (OriginTrials::webBluetoothEnabled(executionContext)) {
|
| V8WindowPartial::installWebBluetooth(isolate, world, global,
|
| prototypeObject, interfaceObject);
|
| }
|
| - if (RuntimeEnabledFeatures::webUSBEnabled() ||
|
| - (originTrialContext && originTrialContext->isTrialEnabled("WebUSB"))) {
|
| + if (OriginTrials::webUSBEnabled(executionContext)) {
|
| V8WindowPartial::installWebUSB(isolate, world, global, prototypeObject,
|
| interfaceObject);
|
| }
|
| - if (RuntimeEnabledFeatures::webVREnabled() ||
|
| - (originTrialContext && originTrialContext->isTrialEnabled("WebVR"))) {
|
| + if (OriginTrials::webVREnabled(executionContext)) {
|
| V8WindowPartial::installWebVR(isolate, world, global, prototypeObject,
|
| interfaceObject);
|
| }
|
| - if (RuntimeEnabledFeatures::gamepadExtensionsEnabled() ||
|
| - (originTrialContext && originTrialContext->isTrialEnabled("WebVR"))) {
|
| + if (OriginTrials::gamepadExtensionsEnabled(executionContext)) {
|
| V8WindowPartial::installGamepadExtensions(
|
| isolate, world, global, prototypeObject, interfaceObject);
|
| }
|
| } else if (wrapperTypeInfo == &V8ServiceWorkerGlobalScope::wrapperTypeInfo) {
|
| - if (RuntimeEnabledFeatures::foreignFetchEnabled() ||
|
| - (originTrialContext &&
|
| - originTrialContext->isTrialEnabled("ForeignFetch"))) {
|
| + if (OriginTrials::foreignFetchEnabled(executionContext)) {
|
| V8ServiceWorkerGlobalScope::installForeignFetch(
|
| isolate, world, global, prototypeObject, interfaceObject);
|
| }
|
| } else if (wrapperTypeInfo == &V8InstallEvent::wrapperTypeInfo) {
|
| - if (RuntimeEnabledFeatures::foreignFetchEnabled() ||
|
| - (originTrialContext &&
|
| - originTrialContext->isTrialEnabled("ForeignFetch"))) {
|
| + if (OriginTrials::foreignFetchEnabled(executionContext)) {
|
| V8InstallEvent::installForeignFetch(isolate, world,
|
| v8::Local<v8::Object>(),
|
| prototypeObject, interfaceObject);
|
| }
|
| } else if (wrapperTypeInfo == &V8Gamepad::wrapperTypeInfo) {
|
| - if (RuntimeEnabledFeatures::gamepadExtensionsEnabled() ||
|
| - (originTrialContext && originTrialContext->isTrialEnabled("WebVR"))) {
|
| + if (OriginTrials::gamepadExtensionsEnabled(executionContext)) {
|
| V8Gamepad::installGamepadExtensions(isolate, world, global,
|
| prototypeObject, interfaceObject);
|
| }
|
| } else if (wrapperTypeInfo == &V8GamepadButton::wrapperTypeInfo) {
|
| - if (RuntimeEnabledFeatures::gamepadExtensionsEnabled() ||
|
| - (originTrialContext && originTrialContext->isTrialEnabled("WebVR"))) {
|
| + if (OriginTrials::gamepadExtensionsEnabled(executionContext)) {
|
| V8GamepadButton::installGamepadExtensions(
|
| isolate, world, global, prototypeObject, interfaceObject);
|
| }
|
|
|