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() |