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

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: . 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
« no previous file with comments | « chrome/renderer/extensions/dispatcher.cc ('k') | tools/json_schema_compiler/compiler.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a878c0669e96538b194e18e0eae90388d21d9d4e 100644
--- a/chrome/renderer/resources/extensions/test_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/test_custom_bindings.js
@@ -8,8 +8,9 @@
var binding = require('binding').Binding.create('test');
var chrome = requireNative('chrome').GetChrome();
-var GetExtensionAPIDefinition =
- requireNative('apiDefinitions').GetExtensionAPIDefinition;
+var GetExtensionAPIDefinitions =
+ requireNative('apiDefinitions').GetExtensionAPIDefinitions;
+var GetAvailability = requireNative('v8_context').GetAvailability;
binding.registerCustomHook(function(api) {
var chromeTest = api.compiledApi;
@@ -283,8 +284,10 @@ binding.registerCustomHook(function(api) {
chromeTest.runNextTest();
});
- apiFunctions.setHandleRequest('getApiDefinitions', function(apiNames) {
- return GetExtensionAPIDefinition();
+ apiFunctions.setHandleRequest('getApiDefinitions', function() {
+ return GetExtensionAPIDefinitions().filter(function(api) {
+ return GetAvailability(api.namespace).is_available;
+ });
});
});
« no previous file with comments | « chrome/renderer/extensions/dispatcher.cc ('k') | tools/json_schema_compiler/compiler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698