Bug 708901 - Migrate to nsTHashSet in caps. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D108590
This commit is contained in:
@@ -147,7 +147,7 @@ NS_IMETHODIMP
|
|||||||
DomainSet::Add(nsIURI* aDomain) {
|
DomainSet::Add(nsIURI* aDomain) {
|
||||||
nsCOMPtr<nsIURI> clone = GetCanonicalClone(aDomain);
|
nsCOMPtr<nsIURI> clone = GetCanonicalClone(aDomain);
|
||||||
NS_ENSURE_TRUE(clone, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(clone, NS_ERROR_FAILURE);
|
||||||
mHashTable.PutEntry(clone);
|
mHashTable.Insert(clone);
|
||||||
if (XRE_IsParentProcess()) {
|
if (XRE_IsParentProcess()) {
|
||||||
return BroadcastDomainSetChange(mType, ADD_DOMAIN, aDomain);
|
return BroadcastDomainSetChange(mType, ADD_DOMAIN, aDomain);
|
||||||
}
|
}
|
||||||
@@ -159,7 +159,7 @@ NS_IMETHODIMP
|
|||||||
DomainSet::Remove(nsIURI* aDomain) {
|
DomainSet::Remove(nsIURI* aDomain) {
|
||||||
nsCOMPtr<nsIURI> clone = GetCanonicalClone(aDomain);
|
nsCOMPtr<nsIURI> clone = GetCanonicalClone(aDomain);
|
||||||
NS_ENSURE_TRUE(clone, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(clone, NS_ERROR_FAILURE);
|
||||||
mHashTable.RemoveEntry(clone);
|
mHashTable.Remove(clone);
|
||||||
if (XRE_IsParentProcess()) {
|
if (XRE_IsParentProcess()) {
|
||||||
return BroadcastDomainSetChange(mType, REMOVE_DOMAIN, aDomain);
|
return BroadcastDomainSetChange(mType, REMOVE_DOMAIN, aDomain);
|
||||||
}
|
}
|
||||||
@@ -215,10 +215,7 @@ DomainSet::ContainsSuperDomain(nsIURI* aDomain, bool* aContains) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DomainSet::CloneSet(nsTArray<RefPtr<nsIURI>>* aDomains) {
|
void DomainSet::CloneSet(nsTArray<RefPtr<nsIURI>>* aDomains) {
|
||||||
for (auto iter = mHashTable.Iter(); !iter.Done(); iter.Next()) {
|
AppendToArray(*aDomains, mHashTable);
|
||||||
nsIURI* key = iter.Get()->GetKey();
|
|
||||||
aDomains->AppendElement(key);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* namespace mozilla */
|
} /* namespace mozilla */
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#define DomainPolicy_h__
|
#define DomainPolicy_h__
|
||||||
|
|
||||||
#include "nsIDomainPolicy.h"
|
#include "nsIDomainPolicy.h"
|
||||||
#include "nsTHashtable.h"
|
#include "nsTHashSet.h"
|
||||||
#include "nsURIHashKey.h"
|
#include "nsURIHashKey.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
@@ -40,7 +40,7 @@ class DomainSet final : public nsIDomainSet {
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~DomainSet() {}
|
virtual ~DomainSet() {}
|
||||||
nsTHashtable<nsURIHashKey> mHashTable;
|
nsTHashSet<nsURIHashKey> mHashTable;
|
||||||
DomainSetType mType;
|
DomainSetType mType;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user