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

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

Issue 12522004: Lazily load extension API schemas (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 9 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/test_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/test_custom_bindings.js b/chrome/renderer/resources/extensions/test_custom_bindings.js
index 300ba42766ea71e38b8c8ff065196f4734a09226..229c172e61f4233aedc7f8add2d8fdc60745dd4d 100644
--- a/chrome/renderer/resources/extensions/test_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/test_custom_bindings.js
@@ -10,6 +10,7 @@ var binding = require('binding').Binding.create('test');
var chrome = requireNative('chrome').GetChrome();
var GetExtensionAPIDefinition =
requireNative('apiDefinitions').GetExtensionAPIDefinition;
+var GetAvailability = requireNative('v8_context').GetAvailability;
binding.registerCustomHook(function(api) {
var chromeTest = api.compiledApi;
@@ -284,7 +285,13 @@ binding.registerCustomHook(function(api) {
});
apiFunctions.setHandleRequest('getApiDefinitions', function(apiNames) {
- return GetExtensionAPIDefinition();
+ var apis = GetExtensionAPIDefinition();
+ var available_apis = [];
+ for (var i in apis) {
+ if (GetAvailability(apis[i].namespace).is_available)
+ available_apis.push(apis[i]);
+ }
+ return available_apis;;
not at google - send to devlin 2013/03/22 18:13:48 woo: return GetExtensionAPIDefinition().filter(fu
cduvall 2013/03/22 20:26:45 Done.
});
});
« chrome/renderer/extensions/dispatcher.cc ('K') | « chrome/renderer/extensions/dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698