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

Unified Diff: ppapi/shared_impl/ppapi_permissions.h

Issue 10984094: Hook up PpapiPermissions in more places. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « ppapi/proxy/ppb_flash_proxy.cc ('k') | ppapi/shared_impl/ppapi_permissions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/ppapi_permissions.h
diff --git a/ppapi/shared_impl/ppapi_permissions.h b/ppapi/shared_impl/ppapi_permissions.h
index 8456fb7c19a0cfe8b2c09306d9c92c4f1e6aed0c..fb82cfcd268b1ee79865f89cc16445308fcce059 100644
--- a/ppapi/shared_impl/ppapi_permissions.h
+++ b/ppapi/shared_impl/ppapi_permissions.h
@@ -11,17 +11,34 @@
namespace ppapi {
enum Permission {
+ // Placeholder/uninitialized permission.
+ PERMISSION_NONE = 0,
+
// Allows access to dev interfaces.
PERMISSION_DEV = 1 << 0,
// Allows access to Browser-internal interfaces.
- PERMISSION_PRIVATE = 1 << 2,
+ PERMISSION_PRIVATE = 1 << 1,
// Allows ability to bypass user-gesture checks for showing things like
// file select dialogs.
- PERMISSION_BYPASS_USER_GESTURE = 1 << 3,
+ PERMISSION_BYPASS_USER_GESTURE = 1 << 2,
+
+ // Testing-only interfaces.
+ PERMISSION_TESTING = 1 << 3,
+
+ // Flash-related interfaces.
+ PERMISSION_FLASH = 1 << 4,
- // NOTE: If you add stuff be sure to update AllPermissions().
+ // NOTE: If you add stuff be sure to update PERMISSION_ALL_BITS.
+
+ // Meta permission for initializing plugins registered on the command line
+ // that get all permissions.
+ PERMISSION_ALL_BITS = PERMISSION_DEV |
+ PERMISSION_PRIVATE |
+ PERMISSION_BYPASS_USER_GESTURE |
+ PERMISSION_TESTING |
+ PERMISSION_FLASH
};
class PPAPI_SHARED_EXPORT PpapiPermissions {
@@ -38,8 +55,16 @@ class PPAPI_SHARED_EXPORT PpapiPermissions {
// and manually registered plugins.
static PpapiPermissions AllPermissions();
+ // Returns the effective permissions given the "base" permissions granted
+ // to the given plugin and the current command line flags, which may enable
+ // more features.
+ static PpapiPermissions GetForCommandLine(uint32 base_perms);
+
bool HasPermission(Permission perm) const;
+ // Returns the internal permission bits. Use for serialization only.
+ uint32 GetBits() const { return permissions_; }
+
private:
uint32 permissions_;
« no previous file with comments | « ppapi/proxy/ppb_flash_proxy.cc ('k') | ppapi/shared_impl/ppapi_permissions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698