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..f814723b92c8fa990e8b510f5c65e41f1f19040d 100644 |
--- a/chrome/common/extensions/api/extension_api.cc |
+++ b/chrome/common/extensions/api/extension_api.cc |
@@ -622,7 +622,7 @@ void RemoveDisallowedAPIs(const Extension& extension, |
} // namespace |
-scoped_ptr<std::set<std::string> > ExtensionAPI::GetAPIsForContext( |
+std::set<std::string> ExtensionAPI::GetAPIsForContext( |
Feature::Context context, const Extension* extension, const GURL& url) { |
// We're forced to load all schemas now because we need to know the metadata |
// about every API -- and the metadata is stored in the schemas themselves. |
@@ -680,17 +680,26 @@ scoped_ptr<std::set<std::string> > ExtensionAPI::GetAPIsForContext( |
// Filter out all non-API features and remove the feature type part of the |
// name. |
- scoped_ptr<std::set<std::string> > result(new std::set<std::string>()); |
+ std::set<std::string> result; |
for (std::set<std::string>::iterator iter = temp_result.begin(); |
iter != temp_result.end(); ++iter) { |
std::string feature_type; |
std::string feature_name; |
SplitDependencyName(*iter, &feature_type, &feature_name); |
if (feature_type == "api") |
- result->insert(feature_name); |
+ result.insert(feature_name); |
} |
- return result.Pass(); |
+ return result; |
+} |
+ |
+std::set<std::string> ExtensionAPI::GetAllAPINames() { |
+ // Don't do this. Instead reference the unloaded schemas and load as needed. |
+ LoadAllSchemas(); |
+ std::set<std::string> result; |
+ for (SchemaMap::iterator i = schemas_.begin(); i != schemas_.end(); ++i) |
+ result.insert(i->first); |
+ return result; |
} |
Feature* ExtensionAPI::GetFeature(const std::string& full_name) { |