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

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

Issue 12313142: Revert 184837 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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/common/extensions/api/extension_api.cc
===================================================================
--- chrome/common/extensions/api/extension_api.cc (revision 184858)
+++ chrome/common/extensions/api/extension_api.cc (working copy)
@@ -543,7 +543,7 @@
} // namespace
-std::set<std::string> ExtensionAPI::GetAPIsForContext(
+scoped_ptr<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.
@@ -601,30 +601,19 @@
// Filter out all non-API features and remove the feature type part of the
// name.
- std::set<std::string> result;
+ scoped_ptr<std::set<std::string> > result(new std::set<std::string>());
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;
+ return result.Pass();
}
-std::set<std::string> ExtensionAPI::GetAllAPINames() {
- std::set<std::string> result;
- for (SchemaMap::iterator i = schemas_.begin(); i != schemas_.end(); ++i)
- result.insert(i->first);
- for (UnloadedSchemaMap::iterator i = unloaded_schemas_.begin();
- i != unloaded_schemas_.end(); ++i) {
- result.insert(i->first);
- }
- return result;
-}
-
Feature* ExtensionAPI::GetFeature(const std::string& full_name) {
// Ensure it's loaded.
GetSchema(full_name);
« no previous file with comments | « chrome/common/extensions/api/extension_api.h ('k') | chrome/common/extensions/api/extension_api_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698