Index: third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp |
diff --git a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp |
index afacca41d0a619556b3ddb4dfaec8044946b012e..1abbf997527f0240f5894273a1c43a87403cfc13 100644 |
--- a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp |
+++ b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp |
@@ -565,6 +565,17 @@ void installOriginTrialsForModules(ScriptState* scriptState) |
V8WorkerNavigatorPartial::installDurableStorage(scriptState, navigator); |
} |
} |
+ |
+ if (!originTrialContext->featureBindingsInstalled("WebBluetooth") && (RuntimeEnabledFeatures::webBluetoothEnabled() || originTrialContext->isFeatureEnabled("WebBluetooth", nullptr))) { |
+ v8::Local<v8::String> navigatorName = v8::String::NewFromOneByte(isolate, reinterpret_cast<const uint8_t*>("navigator"), v8::NewStringType::kNormal).ToLocalChecked(); |
+ if (executionContext->isDocument()) { |
+ v8::Local<v8::Object> navigator = global->Get(context, navigatorName).ToLocalChecked()->ToObject(); |
+ // For global interfaces e.g. BluetoothUUID. |
+ V8WindowPartial::installWebBluetooth(scriptState, global); |
+ // For navigator interfaces e.g. navigator.bluetooth. |
+ V8NavigatorPartial::installWebBluetooth(scriptState, navigator); |
+ } |
+ } |
} |
void registerInstallOriginTrialsForModules() |