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 01dfe2131078787db58d8bc78768ce779802999a..e7ac3bb1d9c71c50b705bcab82b1f4c9a2db5145 100644 |
--- a/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp |
+++ b/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp |
@@ -55,7 +55,9 @@ void installConditionalFeaturesForModules( |
v8::Local<v8::Object>(), |
prototypeObject, interfaceObject); |
} |
- if (OriginTrials::webUSBEnabled(executionContext)) { |
+ // Mimics the [SecureContext] extended attribute. |
+ if (OriginTrials::webUSBEnabled(executionContext) && |
+ executionContext->isSecureContext()) { |
chasej
2017/02/22 19:34:18
The check for secure context is redundant. Origin
|
V8NavigatorPartial::installWebUSB(isolate, world, v8::Local<v8::Object>(), |
prototypeObject, interfaceObject); |
} |
@@ -69,7 +71,9 @@ void installConditionalFeaturesForModules( |
V8WindowPartial::installImageCapture(isolate, world, instanceObject, |
prototypeObject, interfaceObject); |
} |
- if (OriginTrials::webUSBEnabled(executionContext)) { |
+ // Mimics the [SecureContext] extended attribute. |
+ if (OriginTrials::webUSBEnabled(executionContext) && |
+ executionContext->isSecureContext()) { |
chasej
2017/02/22 19:34:18
Ditto.
|
V8WindowPartial::installWebUSB(isolate, world, instanceObject, |
prototypeObject, interfaceObject); |
} |