Adde context as argument to all caps public methods that could be used by JS
git-svn-id: svn://10.0.0.236/trunk@7283 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -36,19 +36,19 @@ PR_EXTERN(PRBool)
|
||||
nsCapsRegisterPrincipal(struct nsPrincipal *principal);
|
||||
|
||||
PR_EXTERN(PRBool)
|
||||
nsCapsEnablePrivilege(struct nsTarget *target, PRInt32 callerDepth);
|
||||
nsCapsEnablePrivilege(void* context, struct nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PR_EXTERN(PRBool)
|
||||
nsCapsIsPrivilegeEnabled(struct nsTarget *target, PRInt32 callerDepth);
|
||||
nsCapsIsPrivilegeEnabled(void* context, struct nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PR_EXTERN(PRBool)
|
||||
nsCapsRevertPrivilege(struct nsTarget *target, PRInt32 callerDepth);
|
||||
nsCapsRevertPrivilege(void* context, struct nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PR_EXTERN(PRBool)
|
||||
nsCapsDisablePrivilege(struct nsTarget *target, PRInt32 callerDepth);
|
||||
nsCapsDisablePrivilege(void* context, struct nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PR_EXTERN(void*)
|
||||
nsCapsGetClassPrincipalsFromStack(PRInt32 callerDepth);
|
||||
nsCapsGetClassPrincipalsFromStack(void* context, PRInt32 callerDepth);
|
||||
|
||||
PR_EXTERN(nsSetComparisonType)
|
||||
nsCapsComparePrincipalArray(void* prin1Array, void* prin2Array);
|
||||
@@ -106,9 +106,9 @@ nsCapsGetPrivilege(struct nsPrivilegeTable *annotation, struct nsTarget *target)
|
||||
|
||||
/* Methods for stack walking */
|
||||
|
||||
extern struct NSJSJavaFrameWrapper * (*nsCapsNewNSJSJavaFrameWrapperCallback)(void);
|
||||
extern struct NSJSJavaFrameWrapper * (*nsCapsNewNSJSJavaFrameWrapperCallback)(void *);
|
||||
PR_EXTERN(void)
|
||||
setNewNSJSJavaFrameWrapperCallback(struct NSJSJavaFrameWrapper * (*fp)(void));
|
||||
setNewNSJSJavaFrameWrapperCallback(struct NSJSJavaFrameWrapper * (*fp)(void *));
|
||||
|
||||
extern void (*nsCapsFreeNSJSJavaFrameWrapperCallback)(struct NSJSJavaFrameWrapper *);
|
||||
PR_EXTERN(void)
|
||||
|
||||
@@ -58,18 +58,32 @@ public:
|
||||
|
||||
PRBool isPrivilegeEnabled(nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PRBool isPrivilegeEnabled(void* context, nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PRBool enablePrivilege(nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PRBool enablePrivilege(void* context, nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PRBool enablePrivilege(nsTarget *target, nsPrincipal *preferredPrincipal, PRInt32 callerDepth);
|
||||
|
||||
PRBool enablePrivilege(void* context, nsTarget *target, nsPrincipal *preferredPrincipal, PRInt32 callerDepth);
|
||||
|
||||
PRBool revertPrivilege(nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PRBool revertPrivilege(void* context, nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PRBool disablePrivilege(nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PRBool disablePrivilege(void* context, nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PRBool enablePrincipalPrivilegeHelper(nsTarget *target, PRInt32 callerDepth, nsPrincipal *preferredPrin, void * data, nsTarget *impersonator);
|
||||
|
||||
PRBool enablePrincipalPrivilegeHelper(void* context, nsTarget *target, PRInt32 callerDepth, nsPrincipal *preferredPrin, void * data, nsTarget *impersonator);
|
||||
|
||||
nsPrivilegeTable *enableScopePrivilegeHelper(nsTarget *target, PRInt32 callerDepth, void *data, PRBool helpingSetScopePrivilege, nsPrincipal *prefPrin);
|
||||
|
||||
nsPrivilegeTable *enableScopePrivilegeHelper(void* context, nsTarget *target, PRInt32 callerDepth, void *data, PRBool helpingSetScopePrivilege, nsPrincipal *prefPrin);
|
||||
|
||||
void registerPrincipalAndSetPrivileges(nsPrincipal *principal, nsTarget *target, nsPrivilege *newPrivilege);
|
||||
|
||||
void updatePrivilegeTable(nsTarget *target,
|
||||
@@ -78,10 +92,14 @@ public:
|
||||
|
||||
PRBool checkPrivilegeGranted(nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PRBool checkPrivilegeGranted(void* context, nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PRBool checkPrivilegeGranted(nsTarget *target, nsPrincipal *principal, void *data);
|
||||
|
||||
PRBool checkPrivilegeGranted(nsTarget *target, PRInt32 callerDepth,
|
||||
void *data);
|
||||
PRBool checkPrivilegeGranted(nsTarget *target, PRInt32 callerDepth, void *data);
|
||||
|
||||
PRBool checkPrivilegeGranted(void* context, nsTarget *target, PRInt32 callerDepth,
|
||||
void *data);
|
||||
|
||||
nsPrivilege *getPrincipalPrivilege(nsTarget *target, nsPrincipal *prin, void *data);
|
||||
|
||||
@@ -89,6 +107,8 @@ public:
|
||||
|
||||
static nsPrincipalArray* getMyPrincipals(PRInt32 callerDepth);
|
||||
|
||||
static nsPrincipalArray* getMyPrincipals(void* context, PRInt32 callerDepth);
|
||||
|
||||
static nsPrincipal * getSystemPrincipal(void);
|
||||
|
||||
static PRBool hasSystemPrincipal(nsPrincipalArray *prinArray);
|
||||
@@ -108,6 +128,8 @@ public:
|
||||
|
||||
PRBool checkMatchPrincipal(nsPrincipal *principal, PRInt32 callerDepth);
|
||||
|
||||
PRBool checkMatchPrincipal(void* context, nsPrincipal *principal, PRInt32 callerDepth);
|
||||
|
||||
/* Helper functions for ADMIN UI */
|
||||
const char * getAllPrincipalsString(void);
|
||||
|
||||
@@ -126,11 +148,19 @@ public:
|
||||
char * checkPrivilegeEnabled(nsTargetArray* targetArray,
|
||||
PRInt32 callerDepth, void *data);
|
||||
|
||||
char * checkPrivilegeEnabled(void* context, nsTargetArray* targetArray,
|
||||
PRInt32 callerDepth, void *data);
|
||||
|
||||
nsPrincipalArray* getClassPrincipalsFromStack(PRInt32 callerDepth);
|
||||
|
||||
nsPrincipalArray* getClassPrincipalsFromStack(void* context, PRInt32 callerDepth);
|
||||
|
||||
nsPrivilegeTable * getPrivilegeTableFromStack(PRInt32 callerDepth,
|
||||
PRBool createIfNull);
|
||||
|
||||
nsPrivilegeTable * getPrivilegeTableFromStack(void* context, PRInt32 callerDepth,
|
||||
PRBool createIfNull);
|
||||
|
||||
/* End of native methods */
|
||||
|
||||
private:
|
||||
@@ -151,7 +181,7 @@ private:
|
||||
|
||||
void addToPrinNameToPrincipalTable(nsPrincipal *prin);
|
||||
|
||||
PRBool enablePrivilegePrivate(nsTarget *target,
|
||||
PRBool enablePrivilegePrivate(void* context, nsTarget *target,
|
||||
nsPrincipal *preferredPrincipal,
|
||||
PRInt32 callerDepth);
|
||||
|
||||
|
||||
@@ -65,6 +65,8 @@ public:
|
||||
|
||||
nsTarget * registerTarget(void);
|
||||
|
||||
nsTarget * registerTarget(void* context);
|
||||
|
||||
static nsTarget * findTarget(nsTarget *target);
|
||||
|
||||
static nsTarget * findTarget(char *name);
|
||||
|
||||
Reference in New Issue
Block a user