mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 718297 - Add EnumerateAll to nsPropertyTable, r=jst
This commit is contained in:
parent
312c985951
commit
233390c4b7
@ -161,6 +161,33 @@ nsPropertyTable::Enumerate(nsPropertyOwner aObject,
|
||||
}
|
||||
}
|
||||
|
||||
struct PropertyEnumeratorData
|
||||
{
|
||||
nsIAtom* mName;
|
||||
NSPropertyFunc mCallBack;
|
||||
void* mData;
|
||||
};
|
||||
|
||||
static PLDHashOperator
|
||||
PropertyEnumerator(PLDHashTable* aTable, PLDHashEntryHdr* aHdr,
|
||||
PRUint32 aNumber, void* aArg)
|
||||
{
|
||||
PropertyListMapEntry* entry = static_cast<PropertyListMapEntry*>(aHdr);
|
||||
PropertyEnumeratorData* data = static_cast<PropertyEnumeratorData*>(aArg);
|
||||
data->mCallBack(const_cast<void*>(entry->key), data->mName, entry->value,
|
||||
data->mData);
|
||||
return PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
void
|
||||
nsPropertyTable::EnumerateAll(NSPropertyFunc aCallBack, void* aData)
|
||||
{
|
||||
for (PropertyList* prop = mPropertyList; prop; prop = prop->mNext) {
|
||||
PropertyEnumeratorData data = { prop->mName, aCallBack, aData };
|
||||
PL_DHashTableEnumerate(&prop->mObjectValueMap, PropertyEnumerator, &data);
|
||||
}
|
||||
}
|
||||
|
||||
void*
|
||||
nsPropertyTable::GetPropertyInternal(nsPropertyOwner aObject,
|
||||
nsIAtom *aPropertyName,
|
||||
|
@ -181,6 +181,13 @@ class nsPropertyTable
|
||||
NS_HIDDEN_(void) Enumerate(nsPropertyOwner aObject,
|
||||
NSPropertyFunc aCallback, void *aData);
|
||||
|
||||
/**
|
||||
* Enumerate all the properties.
|
||||
* For every property |aCallback| will be called with arguments the owner,
|
||||
* the property name, the property value and |aData|.
|
||||
*/
|
||||
NS_HIDDEN_(void) EnumerateAll(NSPropertyFunc aCallback, void *aData);
|
||||
|
||||
/**
|
||||
* Deletes all of the properties for all objects in the property
|
||||
* table, calling the destructor function for each property.
|
||||
|
Loading…
Reference in New Issue
Block a user