diff options
author | scheib@chromium.org <scheib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-26 23:56:00 +0000 |
---|---|---|
committer | scheib@chromium.org <scheib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-26 23:56:00 +0000 |
commit | 9dfb37227e873f4631867feddbdda1c042727c98 (patch) | |
tree | dc9c3468e76fd05c3f0d1eb54d9d45faa8799986 /extensions/common/features | |
parent | cab97b81565462964d55b483b8ca4d808fe2562b (diff) | |
download | chromium_src-9dfb37227e873f4631867feddbdda1c042727c98.zip chromium_src-9dfb37227e873f4631867feddbdda1c042727c98.tar.gz chromium_src-9dfb37227e873f4631867feddbdda1c042727c98.tar.bz2 |
Remove service worker concepts from _api_features.json
BUG=396340
Review URL: https://codereview.chromium.org/414633002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285819 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/common/features')
-rw-r--r-- | extensions/common/features/api_feature.cc | 7 | ||||
-rw-r--r-- | extensions/common/features/api_feature.h | 2 | ||||
-rw-r--r-- | extensions/common/features/complex_feature.cc | 14 | ||||
-rw-r--r-- | extensions/common/features/complex_feature.h | 1 | ||||
-rw-r--r-- | extensions/common/features/complex_feature_unittest.cc | 54 | ||||
-rw-r--r-- | extensions/common/features/feature.h | 3 | ||||
-rw-r--r-- | extensions/common/features/simple_feature.cc | 2 | ||||
-rw-r--r-- | extensions/common/features/simple_feature.h | 1 |
8 files changed, 2 insertions, 82 deletions
diff --git a/extensions/common/features/api_feature.cc b/extensions/common/features/api_feature.cc index fc7f707..e3e4c91 100644 --- a/extensions/common/features/api_feature.cc +++ b/extensions/common/features/api_feature.cc @@ -7,7 +7,7 @@ namespace extensions { APIFeature::APIFeature() - : internal_(false), blocked_in_service_worker_(false) {} + : internal_(false) {} APIFeature::~APIFeature() { } @@ -16,17 +16,12 @@ bool APIFeature::IsInternal() const { return internal_; } -bool APIFeature::IsBlockedInServiceWorker() const { - return blocked_in_service_worker_; -} - std::string APIFeature::Parse(const base::DictionaryValue* value) { std::string error = SimpleFeature::Parse(value); if (!error.empty()) return error; value->GetBoolean("internal", &internal_); - value->GetBoolean("blocked_in_service_worker", &blocked_in_service_worker_); if (contexts()->empty()) return name() + ": API features must specify at least one context."; diff --git a/extensions/common/features/api_feature.h b/extensions/common/features/api_feature.h index 1e57b8d..c146f9d 100644 --- a/extensions/common/features/api_feature.h +++ b/extensions/common/features/api_feature.h @@ -18,13 +18,11 @@ class APIFeature : public SimpleFeature { // extensions::Feature: virtual bool IsInternal() const OVERRIDE; - virtual bool IsBlockedInServiceWorker() const OVERRIDE; virtual std::string Parse(const base::DictionaryValue* value) OVERRIDE; private: bool internal_; - bool blocked_in_service_worker_; }; } // namespace extensions diff --git a/extensions/common/features/complex_feature.cc b/extensions/common/features/complex_feature.cc index 9440285..674b4ee 100644 --- a/extensions/common/features/complex_feature.cc +++ b/extensions/common/features/complex_feature.cc @@ -12,20 +12,14 @@ ComplexFeature::ComplexFeature(scoped_ptr<FeatureList> features) { no_parent_ = features_[0]->no_parent(); #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) - // Verify IsInternal and IsBlockedInServiceWorker are consistent across all - // features. + // Verify IsInternal and no_parent is 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_is_internal == (*it)->IsInternal()) << "Complex feature must have consistent values of " "internal across all sub features."; - DCHECK(first_blocked_in_service_worker == (*it)->IsBlockedInServiceWorker()) - << "Complex feature must have consistent values of " - "blocked_in_service_worker across all sub features."; DCHECK(no_parent_ == (*it)->no_parent()) << "Complex feature must have consistent values of " "no_parent across all sub features."; @@ -102,12 +96,6 @@ bool ComplexFeature::IsIdInWhitelist(const std::string& extension_id) const { return false; } -bool ComplexFeature::IsBlockedInServiceWorker() const { - // Constructor verifies that composed features are consistent, thus we can - // return just the first feature's value. - return features_[0]->IsBlockedInServiceWorker(); -} - bool ComplexFeature::IsInternal() const { // Constructor verifies that composed features are consistent, thus we can // return just the first feature's value. diff --git a/extensions/common/features/complex_feature.h b/extensions/common/features/complex_feature.h index 9204b25..bbb73e4 100644 --- a/extensions/common/features/complex_feature.h +++ b/extensions/common/features/complex_feature.h @@ -39,7 +39,6 @@ class ComplexFeature : public Feature { virtual bool IsIdInBlacklist(const std::string& extension_id) const OVERRIDE; virtual bool IsIdInWhitelist(const std::string& extension_id) const OVERRIDE; - virtual bool IsBlockedInServiceWorker() const OVERRIDE; protected: // extensions::Feature: diff --git a/extensions/common/features/complex_feature_unittest.cc b/extensions/common/features/complex_feature_unittest.cc index bef056d..54e52863 100644 --- a/extensions/common/features/complex_feature_unittest.cc +++ b/extensions/common/features/complex_feature_unittest.cc @@ -6,14 +6,11 @@ #include "chrome/common/extensions/features/chrome_channel_feature_filter.h" #include "chrome/common/extensions/features/feature_channel.h" -#include "extensions/common/features/api_feature.h" #include "extensions/common/features/simple_feature.h" -#include "extensions/common/test_util.h" #include "extensions/common/value_builder.h" #include "testing/gtest/include/gtest/gtest.h" using chrome::VersionInfo; -using extensions::APIFeature; using extensions::ComplexFeature; using extensions::DictionaryBuilder; using extensions::Feature; @@ -21,7 +18,6 @@ using extensions::ListBuilder; using extensions::Manifest; using extensions::ScopedCurrentChannel; using extensions::SimpleFeature; -using extensions::test_util::ParseJsonDictionaryWithSingleQuotes; namespace { @@ -165,56 +161,6 @@ TEST_F(ExtensionComplexFeatureTest, MultipleRulesChannels) { } } -// Tests a complex feature with blocked_in_service_worker returns true for -// IsBlockedInServiceWorker(). -TEST_F(ExtensionComplexFeatureTest, BlockedInServiceWorker) { - scoped_ptr<ComplexFeature::FeatureList> features( - new ComplexFeature::FeatureList()); - - // Two feature rules, both with blocked_in_service_worker: true. - scoped_ptr<SimpleFeature> api_feature(new APIFeature()); - api_feature->Parse(ParseJsonDictionaryWithSingleQuotes( - "{" - " 'channel': 'trunk'," - " 'blocked_in_service_worker': true" - "}").get()); - features->push_back(api_feature.release()); - - api_feature.reset(new APIFeature()); - api_feature->Parse(ParseJsonDictionaryWithSingleQuotes( - "{" - " 'channel': 'stable'," - " 'blocked_in_service_worker': true" - "}").get()); - features->push_back(api_feature.release()); - - EXPECT_TRUE(ComplexFeature(features.Pass()).IsBlockedInServiceWorker()); -} - -// Tests a complex feature without blocked_in_service_worker returns false for -// IsBlockedInServiceWorker(). -TEST_F(ExtensionComplexFeatureTest, NotBlockedInServiceWorker) { - scoped_ptr<ComplexFeature::FeatureList> features( - new ComplexFeature::FeatureList()); - - // Two feature rules without blocked_in_service_worker. - scoped_ptr<SimpleFeature> api_feature(new APIFeature()); - api_feature->Parse(ParseJsonDictionaryWithSingleQuotes( - "{" - " 'channel': 'trunk'" - "}").get()); - features->push_back(api_feature.release()); - - api_feature.reset(new APIFeature()); - api_feature->Parse(ParseJsonDictionaryWithSingleQuotes( - "{" - " 'channel': 'stable'" - "}").get()); - features->push_back(api_feature.release()); - - EXPECT_FALSE(ComplexFeature(features.Pass()).IsBlockedInServiceWorker()); -} - // Tests that dependencies are correctly checked. TEST_F(ExtensionComplexFeatureTest, Dependencies) { scoped_ptr<ComplexFeature::FeatureList> features( diff --git a/extensions/common/features/feature.h b/extensions/common/features/feature.h index 4efa3bf..0300ed0 100644 --- a/extensions/common/features/feature.h +++ b/extensions/common/features/feature.h @@ -114,9 +114,6 @@ class Feature { // Tests whether this is an internal API or not. virtual bool IsInternal() const = 0; - // Returns True for features excluded from service worker backed contexts. - virtual bool IsBlockedInServiceWorker() const = 0; - // Returns true if the feature is available to be parsed into a new extension // manifest. Availability IsAvailableToManifest(const std::string& extension_id, diff --git a/extensions/common/features/simple_feature.cc b/extensions/common/features/simple_feature.cc index b06be9f..bdf8fae 100644 --- a/extensions/common/features/simple_feature.cc +++ b/extensions/common/features/simple_feature.cc @@ -513,8 +513,6 @@ bool SimpleFeature::IsInternal() const { return false; } -bool SimpleFeature::IsBlockedInServiceWorker() const { return false; } - bool SimpleFeature::IsIdInBlacklist(const std::string& extension_id) const { return IsIdInList(extension_id, blacklist_); } diff --git a/extensions/common/features/simple_feature.h b/extensions/common/features/simple_feature.h index 7df6e19..395e7e7 100644 --- a/extensions/common/features/simple_feature.h +++ b/extensions/common/features/simple_feature.h @@ -106,7 +106,6 @@ class SimpleFeature : public Feature { Context context) const OVERRIDE; virtual bool IsInternal() const OVERRIDE; - virtual bool IsBlockedInServiceWorker() const OVERRIDE; virtual bool IsIdInBlacklist(const std::string& extension_id) const OVERRIDE; virtual bool IsIdInWhitelist(const std::string& extension_id) const OVERRIDE; |