summaryrefslogtreecommitdiffstats
path: root/extensions/common/extension.h
diff options
context:
space:
mode:
authorrdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-05 16:16:30 +0000
committerrdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-05 16:16:30 +0000
commitd695bb139a93f2c0cab08b1801c2cddba1a39773 (patch)
treeb6ee5cfc101d0506d87200f0b09d6189754834ff /extensions/common/extension.h
parent32e8a26ae2917d695551f1e37701e0eff52879de (diff)
downloadchromium_src-d695bb139a93f2c0cab08b1801c2cddba1a39773.zip
chromium_src-d695bb139a93f2c0cab08b1801c2cddba1a39773.tar.gz
chromium_src-d695bb139a93f2c0cab08b1801c2cddba1a39773.tar.bz2
Refactor PermissionsData pt1
In this CL, we: - Make PermissionsData not-so-static. Only methods which either don't rely on knowledge of specific permissions or methods to get/create the object are static. - Separate runtime permissions knowledge from manifest parsing (PermissionsData vs PermissionsParser) - Move required/optional permissions access into PermissionsParser. - Handle the locking issues. BUG=379356 TBR=sky@chromium.org (for c/b/ui/, no functional changes) Review URL: https://codereview.chromium.org/309533007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275142 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/common/extension.h')
-rw-r--r--extensions/common/extension.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/extensions/common/extension.h b/extensions/common/extension.h
index 797c906..1423adb 100644
--- a/extensions/common/extension.h
+++ b/extensions/common/extension.h
@@ -43,10 +43,11 @@ class ImageSkia;
}
namespace extensions {
-class PermissionsData;
class APIPermissionSet;
class ManifestPermissionSet;
class PermissionSet;
+class PermissionsData;
+class PermissionsParser;
// Uniquely identifies an Extension, using 32 characters from the alphabet
// 'a'-'p'. An empty string represents "no extension".
@@ -309,7 +310,11 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
bool converted_from_user_script() const {
return converted_from_user_script_;
}
- PermissionsData* permissions_data() { return permissions_data_.get(); }
+ PermissionsParser* permissions_parser() { return permissions_parser_.get(); }
+ const PermissionsParser* permissions_parser() const {
+ return permissions_parser_.get();
+ }
+
const PermissionsData* permissions_data() const {
return permissions_data_.get();
}
@@ -428,6 +433,12 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
// Defines the set of URLs in the extension's web content.
URLPatternSet extent_;
+ // The parser for the manifest's permissions. This is NULL anytime not during
+ // initialization.
+ // TODO(rdevlin.cronin): This doesn't really belong here.
+ scoped_ptr<PermissionsParser> permissions_parser_;
+
+ // The active permissions for the extension.
scoped_ptr<PermissionsData> permissions_data_;
// Any warnings that occurred when trying to create/parse the extension.