Bug 676192 - Remove kHashEnumerateRemove and make nsHashtableEnumFunc return PRBool, r=bsmedberg

This commit is contained in:
Michael Wu 2011-08-22 19:15:54 -07:00
parent 927aee119a
commit ab15475a72
4 changed files with 8 additions and 15 deletions

View File

@ -429,7 +429,7 @@ static PRBool IsChromeURI(nsIURI* aURI)
/* Implementation file */
static PRIntn
static PRBool
TraverseProtos(nsHashKey *aKey, void *aData, void* aClosure)
{
nsCycleCollectionTraversalCallback *cb =
@ -439,7 +439,7 @@ TraverseProtos(nsHashKey *aKey, void *aData, void* aClosure)
return kHashEnumerateNext;
}
static PRIntn
static PRBool
UnlinkProtoJSObjects(nsHashKey *aKey, void *aData, void* aClosure)
{
nsXBLPrototypeBinding *proto = static_cast<nsXBLPrototypeBinding*>(aData);
@ -453,7 +453,7 @@ struct ProtoTracer
void *mClosure;
};
static PRIntn
static PRBool
TraceProtos(nsHashKey *aKey, void *aData, void* aClosure)
{
ProtoTracer* closure = static_cast<ProtoTracer*>(aClosure);

View File

@ -328,7 +328,7 @@ PRBool nsXBLPrototypeBinding::CompareBindingURI(nsIURI* aURI) const
return equal;
}
static PRIntn
static PRBool
TraverseInsertionPoint(nsHashKey* aKey, void* aData, void* aClosure)
{
nsCycleCollectionTraversalCallback &cb =

View File

@ -127,12 +127,8 @@ hashEnumerate(PLDHashTable* table, PLDHashEntryHdr* hdr, PRUint32 i, void *arg)
_HashEnumerateArgs* thunk = (_HashEnumerateArgs*)arg;
HTEntry* entry = static_cast<HTEntry*>(hdr);
switch (thunk->fn(entry->key, entry->value, thunk->arg)) {
case kHashEnumerateNext:
if (thunk->fn(entry->key, entry->value, thunk->arg))
return PL_DHASH_NEXT;
case kHashEnumerateRemove:
return PL_DHASH_REMOVE;
}
return PL_DHASH_STOP;
}

View File

@ -109,11 +109,10 @@ class nsHashKey {
// Return values for nsHashtableEnumFunc
enum {
kHashEnumerateStop = PR_FALSE,
kHashEnumerateNext = PR_TRUE,
kHashEnumerateRemove = 2
kHashEnumerateNext = PR_TRUE
};
typedef PRIntn
typedef PRBool
(* nsHashtableEnumFunc)(nsHashKey *aKey, void *aData, void* aClosure);
typedef nsresult
@ -196,8 +195,6 @@ class nsSupportsHashtable
: private nsHashtable
{
public:
typedef PRBool (* EnumFunc) (nsHashKey *aKey, void *aData, void* aClosure);
nsSupportsHashtable(PRUint32 aSize = 16, PRBool threadSafe = PR_FALSE)
: nsHashtable(aSize, threadSafe) {}
~nsSupportsHashtable();
@ -214,7 +211,7 @@ class nsSupportsHashtable
nsISupports* Get(nsHashKey *aKey);
PRBool Remove(nsHashKey *aKey, nsISupports **value = nsnull);
nsHashtable *Clone();
void Enumerate(EnumFunc aEnumFunc, void* aClosure = NULL) {
void Enumerate(nsHashtableEnumFunc aEnumFunc, void* aClosure = NULL) {
nsHashtable::Enumerate(aEnumFunc, aClosure);
}
void Reset();