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

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

Issue 2698083008: Make the navigator.usb attribute accessible only in secure contexts. (Closed)
Patch Set: Moved [NoInterfaceObject] change to a separate patch. Created 3 years, 10 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
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);
}

Powered by Google App Engine
This is Rietveld 408576698