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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 } else if (executionContext->isDedicatedWorkerGlobalScope()) { 558 } else if (executionContext->isDedicatedWorkerGlobalScope()) {
559 v8::Local<v8::Object> navigator = global->Get(context, navigatorName ).ToLocalChecked()->ToObject(); 559 v8::Local<v8::Object> navigator = global->Get(context, navigatorName ).ToLocalChecked()->ToObject();
560 V8DedicatedWorkerGlobalScopePartial::installDurableStorage(scriptSta te, global); 560 V8DedicatedWorkerGlobalScopePartial::installDurableStorage(scriptSta te, global);
561 V8WorkerNavigatorPartial::installDurableStorage(scriptState, navigat or); 561 V8WorkerNavigatorPartial::installDurableStorage(scriptState, navigat or);
562 } else if (executionContext->isServiceWorkerGlobalScope()) { 562 } else if (executionContext->isServiceWorkerGlobalScope()) {
563 v8::Local<v8::Object> navigator = global->Get(context, navigatorName ).ToLocalChecked()->ToObject(); 563 v8::Local<v8::Object> navigator = global->Get(context, navigatorName ).ToLocalChecked()->ToObject();
564 V8ServiceWorkerGlobalScope::installDurableStorage(scriptState, globa l); 564 V8ServiceWorkerGlobalScope::installDurableStorage(scriptState, globa l);
565 V8WorkerNavigatorPartial::installDurableStorage(scriptState, navigat or); 565 V8WorkerNavigatorPartial::installDurableStorage(scriptState, navigat or);
566 } 566 }
567 } 567 }
568
569 if (!originTrialContext->featureBindingsInstalled("WebBluetooth") && (Runtim eEnabledFeatures::webBluetoothEnabled() || originTrialContext->isFeatureEnabled( "WebBluetooth", nullptr))) {
570 v8::Local<v8::String> navigatorName = v8::String::NewFromOneByte(isolate , reinterpret_cast<const uint8_t*>("navigator"), v8::NewStringType::kNormal).ToL ocalChecked();
571 if (executionContext->isDocument()) {
572 v8::Local<v8::Object> navigator = global->Get(context, navigatorName ).ToLocalChecked()->ToObject();
573 // For global interfaces e.g. BluetoothUUID.
574 V8WindowPartial::installWebBluetooth(scriptState, global);
575 // For navigator interfaces e.g. navigator.bluetooth.
576 V8NavigatorPartial::installWebBluetooth(scriptState, navigator);
577 }
578 }
568 } 579 }
569 580
570 void registerInstallOriginTrialsForModules() 581 void registerInstallOriginTrialsForModules()
571 { 582 {
572 s_originalInstallOriginTrialsFunction = setInstallOriginTrialsFunction(&inst allOriginTrialsForModules); 583 s_originalInstallOriginTrialsFunction = setInstallOriginTrialsFunction(&inst allOriginTrialsForModules);
573 } 584 }
574 } // namespace blink 585 } // namespace blink
OLDNEW
« 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