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

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: are you happy yet?!?!? 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 95f9a9c2448bed5da93b8ae88fee5a1c392b49c3..4c4327c7a4517389bae36c87cc49cc2e3923d37e 100644
--- a/chrome/common/extensions/permissions/permission_set.cc
+++ b/chrome/common/extensions/permissions/permission_set.cc
@@ -225,20 +225,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