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

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

Issue 2080553002: bluetooth: Enable Web Bluetooth in Origin Trials (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Change to MacOS Created 4 years, 6 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/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()
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp ('k') | third_party/WebKit/Source/modules/bluetooth/Bluetooth.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698