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

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

Issue 377753003: Remove GetContexts() from the public interface of extensions::Feature. It was (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/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();
}

Powered by Google App Engine
This is Rietveld 408576698