Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Unified Diff: third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp

Issue 2454253003: Use the generated checks for whether origin trials are enabled. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2ed280da0548e2d03996d18ced179199e0d5f9a1..f7e329aacc2cbb2eaa4fbdd6cd486b7b74a8c95a 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp
+++ b/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp
@@ -18,7 +18,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 {
@@ -41,56 +41,40 @@ 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->isFeatureEnabled("WebBluetooth"))) {
+ if (OriginTrials::webBluetoothEnabled(executionContext)) {
V8NavigatorPartial::installWebBluetooth(isolate, world,
v8::Local<v8::Object>(),
prototypeObject, interfaceObject);
}
- if (RuntimeEnabledFeatures::webShareEnabled() ||
- (originTrialContext &&
- originTrialContext->isFeatureEnabled("WebShare"))) {
+ if (OriginTrials::webShareEnabled(executionContext)) {
V8NavigatorPartial::installWebShare(isolate, world,
v8::Local<v8::Object>(),
prototypeObject, interfaceObject);
}
- if (RuntimeEnabledFeatures::webUSBEnabled() ||
- (originTrialContext &&
- originTrialContext->isFeatureEnabled("WebUSB"))) {
+ if (OriginTrials::webUSBEnabled(executionContext)) {
V8NavigatorPartial::installWebUSB(isolate, world, v8::Local<v8::Object>(),
prototypeObject, interfaceObject);
}
} else if (wrapperTypeInfo == &V8Window::wrapperTypeInfo) {
- if (RuntimeEnabledFeatures::webBluetoothEnabled() ||
- (originTrialContext &&
- originTrialContext->isFeatureEnabled("WebBluetooth"))) {
+ if (OriginTrials::webBluetoothEnabled(executionContext)) {
V8WindowPartial::installWebBluetooth(isolate, world, global,
prototypeObject, interfaceObject);
}
- if (RuntimeEnabledFeatures::webUSBEnabled() ||
- (originTrialContext &&
- originTrialContext->isFeatureEnabled("WebUSB"))) {
+ if (OriginTrials::webUSBEnabled(executionContext)) {
V8WindowPartial::installWebUSB(isolate, world, global, prototypeObject,
interfaceObject);
}
} else if (wrapperTypeInfo == &V8ServiceWorkerGlobalScope::wrapperTypeInfo) {
- if (RuntimeEnabledFeatures::foreignFetchEnabled() ||
- (originTrialContext &&
- originTrialContext->isFeatureEnabled("ForeignFetch"))) {
+ if (OriginTrials::foreignFetchEnabled(executionContext)) {
V8ServiceWorkerGlobalScope::installForeignFetch(
isolate, world, global, prototypeObject, interfaceObject);
}
} else if (wrapperTypeInfo == &V8InstallEvent::wrapperTypeInfo) {
- if (RuntimeEnabledFeatures::foreignFetchEnabled() ||
- (originTrialContext &&
- originTrialContext->isFeatureEnabled("ForeignFetch"))) {
+ if (OriginTrials::foreignFetchEnabled(executionContext)) {
V8InstallEvent::installForeignFetch(isolate, world,
v8::Local<v8::Object>(),
prototypeObject, interfaceObject);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698