diff options
author | jstritar@chromium.org <jstritar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-27 14:50:40 +0000 |
---|---|---|
committer | jstritar@chromium.org <jstritar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-27 14:50:40 +0000 |
commit | 59759fcfdc091c9c77db249a6781308c8c3fd942 (patch) | |
tree | 89636f8f63059458e4acc57d8a7c67533b4fb726 /chrome/common/extensions/extension_permission_set.h | |
parent | 38383b194bc471ebba4de124cbf391b00114923a (diff) | |
download | chromium_src-59759fcfdc091c9c77db249a6781308c8c3fd942.zip chromium_src-59759fcfdc091c9c77db249a6781308c8c3fd942.tar.gz chromium_src-59759fcfdc091c9c77db249a6781308c8c3fd942.tar.bz2 |
Revert 94288 - Add an experimental permissions API for extensions.
The permissions API lets extensions specify optional permissions in their manifest that they can request at run-time. It currently supports API permissions through a white-list. Host permissions will come later.
BUG=48119, 70466, 84507
TEST=*Extension*
Review URL: http://codereview.chromium.org/7432006
TBR=jstritar@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94289 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension_permission_set.h')
-rw-r--r-- | chrome/common/extensions/extension_permission_set.h | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/chrome/common/extensions/extension_permission_set.h b/chrome/common/extensions/extension_permission_set.h index 3d4d353..c9a67e9 100644 --- a/chrome/common/extensions/extension_permission_set.h +++ b/chrome/common/extensions/extension_permission_set.h @@ -13,7 +13,6 @@ #include "base/gtest_prod_util.h" #include "base/memory/singleton.h" -#include "base/memory/ref_counted.h" #include "base/scoped_ptr.h" #include "base/string16.h" #include "chrome/common/extensions/url_pattern_set.h" @@ -122,7 +121,6 @@ class ExtensionAPIPermission { kWebstorePrivate, kDevtools, kPlugin, - kPermissions, kEnumBoundary }; @@ -268,8 +266,7 @@ class ExtensionPermissionsInfo { // The ExtensionPermissionSet is an immutable class that encapsulates an // extension's permissions. The class exposes set operations for combining and // manipulating the permissions. -class ExtensionPermissionSet - : public base::RefCountedThreadSafe<ExtensionPermissionSet> { +class ExtensionPermissionSet { public: // Creates an empty permission set (e.g. default permissions). ExtensionPermissionSet(); @@ -289,26 +286,11 @@ class ExtensionPermissionSet ~ExtensionPermissionSet(); - // Creates a new permission set equal to |set1| - |set2|, passing ownership of - // the new set to the caller. - static ExtensionPermissionSet* CreateDifference( - const ExtensionPermissionSet* set1, const ExtensionPermissionSet* set2); - - // Creates a new permission set equal to the intersection of |set1| and - // |set2|, passing ownership of the new set to the caller. - static ExtensionPermissionSet* CreateIntersection( - const ExtensionPermissionSet* set1, const ExtensionPermissionSet* set2); - // Creates a new permission set equal to the union of |set1| and |set2|. // Passes ownership of the new set to the caller. static ExtensionPermissionSet* CreateUnion( const ExtensionPermissionSet* set1, const ExtensionPermissionSet* set2); - bool operator==(const ExtensionPermissionSet& rhs) const; - - // Returns true if |set| is a subset of this. - bool Contains(const ExtensionPermissionSet& set) const; - // Gets the API permissions in this set as a set of strings. std::set<std::string> GetAPIsAsStrings() const; @@ -371,8 +353,6 @@ class ExtensionPermissionSet FRIEND_TEST_ALL_PREFIXES(ExtensionPermissionSetTest, HasLessHostPrivilegesThan); - friend class base::RefCountedThreadSafe<ExtensionPermissionSet>; - static std::set<std::string> GetDistinctHosts( const URLPatternSet& host_patterns, bool include_rcd); @@ -400,11 +380,9 @@ class ExtensionPermissionSet ExtensionAPIPermissionSet apis_; // The list of hosts that can be accessed directly from the extension. - // TODO(jstritar): Rename to "hosts_"? URLPatternSet explicit_hosts_; // The list of hosts that can be scripted by content scripts. - // TODO(jstritar): Rename to "user_script_hosts_"? URLPatternSet scriptable_hosts_; // The list of hosts this effectively grants access to. |