Bug 899495 - Correct the usage patterns of TestPermissionFromPrincipal in nsPermissionManager. r=mounir

This commit is contained in:
Genti Tola 2013-10-07 12:34:31 +02:00
parent cea3cca369
commit b3dcde98c5
2 changed files with 6 additions and 3 deletions

View File

@ -255,8 +255,9 @@ DOMStorage::CanUseStorage(DOMStorage* aStorage)
}
uint32_t perm;
permissionManager->TestPermissionFromPrincipal(subjectPrincipal,
rv = permissionManager->TestPermissionFromPrincipal(subjectPrincipal,
kPermissionType, &perm);
NS_ENSURE_SUCCESS(rv, false);
if (perm == nsIPermissionManager::DENY_ACTION) {
return false;

View File

@ -195,7 +195,9 @@ nsCookiePermission::CanSetCookie(nsIURI *aURI,
return NS_ERROR_UNEXPECTED;
uint32_t perm;
mPermMgr->TestPermission(aURI, kPermissionType, &perm);
nsresult rv = mPermMgr->TestPermission(aURI, kPermissionType, &perm);
NS_ENSURE_SUCCESS(rv, false);
bool isThirdParty = false;
switch (perm) {
case nsICookiePermission::ACCESS_SESSION: