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

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: Fix test 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 03798a6f5afaaa73465bc41bd10780631807b85d..00aa487c1b2395212866306568136c719740197c 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp
+++ b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp
@@ -566,6 +566,18 @@ void installOriginTrialsForModules(ScriptState* scriptState)
}
originTrialContext->setFeatureBindingsInstalled("DurableStorage");
}
+
+ 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);
+ }
+ originTrialContext->setFeatureBindingsInstalled("WebBluetooth");
iclelland 2016/06/24 03:37:23 Just a note, that if https://codereview.chromium.
ortuno 2016/06/24 16:01:31 My reviewer is out until tuesday, so your patch wi
+ }
}
void registerInstallOriginTrialsForModules()

Powered by Google App Engine
This is Rietveld 408576698