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

Unified Diff: chrome/renderer/resources/extensions/bluetooth_custom_bindings.js

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 7 years, 10 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: chrome/renderer/resources/extensions/bluetooth_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/bluetooth_custom_bindings.js b/chrome/renderer/resources/extensions/bluetooth_custom_bindings.js
index e1f75f5d78ac9ff69d574696852ab3b6e6308462..9531b3a2d3f8b01bae3a206489531a09e624820c 100644
--- a/chrome/renderer/resources/extensions/bluetooth_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/bluetooth_custom_bindings.js
@@ -2,16 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Custom bindings for the Bluetooth API.
+// Custom binding for the Bluetooth API.
+
+var binding = require('binding').Binding.create('bluetooth');
var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
+var chrome = requireNative('chrome').GetChrome();
var sendRequest = require('sendRequest').sendRequest;
var lastError = require('lastError');
-// Use custom bindings to create an undocumented event listener that will
+// Use custom binding to create an undocumented event listener that will
// receive events about device discovery and call the event listener that was
// provided with the request to begin discovery.
-chromeHidden.registerCustomHook('bluetooth', function(api) {
+binding.registerCustomHook(function(api) {
var apiFunctions = api.apiFunctions;
chromeHidden.bluetooth = {};
@@ -154,3 +157,5 @@ chromeHidden.registerCustomHook('bluetooth', function(api) {
return args;
});
});
+
+exports.binding = binding.generate();

Powered by Google App Engine
This is Rietveld 408576698