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

Unified Diff: chrome/common/extensions/permissions/permission_set.cc

Issue 12209094: Support requesting subsets of host permissions using the permissions API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix urlpatternsettest Created 7 years, 10 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: chrome/common/extensions/permissions/permission_set.cc
diff --git a/chrome/common/extensions/permissions/permission_set.cc b/chrome/common/extensions/permissions/permission_set.cc
index 0f572ee5c38638f48bce2d29339a5558021ddf39..b8d2ee60ac3a5066dc2189867386bf2c7dcc4ea5 100644
--- a/chrome/common/extensions/permissions/permission_set.cc
+++ b/chrome/common/extensions/permissions/permission_set.cc
@@ -224,20 +224,9 @@ bool PermissionSet::operator==(
}
bool PermissionSet::Contains(const PermissionSet& set) const {
- // Every set includes the empty set.
- if (set.IsEmpty())
- return true;
-
- if (!apis_.Contains(set.apis()))
- return false;
-
- if (!explicit_hosts().Contains(set.explicit_hosts()))
- return false;
-
- if (!scriptable_hosts().Contains(set.scriptable_hosts()))
- return false;
-
- return true;
+ return apis_.Contains(set.apis()) &&
+ explicit_hosts().Contains(set.explicit_hosts()) &&
+ scriptable_hosts().Contains(set.scriptable_hosts());
}
std::set<std::string> PermissionSet::GetAPIsAsStrings() const {

Powered by Google App Engine
This is Rietveld 408576698