Bug 1356836 - Reduce the hashtable lookup cost in principal serialization/deserialization; r=billm

This commit is contained in:
Ehsan Akhgari 2017-04-15 16:26:06 -04:00
Родитель fc18ed5283
Коммит 1d318b601c
1 изменённых файлов: 4 добавлений и 8 удалений

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

@ -18,7 +18,7 @@
#include "mozilla/LoadInfo.h"
#include "ContentPrincipal.h"
#include "NullPrincipal.h"
#include "nsServiceManagerUtils.h"
#include "nsContentUtils.h"
#include "nsString.h"
#include "nsTArray.h"
@ -43,7 +43,7 @@ PrincipalInfoToPrincipal(const PrincipalInfo& aPrincipalInfo,
nsresult& rv = aOptionalResult ? *aOptionalResult : stackResult;
nsCOMPtr<nsIScriptSecurityManager> secMan =
do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);
nsContentUtils::GetSecurityManager();
if (NS_WARN_IF(NS_FAILED(rv))) {
return nullptr;
}
@ -171,15 +171,11 @@ PrincipalToPrincipalInfo(nsIPrincipal* aPrincipal,
return NS_OK;
}
nsresult rv;
nsCOMPtr<nsIScriptSecurityManager> secMan =
do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsContentUtils::GetSecurityManager();
bool isSystemPrincipal;
rv = secMan->IsSystemPrincipal(aPrincipal, &isSystemPrincipal);
nsresult rv = secMan->IsSystemPrincipal(aPrincipal, &isSystemPrincipal);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}