Index: chrome/common/extensions/features/simple_feature_provider.cc |
diff --git a/chrome/common/extensions/features/simple_feature_provider.cc b/chrome/common/extensions/features/simple_feature_provider.cc |
index 4c76dea9a1a2fddd2ced1ca7749384aa9aa47cfa..b6aeba04d8f1c0b483873bd5578f2ace038970d2 100644 |
--- a/chrome/common/extensions/features/simple_feature_provider.cc |
+++ b/chrome/common/extensions/features/simple_feature_provider.cc |
@@ -17,8 +17,8 @@ namespace extensions { |
namespace { |
template<class FeatureClass> |
-SimpleFeature* CreateFeature() { |
- return new FeatureClass(); |
+Feature* CreateFeature(Feature* feature) { |
+ return new FeatureClass(feature); |
} |
struct Static { |
@@ -86,16 +86,17 @@ base::LazyInstance<Static> g_static = LAZY_INSTANCE_INITIALIZER; |
SimpleFeatureProvider::SimpleFeatureProvider(const DictionaryValue& root, |
FeatureFactory factory) |
: factory_(factory ? factory : |
- static_cast<FeatureFactory>(&CreateFeature<SimpleFeature>)) { |
+ static_cast<FeatureFactory>(&CreateFeature<ManifestFeature>)) { |
for (DictionaryValue::Iterator iter(root); iter.HasNext(); iter.Advance()) { |
if (iter.value().GetType() == Value::TYPE_DICTIONARY) { |
- linked_ptr<SimpleFeature> feature((*factory_)()); |
+ scoped_ptr<SimpleFeature> simple_feature(new SimpleFeature()); |
if (!ParseFeature(static_cast<const DictionaryValue*>(&iter.value()), |
iter.key(), |
- feature.get())) |
+ simple_feature.get())) |
continue; |
+ linked_ptr<Feature> feature((*factory_)(simple_feature.release())); |
features_[iter.key()] = feature; |
} else if (iter.value().GetType() == Value::TYPE_LIST) { |
// This is a complex feature. |
@@ -113,13 +114,13 @@ SimpleFeatureProvider::SimpleFeatureProvider(const DictionaryValue& root, |
continue; |
} |
- scoped_ptr<SimpleFeature> feature((*factory_)()); |
+ scoped_ptr<SimpleFeature> feature(new SimpleFeature()); |
if (!ParseFeature(static_cast<const DictionaryValue*>(*list_iter), |
iter.key(), |
feature.get())) |
continue; |
- features->push_back(feature.release()); |
+ features->push_back((*factory_)(feature.release())); |
} |
linked_ptr<ComplexFeature> feature(new ComplexFeature(features.Pass())); |