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

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

Issue 2199683002: Reland 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 ab5e026efde740b3a430804519dfde84d9bf6ea3..578bb1609405be19ba86cfdb942dda25ae364059 100644
--- a/extensions/common/features/json_feature_provider.cc
+++ b/extensions/common/features/json_feature_provider.cc
@@ -116,8 +116,7 @@
static_cast<const base::ListValue*>(&iter.value());
CHECK_GT(list->GetSize(), 0UL);
- std::unique_ptr<ComplexFeature::FeatureList> features(
- new ComplexFeature::FeatureList());
+ std::vector<Feature*> features;
// Parse and add all SimpleFeatures from the list.
for (const auto& entry : *list) {
@@ -131,14 +130,13 @@
if (!ParseFeature(dict, iter.key(), feature.get()))
continue;
- features->push_back(std::move(feature));
+ features.push_back(feature.release());
}
- std::unique_ptr<ComplexFeature> feature(
- new ComplexFeature(std::move(features)));
+ std::unique_ptr<ComplexFeature> feature(new ComplexFeature(&features));
feature->set_name(iter.key());
- AddFeature(iter.key(), std::move(feature));
+ AddFeature(iter.key(), feature.release());
} 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