27 #ifndef __SB_SECURITY_MIXIN_H__
28 #define __SB_SECURITY_MIXIN_H__
30 #include "sbISecurityMixin.h"
31 #include "sbISecurityAggregator.h"
34 #include <nsIClassInfo.h>
35 #include <nsISecurityCheckedComponent.h>
37 #include <nsStringGlue.h>
39 #include <nsIDOMDocument.h>
41 #define SONGBIRD_SECURITYMIXIN_CONTRACTID \
42 "@songbirdnest.com/remoteapi/security-mixin;1"
43 #define SONGBIRD_SECURITYMIXIN_CLASSNAME \
44 "Songbird Remote Security Mixin"
45 #define SONGBIRD_SECURITYMIXIN_CID \
50 {0xb1, 0x09, 0xcf, 0x1a, 0x87, 0x2e, 0xf6, 0xdd} \
57 #define RAPI_EVENT_CLASS NS_LITERAL_STRING("Events")
58 #define RAPI_EVENT_TYPE NS_LITERAL_STRING("remoteapi")
60 #define SB_EVENT_RAPI_PERMISSION_CHANGED NS_LITERAL_STRING("RemoteAPIPermissionChanged")
61 #define SB_EVENT_RAPI_PERMISSION_DENIED NS_LITERAL_STRING("RemoteAPIPermissionDenied")
70 NS_DECL_NSISECURITYCHECKEDCOMPONENT
71 NS_DECL_SBISECURITYMIXIN
80 static nsresult
SetPermission(nsIURI *aURI,
const nsACString &aScopedName);
88 PRBool disableNotificationCheck = PR_FALSE);
90 const nsAString &aMethodName,
91 nsAString &aScopedName);
101 nsresult
CopyIIDArray(PRUint32
aCount,
const nsIID **aSourceArray, nsIID ***aDestArray);
104 nsresult
CopyStrArray(PRUint32 aCount,
const char **aSourceArray, nsTArray<nsCString> *aDestArray);
120 #endif // __SB_SECURITY_MIXIN_H__
nsTArray< nsCString > mMethods
nsTArray< nsCString > mWProperties
virtual ~sbSecurityMixin()
PRBool GetScopedName(nsTArray< nsCString > &aStringArray, const nsAString &aMethodName, nsAString &aScopedName)
nsTArray< nsCString > mRProperties
PRUint32 mInterfacesCount
nsISecurityCheckedComponent
An interface for setting up nsISecurityCheckedComponent security checks.
NS_DECL_ISUPPORTS NS_DECL_NSICLASSINFO NS_DECL_NSISECURITYCHECKEDCOMPONENT NS_DECL_SBISECURITYMIXIN sbSecurityMixin()
A marker interface for objects that aggregate the security mixin.
nsresult CopyIIDArray(PRUint32 aCount, const nsIID **aSourceArray, nsIID ***aDestArray)
const struct Scope * GetScopeForScopedName(const nsAString &aScopedName)
nsresult DispatchNotificationEvent(const char *aNotificationType, const Scope *aScope, PRBool aHasAccess)
sbISecurityAggregator * mOuter
restoreHistoryPrecursor aCount
nsCOMPtr< nsIDOMDocument > mNotificationDocument
nsresult CopyStrArray(PRUint32 aCount, const char **aSourceArray, nsTArray< nsCString > *aDestArray)
char * SB_CloneAllAccess()
PRBool GetPermission(nsIURI *aURI, const struct Scope *aScope)
PRBool GetPermissionForScopedName(const nsAString &aScopedName, PRBool disableNotificationCheck=PR_FALSE)
static nsresult SetPermission(nsIURI *aURI, const nsACString &aScopedName)
Set the permission to allow for a scoped name.