Bug 1344974 - Part 3: Speed up principal access checks in WrapperFactory::Rewrap() by eliminating virtual dispatch and inling; r=bholley

This commit is contained in:
Ehsan Akhgari 2017-03-06 23:09:49 -05:00
Родитель 9b370e9857
Коммит df3bce859e
2 изменённых файлов: 5 добавлений и 3 удалений

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

@ -7,6 +7,7 @@
#include "AccessCheck.h"
#include "nsJSPrincipals.h"
#include "BasePrincipal.h"
#include "nsGlobalWindow.h"
#include "XPCWrapper.h"
@ -47,7 +48,7 @@ AccessCheck::subsumes(JSCompartment* a, JSCompartment* b)
{
nsIPrincipal* aprin = GetCompartmentPrincipal(a);
nsIPrincipal* bprin = GetCompartmentPrincipal(b);
return aprin->Subsumes(bprin);
return BasePrincipal::Cast(aprin)->FastSubsumes(bprin);
}
bool
@ -63,7 +64,7 @@ AccessCheck::subsumesConsideringDomain(JSCompartment* a, JSCompartment* b)
MOZ_ASSERT(OriginAttributes::IsRestrictOpenerAccessForFPI());
nsIPrincipal* aprin = GetCompartmentPrincipal(a);
nsIPrincipal* bprin = GetCompartmentPrincipal(b);
return aprin->SubsumesConsideringDomain(bprin);
return BasePrincipal::Cast(aprin)->FastSubsumesConsideringDomain(bprin);
}
bool
@ -73,7 +74,7 @@ AccessCheck::subsumesConsideringDomainIgnoringFPD(JSCompartment* a,
MOZ_ASSERT(!OriginAttributes::IsRestrictOpenerAccessForFPI());
nsIPrincipal* aprin = GetCompartmentPrincipal(a);
nsIPrincipal* bprin = GetCompartmentPrincipal(b);
return aprin->SubsumesConsideringDomainIgnoringFPD(bprin);
return BasePrincipal::Cast(aprin)->FastSubsumesConsideringDomainIgnoringFPD(bprin);
}
// Does the compartment of the wrapper subsumes the compartment of the wrappee?

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

@ -35,6 +35,7 @@ FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'../../../dom/base',
'../src',
'/caps',
]
if CONFIG['GNU_CXX']: