mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 946815 - Hoist system-principal checks into CommonTestPermission. r=baku
This commit is contained in:
parent
4941232019
commit
70c93e2650
@ -958,13 +958,6 @@ nsPermissionManager::TestExactPermissionFromPrincipal(nsIPrincipal* aPrincipal,
|
||||
const char* aType,
|
||||
uint32_t* aPermission)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPrincipal);
|
||||
|
||||
if (nsContentUtils::IsSystemPrincipal(aPrincipal)) {
|
||||
*aPermission = nsIPermissionManager::ALLOW_ACTION;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return CommonTestPermission(aPrincipal, aType, aPermission, true, true);
|
||||
}
|
||||
|
||||
@ -973,15 +966,6 @@ nsPermissionManager::TestExactPermanentPermission(nsIPrincipal* aPrincipal,
|
||||
const char* aType,
|
||||
uint32_t* aPermission)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPrincipal);
|
||||
|
||||
// System principals do not have URI so we can't try to get
|
||||
// retro-compatibility here.
|
||||
if (nsContentUtils::IsSystemPrincipal(aPrincipal)) {
|
||||
*aPermission = nsIPermissionManager::ALLOW_ACTION;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return CommonTestPermission(aPrincipal, aType, aPermission, true, false);
|
||||
}
|
||||
|
||||
@ -1022,15 +1006,6 @@ nsPermissionManager::TestPermissionFromPrincipal(nsIPrincipal* aPrincipal,
|
||||
const char* aType,
|
||||
uint32_t* aPermission)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPrincipal);
|
||||
|
||||
// System principals do not have URI so we can't try to get
|
||||
// retro-compatibility here.
|
||||
if (nsContentUtils::IsSystemPrincipal(aPrincipal)) {
|
||||
*aPermission = nsIPermissionManager::ALLOW_ACTION;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return CommonTestPermission(aPrincipal, aType, aPermission, false, true);
|
||||
}
|
||||
|
||||
@ -1101,6 +1076,11 @@ nsPermissionManager::CommonTestPermission(nsIPrincipal* aPrincipal,
|
||||
NS_ENSURE_ARG_POINTER(aPrincipal);
|
||||
NS_ENSURE_ARG_POINTER(aType);
|
||||
|
||||
if (nsContentUtils::IsSystemPrincipal(aPrincipal)) {
|
||||
*aPermission = nsIPermissionManager::ALLOW_ACTION;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// set the default
|
||||
*aPermission = nsIPermissionManager::UNKNOWN_ACTION;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user