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

Unified Diff: extensions/renderer/api_definitions_natives.cc

Issue 1772683002: FeatureProvider returns std::map instead of vector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 4 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 | « extensions/common/manifest.cc ('k') | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/api_definitions_natives.cc
diff --git a/extensions/renderer/api_definitions_natives.cc b/extensions/renderer/api_definitions_natives.cc
index 61ea7109fc282b169c8b29a2b0099afcc23c0ad7..96f1f2c6eb80b21f690ec6bb26f6a80dc69ac12a 100644
--- a/extensions/renderer/api_definitions_natives.cc
+++ b/extensions/renderer/api_definitions_natives.cc
@@ -24,14 +24,10 @@ void ApiDefinitionsNatives::GetExtensionAPIDefinitionsForTest(
const v8::FunctionCallbackInfo<v8::Value>& args) {
std::vector<std::string> apis;
const FeatureProvider* feature_provider = FeatureProvider::GetAPIFeatures();
- const std::vector<std::string>& feature_names =
- feature_provider->GetAllFeatureNames();
- for (std::vector<std::string>::const_iterator i = feature_names.begin();
- i != feature_names.end();
- ++i) {
- if (!feature_provider->GetParent(feature_provider->GetFeature(*i)) &&
- context()->GetAvailability(*i).is_available()) {
- apis.push_back(*i);
+ for (const auto& map_entry : feature_provider->GetAllFeatures()) {
+ if (!feature_provider->GetParent(map_entry.second.get()) &&
+ context()->GetAvailability(map_entry.first).is_available()) {
+ apis.push_back(map_entry.first);
}
}
args.GetReturnValue().Set(
« no previous file with comments | « extensions/common/manifest.cc ('k') | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698