diff options
author | jyasskin@chromium.org <jyasskin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-18 04:53:46 +0000 |
---|---|---|
committer | jyasskin@chromium.org <jyasskin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-18 04:53:46 +0000 |
commit | b5b9583428ed64545fefccdb2570c488fae4840b (patch) | |
tree | fbbb125f87f03ae0ec8757b16056e586277c7aa5 /extensions/common/extension_api.cc | |
parent | c068020aaff82bcc4f36ff7a65f1f2fe4adef7b7 (diff) | |
download | chromium_src-b5b9583428ed64545fefccdb2570c488fae4840b.zip chromium_src-b5b9583428ed64545fefccdb2570c488fae4840b.tar.gz chromium_src-b5b9583428ed64545fefccdb2570c488fae4840b.tar.bz2 |
Pass a Feature* to IsAnyFeatureAvailableToContext instead of a string name.
This makes it clear that we were never passing non-feature function names, which
lets us simplify the test.
BUG=305000
Review URL: https://codereview.chromium.org/109683007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241490 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/common/extension_api.cc')
-rw-r--r-- | extensions/common/extension_api.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/extensions/common/extension_api.cc b/extensions/common/extension_api.cc index d5e96ad..13c1ce3 100644 --- a/extensions/common/extension_api.cc +++ b/extensions/common/extension_api.cc @@ -276,7 +276,7 @@ void ExtensionAPI::RegisterDependencyProvider(const std::string& name, dependency_providers_[name] = provider; } -bool ExtensionAPI::IsAnyFeatureAvailableToContext(const std::string& api_name, +bool ExtensionAPI::IsAnyFeatureAvailableToContext(const Feature& api, const Extension* extension, Feature::Context context, const GURL& url) { @@ -290,12 +290,13 @@ bool ExtensionAPI::IsAnyFeatureAvailableToContext(const std::string& api_name, for (std::vector<std::string>::const_iterator i = features.begin(); i != features.end(); ++i) { const std::string& feature_name = *i; - if (feature_name != api_name && feature_name.find(api_name + ".") == 0) { + if (feature_name != api.name() && + feature_name.find(api.name() + ".") == 0) { if (IsAvailable(feature_name, extension, context, url).is_available()) return true; } } - return IsAvailable(api_name, extension, context, url).is_available(); + return IsAvailable(api.name(), extension, context, url).is_available(); } Feature::Availability ExtensionAPI::IsAvailable(const std::string& full_name, |