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

Unified Diff: chrome/common/extensions/api/extension_api.cc

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/common/extensions/api/extension_api.cc
diff --git a/chrome/common/extensions/api/extension_api.cc b/chrome/common/extensions/api/extension_api.cc
index 0a9766348df2958092fca441eb8149fbd18457ce..8f5a56e1bec6f52daa2193fa4e4a9fb95090c1c2 100644
--- a/chrome/common/extensions/api/extension_api.cc
+++ b/chrome/common/extensions/api/extension_api.cc
@@ -693,6 +693,15 @@ scoped_ptr<std::set<std::string> > ExtensionAPI::GetAPIsForContext(
return result.Pass();
}
+scoped_ptr<std::set<std::string> > ExtensionAPI::GetAllAPINames() {
+ // Don't do this. Instead reference the unloaded schemas and load as needed.
not at google - send to devlin 2012/12/13 22:26:40 Yup. Loading all the schemas somewhat defeats load
+ LoadAllSchemas();
+ scoped_ptr<std::set<std::string> > result(new std::set<std::string>());
+ for (SchemaMap::iterator i = schemas_.begin(); i != schemas_.end(); ++i)
+ result->insert(i->first);
+ return result.Pass();
+}
+
Feature* ExtensionAPI::GetFeature(const std::string& full_name) {
// Ensure it's loaded.
GetSchema(full_name);

Powered by Google App Engine
This is Rietveld 408576698