Bug 1626960 - Remove nsIPrincipal GetURI call in nsOfflineCacheUpdateService.cpp r=ckerschb

Differential Revision: https://phabricator.services.mozilla.com/D69387
This commit is contained in:
Sebastian Streich 2020-04-20 09:43:29 +00:00
Родитель 3c19d7435a
Коммит 5cc49156fd
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -523,7 +523,9 @@ static nsresult OfflineAppPermForPrincipal(nsIPrincipal* aPrincipal,
if (!aPrincipal) return NS_ERROR_INVALID_ARG;
nsCOMPtr<nsIURI> uri;
aPrincipal->GetURI(getter_AddRefs(uri));
// Casting to BasePrincipal, as we can't get InnerMost URI otherwise
auto* basePrincipal = BasePrincipal::Cast(aPrincipal);
basePrincipal->GetURI(getter_AddRefs(uri));
if (!uri) return NS_OK;
@ -600,7 +602,9 @@ nsOfflineCacheUpdateService::AllowOfflineApp(nsIPrincipal* aPrincipal) {
}
nsCOMPtr<nsIURI> uri;
aPrincipal->GetURI(getter_AddRefs(uri));
// Casting to BasePrincipal, as we can't get InnerMost URI otherwise
auto* basePrincipal = BasePrincipal::Cast(aPrincipal);
basePrincipal->GetURI(getter_AddRefs(uri));
if (!uri) {
return NS_ERROR_NOT_AVAILABLE;