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

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: rebase 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
« no previous file with comments | « extensions/common/features/complex_feature.h ('k') | extensions/common/features/feature.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..94402859e7120f4a9ae593d5c934613e005fcfaa 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 and IsBlockedInServiceWorker are consistent across all
+ // 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();
}
« no previous file with comments | « extensions/common/features/complex_feature.h ('k') | extensions/common/features/feature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698