Chromium Code Reviews| Index: extensions/common/features/complex_feature.cc |
| diff --git a/extensions/common/features/complex_feature.cc b/extensions/common/features/complex_feature.cc |
| index eeb4f776a4df21ed07a1eea2d2550a89557a036c..ae52a94c7d34b441275276b46550b890575a6093 100644 |
| --- a/extensions/common/features/complex_feature.cc |
| +++ b/extensions/common/features/complex_feature.cc |
| @@ -12,18 +12,14 @@ ComplexFeature::ComplexFeature(scoped_ptr<FeatureList> features) { |
| no_parent_ = features_[0]->no_parent(); |
| #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) |
| - // Verify GetContexts, IsInternal, & IsBlockedInServiceWorker are consistent |
| - // across all features. |
| - std::set<Feature::Context>* first_contexts = features_[0]->GetContexts(); |
| + // Verify IsInternal, & IsBlockedInServiceWorker are consistent across all |
|
Yoyo Zhou
2014/07/09 17:06:18
nit: comma seems extraneous
not at google - send to devlin
2014/07/09 17:12:00
Done.
|
| + // features. |
| bool first_is_internal = features_[0]->IsInternal(); |
| bool first_blocked_in_service_worker = |
| features_[0]->IsBlockedInServiceWorker(); |
| for (FeatureList::const_iterator it = features_.begin() + 1; |
| it != features_.end(); |
| ++it) { |
| - DCHECK(*first_contexts == *(*it)->GetContexts()) |
| - << "Complex feature must have consistent values of " |
| - "contexts across all sub features."; |
| DCHECK(first_is_internal == (*it)->IsInternal()) |
| << "Complex feature must have consistent values of " |
| "internal across all sub features."; |
| @@ -112,16 +108,9 @@ bool ComplexFeature::IsBlockedInServiceWorker() const { |
| return features_[0]->IsBlockedInServiceWorker(); |
| } |
| -std::set<Feature::Context>* ComplexFeature::GetContexts() { |
| - // TODO(justinlin): Current use cases for ComplexFeatures are simple (e.g. |
| - // allow API in dev channel for everyone but stable channel for a whitelist), |
| - // but if they get more complicated, we need to return some meaningful context |
| - // set. Either that or remove this method from the Feature interface. |
| - return features_[0]->GetContexts(); |
| -} |
| - |
| bool ComplexFeature::IsInternal() const { |
| - // TODO(justinlin): Same as the above TODO. |
| + // Constructor verifies that composed features are consistent, thus we can |
| + // return just the first feature's value. |
| return features_[0]->IsInternal(); |
| } |