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

Unified Diff: extensions/common/features/json_feature_provider.cc

Issue 2201653003: Revert of Further reduction of feature_compiler.py generated code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test-with-leiz
Patch Set: Created 4 years, 5 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: extensions/common/features/json_feature_provider.cc
diff --git a/extensions/common/features/json_feature_provider.cc b/extensions/common/features/json_feature_provider.cc
index 578bb1609405be19ba86cfdb942dda25ae364059..ab5e026efde740b3a430804519dfde84d9bf6ea3 100644
--- a/extensions/common/features/json_feature_provider.cc
+++ b/extensions/common/features/json_feature_provider.cc
@@ -116,7 +116,8 @@
static_cast<const base::ListValue*>(&iter.value());
CHECK_GT(list->GetSize(), 0UL);
- std::vector<Feature*> features;
+ std::unique_ptr<ComplexFeature::FeatureList> features(
+ new ComplexFeature::FeatureList());
// Parse and add all SimpleFeatures from the list.
for (const auto& entry : *list) {
@@ -130,13 +131,14 @@
if (!ParseFeature(dict, iter.key(), feature.get()))
continue;
- features.push_back(feature.release());
+ features->push_back(std::move(feature));
}
- std::unique_ptr<ComplexFeature> feature(new ComplexFeature(&features));
+ std::unique_ptr<ComplexFeature> feature(
+ new ComplexFeature(std::move(features)));
feature->set_name(iter.key());
- AddFeature(iter.key(), feature.release());
+ AddFeature(iter.key(), std::move(feature));
} else {
LOG(ERROR) << iter.key() << ": Feature description must be dictionary or"
<< " list of dictionaries.";
« no previous file with comments | « extensions/common/features/complex_feature_unittest.cc ('k') | extensions/common/features/simple_feature_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698