зеркало из https://github.com/mozilla/gecko-dev.git
Bug 782211 - Part 4: Add function to remote test for permission in nsIPermissionManager. r=cjones
This commit is contained in:
Родитель
cc741c6be0
Коммит
5125ca9fad
|
@ -2272,6 +2272,23 @@ ContentParent::RecvCloseAlert(const nsString& aName)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentParent::RecvTestPermissionFromPrincipal(const IPC::Principal& aPrincipal,
|
||||
const nsCString& aType,
|
||||
uint32_t* permission)
|
||||
{
|
||||
nsCOMPtr<nsIPermissionManager> permissionManager =
|
||||
do_GetService(NS_PERMISSIONMANAGER_CONTRACTID);
|
||||
NS_ENSURE_TRUE(permissionManager, false);
|
||||
|
||||
nsresult rv = permissionManager->TestPermissionFromPrincipal(aPrincipal,
|
||||
aType.get(),
|
||||
permission);
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentParent::RecvSyncMessage(const nsString& aMsg,
|
||||
const ClonedMessageData& aData,
|
||||
|
|
|
@ -333,6 +333,10 @@ private:
|
|||
|
||||
virtual bool RecvCloseAlert(const nsString& aName);
|
||||
|
||||
virtual bool RecvTestPermissionFromPrincipal(const IPC::Principal& aPrincipal,
|
||||
const nsCString& aType,
|
||||
uint32_t* permission);
|
||||
|
||||
virtual bool RecvLoadURIExternal(const URIParams& uri);
|
||||
|
||||
virtual bool RecvSyncMessage(const nsString& aMsg,
|
||||
|
|
|
@ -433,6 +433,22 @@ parent:
|
|||
|
||||
CloseAlert(nsString name);
|
||||
|
||||
/**
|
||||
* Tests permission for a provided principal using the permission
|
||||
* manager.
|
||||
*
|
||||
* @param principal
|
||||
* The principal to test for the permissions.
|
||||
* @param type
|
||||
* The type of permission to for the principal.
|
||||
*
|
||||
* NOTE: The principal is untrusted in the parent process. Only
|
||||
* principals that can live in the content process should
|
||||
* be provided.
|
||||
*/
|
||||
sync TestPermissionFromPrincipal(Principal principal, nsCString type)
|
||||
returns (uint32_t permission);
|
||||
|
||||
PExternalHelperApp(OptionalURIParams uri, nsCString aMimeContentType,
|
||||
nsCString aContentDisposition, bool aForceSave,
|
||||
int64_t aContentLength, OptionalURIParams aReferrer);
|
||||
|
|
Загрузка…
Ссылка в новой задаче