Bug 1507540 part 1. Use more notxpcom attributes in caps/. r=mrbkap

This commit is contained in:
Boris Zbarsky 2018-11-19 20:17:52 -05:00
Родитель 226521947f
Коммит b88f0dc956
12 изменённых файлов: 17 добавлений и 34 удалений

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

@ -339,13 +339,12 @@ ContentPrincipal::MayLoadInternal(nsIURI* aURI)
return false;
}
NS_IMETHODIMP
ContentPrincipal::GetHashValue(uint32_t* aValue)
uint32_t
ContentPrincipal::GetHashValue()
{
MOZ_ASSERT(mCodebase, "Need a codebase");
*aValue = nsScriptSecurityManager::HashPrincipalByOrigin(this);
return NS_OK;
return nsScriptSecurityManager::HashPrincipalByOrigin(this);
}
NS_IMETHODIMP

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

@ -23,7 +23,7 @@ class ContentPrincipal final : public BasePrincipal
public:
NS_DECL_NSISERIALIZABLE
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) override;
NS_IMETHOD GetHashValue(uint32_t* aHashValue) override;
uint32_t GetHashValue() override;
NS_IMETHOD GetURI(nsIURI** aURI) override;
NS_IMETHOD GetDomain(nsIURI** aDomain) override;
NS_IMETHOD SetDomain(nsIURI* aDomain) override;

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

@ -239,13 +239,6 @@ DomainSet::ContainsSuperDomain(nsIURI* aDomain, bool* aContains)
}
NS_IMETHODIMP
DomainSet::GetType(uint32_t* aType)
{
*aType = mType;
return NS_OK;
}
void
DomainSet::CloneSet(InfallibleTArray<URIParams>* aDomains)
{

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

@ -144,8 +144,8 @@ ExpandedPrincipal::MayLoadInternal(nsIURI* uri)
return false;
}
NS_IMETHODIMP
ExpandedPrincipal::GetHashValue(uint32_t* result)
uint32_t
ExpandedPrincipal::GetHashValue()
{
MOZ_CRASH("extended principal should never be used as key in a hash map");
}

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

@ -32,7 +32,7 @@ public:
NS_IMETHOD_(MozExternalRefCountType) AddRef() override { return nsJSPrincipals::AddRef(); };
NS_IMETHOD_(MozExternalRefCountType) Release() override { return nsJSPrincipals::Release(); };
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) override;
NS_IMETHOD GetHashValue(uint32_t* aHashValue) override;
uint32_t GetHashValue() override;
NS_IMETHOD GetURI(nsIURI** aURI) override;
NS_IMETHOD GetDomain(nsIURI** aDomain) override;
NS_IMETHOD SetDomain(nsIURI* aDomain) override;

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

@ -139,11 +139,10 @@ NullPrincipal::GetScriptLocation(nsACString &aStr)
* nsIPrincipal implementation
*/
NS_IMETHODIMP
NullPrincipal::GetHashValue(uint32_t *aResult)
uint32_t
NullPrincipal::GetHashValue()
{
*aResult = (NS_PTR_TO_INT32(this) >> 2);
return NS_OK;
return (NS_PTR_TO_INT32(this) >> 2);
}
NS_IMETHODIMP

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

@ -48,7 +48,7 @@ public:
NS_DECL_NSISERIALIZABLE
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) override;
NS_IMETHOD GetHashValue(uint32_t* aHashValue) override;
uint32_t GetHashValue() override;
NS_IMETHOD SetCsp(nsIContentSecurityPolicy* aCsp) override;
NS_IMETHOD GetURI(nsIURI** aURI) override;
NS_IMETHOD GetDomain(nsIURI** aDomain) override;

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

@ -52,11 +52,10 @@ SystemPrincipal::GetScriptLocation(nsACString &aStr)
// Methods implementing nsIPrincipal //
///////////////////////////////////////
NS_IMETHODIMP
SystemPrincipal::GetHashValue(uint32_t *result)
uint32_t
SystemPrincipal::GetHashValue()
{
*result = NS_PTR_TO_INT32(this);
return NS_OK;
return NS_PTR_TO_INT32(this);
}
NS_IMETHODIMP

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

@ -35,7 +35,7 @@ public:
NS_DECL_NSISERIALIZABLE
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) override;
NS_IMETHOD GetHashValue(uint32_t* aHashValue) override;
uint32_t GetHashValue() override;
NS_IMETHOD GetURI(nsIURI** aURI) override;
NS_IMETHOD GetDomain(nsIURI** aDomain) override;
NS_IMETHOD SetDomain(nsIURI* aDomain) override;

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

@ -48,11 +48,6 @@ interface nsIDomainPolicy : nsISupports
[scriptable, builtinclass, uuid(665c981b-0a0f-4229-ac06-a826e02d4f69)]
interface nsIDomainSet : nsISupports
{
/*
* The type of the set. See: DomainSetType
*/
[noscript] readonly attribute uint32_t type;
/*
* Add a domain to the set. No-op if it already exists.
*/

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

@ -69,7 +69,7 @@ interface nsIPrincipal : nsISerializable
/**
* Returns a hash value for the principal.
*/
[noscript] readonly attribute unsigned long hashValue;
[notxpcom, nostdcall] readonly attribute unsigned long hashValue;
/**
* The codebase URI to which this principal pertains. This is

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

@ -18,9 +18,7 @@ gfxFontSrcPrincipal::gfxFontSrcPrincipal(nsIPrincipal* aPrincipal)
mPrincipal = aPrincipal;
uint32_t hash = 0;
mPrincipal->GetHashValue(&hash);
mHash = hash;
mHash = mPrincipal->GetHashValue();
}
gfxFontSrcPrincipal::~gfxFontSrcPrincipal()