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

Unified Diff: extensions/common/permissions/permission_set.h

Issue 1349613003: [Extensions] Un-refcount PermissionSet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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: extensions/common/permissions/permission_set.h
diff --git a/extensions/common/permissions/permission_set.h b/extensions/common/permissions/permission_set.h
index a6c62be491c94cabb5026b282dde4ec3ebf9fa16..b0156d5ad13089c044a97d27458157d48412874c 100644
--- a/extensions/common/permissions/permission_set.h
+++ b/extensions/common/permissions/permission_set.h
@@ -25,8 +25,7 @@ namespace extensions {
// PermissionMessageProvider::GetCoalescedPermissionMessages() is the only
// method used for generating permission messages, find the other users of this
// class and deprecate or rename it as appropriate.
-class PermissionSet
- : public base::RefCountedThreadSafe<PermissionSet> {
+class PermissionSet {
public:
// Creates an empty permission set (e.g. default permissions).
PermissionSet();
@@ -39,26 +38,29 @@ class PermissionSet
const ManifestPermissionSet& manifest_permissions,
const URLPatternSet& explicit_hosts,
const URLPatternSet& scriptable_hosts);
+ ~PermissionSet();
// Creates a new permission set equal to |set1| - |set2|.
- static scoped_refptr<const PermissionSet> CreateDifference(
+ static scoped_ptr<const PermissionSet> CreateDifference(
const PermissionSet& set1,
const PermissionSet& set2);
// Creates a new permission set equal to the intersection of |set1| and
// |set2|.
- static scoped_refptr<const PermissionSet> CreateIntersection(
+ static scoped_ptr<const PermissionSet> CreateIntersection(
const PermissionSet& set1,
const PermissionSet& set2);
// Creates a new permission set equal to the union of |set1| and |set2|.
- static scoped_refptr<const PermissionSet> CreateUnion(
- const PermissionSet& set1,
- const PermissionSet& set2);
+ static scoped_ptr<const PermissionSet> CreateUnion(const PermissionSet& set1,
+ const PermissionSet& set2);
bool operator==(const PermissionSet& rhs) const;
bool operator!=(const PermissionSet& rhs) const;
+ // Returns a copy of this PermissionSet.
+ scoped_ptr<const PermissionSet> Clone() const;
not at google - send to devlin 2015/09/22 21:51:26 It's a bit odd to have a Clone() method but no DIS
Devlin 2015/09/23 17:08:59 Done.
+
// Returns true if every API or host permission available to |set| is also
// available to this. In other words, if the API permissions of |set| are a
// subset of this, and the host permissions in this encompass those in |set|.
@@ -123,9 +125,6 @@ class PermissionSet
private:
FRIEND_TEST_ALL_PREFIXES(PermissionsTest, GetWarningMessages_AudioVideo);
FRIEND_TEST_ALL_PREFIXES(PermissionsTest, AccessToDevicesMessages);
- friend class base::RefCountedThreadSafe<PermissionSet>;
-
- ~PermissionSet();
// Adds permissions implied independently of other context.
void InitImplicitPermissions();

Powered by Google App Engine
This is Rietveld 408576698