2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2012-05-21 15:12:37 +04:00
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2004-08-24 22:50:29 +04:00
|
|
|
*
|
|
|
|
* This Original Code has been modified by IBM Corporation. Modifications made by IBM
|
|
|
|
* described herein are Copyright (c) International Business Machines Corporation, 2000.
|
|
|
|
* Modifications to Mozilla code or documentation identified per MPL Section 3.3
|
|
|
|
*
|
|
|
|
* Date Modified by Description of modification
|
|
|
|
* 04/20/2000 IBM Corp. OS/2 VisualAge build.
|
|
|
|
*/
|
|
|
|
|
2006-03-31 12:00:42 +04:00
|
|
|
/**
|
|
|
|
* nsPropertyTable allows a set of arbitrary key/value pairs to be stored
|
|
|
|
* for any number of nodes, in a global hashtable rather than on the nodes
|
|
|
|
* themselves. Nodes can be any type of object; the hashtable keys are
|
|
|
|
* nsIAtom pointers, and the values are void pointers.
|
|
|
|
*/
|
|
|
|
|
2004-08-24 22:50:29 +04:00
|
|
|
#include "nsPropertyTable.h"
|
2013-06-30 20:26:39 +04:00
|
|
|
|
|
|
|
#include "mozilla/MemoryReporting.h"
|
|
|
|
|
2004-08-24 22:50:29 +04:00
|
|
|
#include "pldhash.h"
|
2012-07-27 18:03:27 +04:00
|
|
|
#include "nsError.h"
|
2004-08-24 22:50:29 +04:00
|
|
|
#include "nsIAtom.h"
|
|
|
|
|
|
|
|
struct PropertyListMapEntry : public PLDHashEntryHdr {
|
|
|
|
const void *key;
|
|
|
|
void *value;
|
|
|
|
};
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2005-10-27 18:09:23 +04:00
|
|
|
class nsPropertyTable::PropertyList {
|
|
|
|
public:
|
2010-04-23 06:41:38 +04:00
|
|
|
PropertyList(nsIAtom* aName,
|
2005-01-21 20:00:07 +03:00
|
|
|
NSPropertyDtorFunc aDtorFunc,
|
2006-09-16 21:15:38 +04:00
|
|
|
void* aDtorData,
|
2014-06-02 16:08:24 +04:00
|
|
|
bool aTransfer);
|
|
|
|
~PropertyList();
|
2004-08-24 22:50:29 +04:00
|
|
|
|
|
|
|
// Removes the property associated with the given object, and destroys
|
|
|
|
// the property value
|
2014-06-02 16:08:21 +04:00
|
|
|
bool DeletePropertyFor(nsPropertyOwner aObject);
|
2004-08-24 22:50:29 +04:00
|
|
|
|
|
|
|
// Destroy all remaining properties (without removing them)
|
2014-06-02 16:08:21 +04:00
|
|
|
void Destroy();
|
2005-10-27 18:09:23 +04:00
|
|
|
|
2014-06-02 16:08:21 +04:00
|
|
|
bool Equals(nsIAtom *aPropertyName)
|
2005-10-27 18:09:23 +04:00
|
|
|
{
|
2010-04-23 06:41:38 +04:00
|
|
|
return mName == aPropertyName;
|
2005-10-27 18:09:23 +04:00
|
|
|
}
|
|
|
|
|
2013-06-23 16:03:39 +04:00
|
|
|
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
|
2012-06-15 08:10:08 +04:00
|
|
|
|
2005-10-27 18:09:23 +04:00
|
|
|
nsCOMPtr<nsIAtom> mName; // property name
|
|
|
|
PLDHashTable mObjectValueMap; // map of object/value pairs
|
|
|
|
NSPropertyDtorFunc mDtorFunc; // property specific value dtor function
|
2006-09-16 21:15:38 +04:00
|
|
|
void* mDtorData; // pointer to pass to dtor
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mTransfer; // whether to transfer in
|
2006-09-16 21:15:38 +04:00
|
|
|
// TransferOrDeleteAllPropertiesFor
|
|
|
|
|
2005-10-27 18:09:23 +04:00
|
|
|
PropertyList* mNext;
|
2004-08-24 22:50:29 +04:00
|
|
|
};
|
|
|
|
|
2005-12-06 07:53:03 +03:00
|
|
|
void
|
|
|
|
nsPropertyTable::DeleteAllProperties()
|
2004-08-24 22:50:29 +04:00
|
|
|
{
|
2005-12-06 07:53:03 +03:00
|
|
|
while (mPropertyList) {
|
|
|
|
PropertyList* tmp = mPropertyList;
|
2004-08-24 22:50:29 +04:00
|
|
|
|
2005-12-06 07:53:03 +03:00
|
|
|
mPropertyList = mPropertyList->mNext;
|
|
|
|
tmp->Destroy();
|
|
|
|
delete tmp;
|
2004-08-24 22:50:29 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-01-27 02:40:49 +03:00
|
|
|
nsPropertyTable::DeleteAllPropertiesFor(nsPropertyOwner aObject)
|
2004-08-24 22:50:29 +04:00
|
|
|
{
|
|
|
|
for (PropertyList* prop = mPropertyList; prop; prop = prop->mNext) {
|
|
|
|
prop->DeletePropertyFor(aObject);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-09-16 21:15:38 +04:00
|
|
|
nsresult
|
|
|
|
nsPropertyTable::TransferOrDeleteAllPropertiesFor(nsPropertyOwner aObject,
|
|
|
|
nsPropertyTable *aOtherTable)
|
|
|
|
{
|
|
|
|
nsresult rv = NS_OK;
|
|
|
|
for (PropertyList* prop = mPropertyList; prop; prop = prop->mNext) {
|
|
|
|
if (prop->mTransfer) {
|
2015-01-23 08:06:55 +03:00
|
|
|
PropertyListMapEntry *entry =
|
|
|
|
static_cast<PropertyListMapEntry*>
|
|
|
|
(PL_DHashTableSearch(&prop->mObjectValueMap, aObject));
|
|
|
|
if (entry) {
|
2010-04-23 06:41:38 +04:00
|
|
|
rv = aOtherTable->SetProperty(aObject, prop->mName,
|
2006-09-16 21:15:38 +04:00
|
|
|
entry->value, prop->mDtorFunc,
|
|
|
|
prop->mDtorData, prop->mTransfer);
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
DeleteAllPropertiesFor(aObject);
|
|
|
|
aOtherTable->DeleteAllPropertiesFor(aObject);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
PL_DHashTableRawRemove(&prop->mObjectValueMap, entry);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
prop->DeletePropertyFor(aObject);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2005-10-27 18:09:23 +04:00
|
|
|
void
|
2010-04-23 06:41:38 +04:00
|
|
|
nsPropertyTable::Enumerate(nsPropertyOwner aObject,
|
2005-10-27 18:09:23 +04:00
|
|
|
NSPropertyFunc aCallback, void *aData)
|
|
|
|
{
|
|
|
|
PropertyList* prop;
|
|
|
|
for (prop = mPropertyList; prop; prop = prop->mNext) {
|
2010-04-23 06:41:38 +04:00
|
|
|
PropertyListMapEntry *entry = static_cast<PropertyListMapEntry*>
|
2015-01-23 08:06:55 +03:00
|
|
|
(PL_DHashTableSearch(&prop->mObjectValueMap, aObject));
|
|
|
|
if (entry) {
|
2010-04-23 06:41:38 +04:00
|
|
|
aCallback(const_cast<void*>(aObject.get()), prop->mName, entry->value,
|
2015-01-23 08:06:55 +03:00
|
|
|
aData);
|
2005-10-27 18:09:23 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-01-15 23:02:06 +04:00
|
|
|
struct PropertyEnumeratorData
|
|
|
|
{
|
|
|
|
nsIAtom* mName;
|
|
|
|
NSPropertyFunc mCallBack;
|
|
|
|
void* mData;
|
|
|
|
};
|
|
|
|
|
|
|
|
static PLDHashOperator
|
|
|
|
PropertyEnumerator(PLDHashTable* aTable, PLDHashEntryHdr* aHdr,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t aNumber, void* aArg)
|
2012-01-15 23:02:06 +04:00
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-08-24 22:50:29 +04:00
|
|
|
void*
|
2006-01-27 02:40:49 +03:00
|
|
|
nsPropertyTable::GetPropertyInternal(nsPropertyOwner aObject,
|
2004-08-24 22:50:29 +04:00
|
|
|
nsIAtom *aPropertyName,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aRemove,
|
2004-08-24 22:50:29 +04:00
|
|
|
nsresult *aResult)
|
|
|
|
{
|
|
|
|
NS_PRECONDITION(aPropertyName && aObject, "unexpected null param");
|
|
|
|
nsresult rv = NS_PROPTABLE_PROP_NOT_THERE;
|
2012-07-30 18:20:58 +04:00
|
|
|
void *propValue = nullptr;
|
2004-08-24 22:50:29 +04:00
|
|
|
|
2010-04-23 06:41:38 +04:00
|
|
|
PropertyList* propertyList = GetPropertyListFor(aPropertyName);
|
2004-08-24 22:50:29 +04:00
|
|
|
if (propertyList) {
|
2015-01-23 08:06:55 +03:00
|
|
|
PropertyListMapEntry *entry =
|
|
|
|
static_cast<PropertyListMapEntry*>
|
|
|
|
(PL_DHashTableSearch(&propertyList->mObjectValueMap, aObject));
|
|
|
|
if (entry) {
|
2004-08-24 22:50:29 +04:00
|
|
|
propValue = entry->value;
|
|
|
|
if (aRemove) {
|
|
|
|
// don't call propertyList->mDtorFunc. That's the caller's job now.
|
|
|
|
PL_DHashTableRawRemove(&propertyList->mObjectValueMap, entry);
|
|
|
|
}
|
|
|
|
rv = NS_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (aResult)
|
|
|
|
*aResult = rv;
|
|
|
|
|
|
|
|
return propValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
2006-01-27 02:40:49 +03:00
|
|
|
nsPropertyTable::SetPropertyInternal(nsPropertyOwner aObject,
|
2005-10-27 18:09:23 +04:00
|
|
|
nsIAtom *aPropertyName,
|
|
|
|
void *aPropertyValue,
|
|
|
|
NSPropertyDtorFunc aPropDtorFunc,
|
|
|
|
void *aPropDtorData,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aTransfer,
|
2005-10-27 18:09:23 +04:00
|
|
|
void **aOldValue)
|
2004-08-24 22:50:29 +04:00
|
|
|
{
|
|
|
|
NS_PRECONDITION(aPropertyName && aObject, "unexpected null param");
|
|
|
|
|
2010-04-23 06:41:38 +04:00
|
|
|
PropertyList* propertyList = GetPropertyListFor(aPropertyName);
|
2004-08-24 22:50:29 +04:00
|
|
|
|
|
|
|
if (propertyList) {
|
2006-09-16 21:15:38 +04:00
|
|
|
// Make sure the dtor function and data and the transfer flag match
|
2005-01-21 20:00:07 +03:00
|
|
|
if (aPropDtorFunc != propertyList->mDtorFunc ||
|
2006-09-16 21:15:38 +04:00
|
|
|
aPropDtorData != propertyList->mDtorData ||
|
|
|
|
aTransfer != propertyList->mTransfer) {
|
2006-09-20 01:39:33 +04:00
|
|
|
NS_WARNING("Destructor/data mismatch while setting property");
|
2004-08-24 22:50:29 +04:00
|
|
|
return NS_ERROR_INVALID_ARG;
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
2010-04-23 06:41:38 +04:00
|
|
|
propertyList = new PropertyList(aPropertyName, aPropDtorFunc,
|
2006-09-16 21:15:38 +04:00
|
|
|
aPropDtorData, aTransfer);
|
2015-01-20 03:11:34 +03:00
|
|
|
if (!propertyList || !propertyList->mObjectValueMap.IsInitialized()) {
|
2004-08-24 22:50:29 +04:00
|
|
|
delete propertyList;
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
propertyList->mNext = mPropertyList;
|
|
|
|
mPropertyList = propertyList;
|
|
|
|
}
|
|
|
|
|
|
|
|
// The current property value (if there is one) is replaced and the current
|
|
|
|
// value is destroyed
|
|
|
|
nsresult result = NS_OK;
|
2007-07-08 11:08:04 +04:00
|
|
|
PropertyListMapEntry *entry = static_cast<PropertyListMapEntry*>
|
2015-05-13 08:36:00 +03:00
|
|
|
(PL_DHashTableAdd(&propertyList->mObjectValueMap, aObject, mozilla::fallible));
|
2004-08-24 22:50:29 +04:00
|
|
|
if (!entry)
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
2013-04-03 05:14:24 +04:00
|
|
|
// A nullptr entry->key is the sign that the entry has just been allocated
|
|
|
|
// for us. If it's non-nullptr then we have an existing entry.
|
2005-10-27 18:09:23 +04:00
|
|
|
if (entry->key) {
|
|
|
|
if (aOldValue)
|
|
|
|
*aOldValue = entry->value;
|
|
|
|
else if (propertyList->mDtorFunc)
|
2007-07-08 11:08:04 +04:00
|
|
|
propertyList->mDtorFunc(const_cast<void*>(entry->key), aPropertyName,
|
2006-09-16 21:15:38 +04:00
|
|
|
entry->value, propertyList->mDtorData);
|
2004-08-24 22:50:29 +04:00
|
|
|
result = NS_PROPTABLE_PROP_OVERWRITTEN;
|
|
|
|
}
|
2005-10-27 18:09:23 +04:00
|
|
|
else if (aOldValue) {
|
2012-07-30 18:20:58 +04:00
|
|
|
*aOldValue = nullptr;
|
2005-10-27 18:09:23 +04:00
|
|
|
}
|
2004-08-24 22:50:29 +04:00
|
|
|
entry->key = aObject;
|
|
|
|
entry->value = aPropertyValue;
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
2006-01-27 02:40:49 +03:00
|
|
|
nsPropertyTable::DeleteProperty(nsPropertyOwner aObject,
|
2004-08-24 22:50:29 +04:00
|
|
|
nsIAtom *aPropertyName)
|
|
|
|
{
|
|
|
|
NS_PRECONDITION(aPropertyName && aObject, "unexpected null param");
|
|
|
|
|
2010-04-23 06:41:38 +04:00
|
|
|
PropertyList* propertyList = GetPropertyListFor(aPropertyName);
|
2004-08-24 22:50:29 +04:00
|
|
|
if (propertyList) {
|
|
|
|
if (propertyList->DeletePropertyFor(aObject))
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_PROPTABLE_PROP_NOT_THERE;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsPropertyTable::PropertyList*
|
2010-04-23 06:41:38 +04:00
|
|
|
nsPropertyTable::GetPropertyListFor(nsIAtom* aPropertyName) const
|
2004-08-24 22:50:29 +04:00
|
|
|
{
|
|
|
|
PropertyList* result;
|
|
|
|
|
|
|
|
for (result = mPropertyList; result; result = result->mNext) {
|
2010-04-23 06:41:38 +04:00
|
|
|
if (result->Equals(aPropertyName)) {
|
2004-08-24 22:50:29 +04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2015-01-14 03:40:00 +03:00
|
|
|
|
2010-04-23 06:41:38 +04:00
|
|
|
nsPropertyTable::PropertyList::PropertyList(nsIAtom *aName,
|
2005-01-21 20:00:07 +03:00
|
|
|
NSPropertyDtorFunc aDtorFunc,
|
2006-09-16 21:15:38 +04:00
|
|
|
void *aDtorData,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aTransfer)
|
2005-10-27 18:09:23 +04:00
|
|
|
: mName(aName),
|
|
|
|
mDtorFunc(aDtorFunc),
|
2006-09-16 21:15:38 +04:00
|
|
|
mDtorData(aDtorData),
|
|
|
|
mTransfer(aTransfer),
|
2012-07-30 18:20:58 +04:00
|
|
|
mNext(nullptr)
|
2004-08-24 22:50:29 +04:00
|
|
|
{
|
2015-05-15 07:48:43 +03:00
|
|
|
PL_DHashTableInit(&mObjectValueMap, PL_DHashGetStubOps(),
|
|
|
|
sizeof(PropertyListMapEntry));
|
2004-08-24 22:50:29 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsPropertyTable::PropertyList::~PropertyList()
|
|
|
|
{
|
2015-05-15 07:48:43 +03:00
|
|
|
PL_DHashTableFinish(&mObjectValueMap);
|
2004-08-24 22:50:29 +04:00
|
|
|
}
|
|
|
|
|
2015-05-15 07:48:43 +03:00
|
|
|
|
2008-10-10 19:04:34 +04:00
|
|
|
static PLDHashOperator
|
2004-08-24 22:50:29 +04:00
|
|
|
DestroyPropertyEnumerator(PLDHashTable *table, PLDHashEntryHdr *hdr,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t number, void *arg)
|
2004-08-24 22:50:29 +04:00
|
|
|
{
|
|
|
|
nsPropertyTable::PropertyList *propList =
|
2015-01-14 03:40:00 +03:00
|
|
|
static_cast<nsPropertyTable::PropertyList*>(arg);
|
2007-07-08 11:08:04 +04:00
|
|
|
PropertyListMapEntry* entry = static_cast<PropertyListMapEntry*>(hdr);
|
2004-08-24 22:50:29 +04:00
|
|
|
|
2007-07-08 11:08:04 +04:00
|
|
|
propList->mDtorFunc(const_cast<void*>(entry->key), propList->mName,
|
2006-09-16 21:15:38 +04:00
|
|
|
entry->value, propList->mDtorData);
|
2004-08-24 22:50:29 +04:00
|
|
|
return PL_DHASH_NEXT;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsPropertyTable::PropertyList::Destroy()
|
|
|
|
{
|
2005-10-27 18:09:23 +04:00
|
|
|
// Enumerate any remaining object/value pairs and destroy the value object
|
2004-08-24 22:50:29 +04:00
|
|
|
if (mDtorFunc)
|
2015-01-14 03:40:00 +03:00
|
|
|
PL_DHashTableEnumerate(&mObjectValueMap, DestroyPropertyEnumerator, this);
|
2004-08-24 22:50:29 +04:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool
|
2006-01-27 02:40:49 +03:00
|
|
|
nsPropertyTable::PropertyList::DeletePropertyFor(nsPropertyOwner aObject)
|
2004-08-24 22:50:29 +04:00
|
|
|
{
|
2015-01-23 08:06:55 +03:00
|
|
|
PropertyListMapEntry *entry =
|
|
|
|
static_cast<PropertyListMapEntry*>
|
|
|
|
(PL_DHashTableSearch(&mObjectValueMap, aObject));
|
|
|
|
if (!entry)
|
2011-10-17 18:59:28 +04:00
|
|
|
return false;
|
2004-08-24 22:50:29 +04:00
|
|
|
|
2006-09-25 01:13:36 +04:00
|
|
|
void* value = entry->value;
|
2004-08-24 22:50:29 +04:00
|
|
|
PL_DHashTableRawRemove(&mObjectValueMap, entry);
|
|
|
|
|
2006-09-25 01:13:36 +04:00
|
|
|
if (mDtorFunc)
|
2007-07-08 11:08:04 +04:00
|
|
|
mDtorFunc(const_cast<void*>(aObject.get()), mName, value, mDtorData);
|
2006-09-25 01:13:36 +04:00
|
|
|
|
2011-10-17 18:59:28 +04:00
|
|
|
return true;
|
2004-08-24 22:50:29 +04:00
|
|
|
}
|
2006-02-01 07:43:55 +03:00
|
|
|
|
2012-06-15 08:10:08 +04:00
|
|
|
size_t
|
2013-06-23 16:03:39 +04:00
|
|
|
nsPropertyTable::PropertyList::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
2012-06-15 08:10:08 +04:00
|
|
|
{
|
|
|
|
size_t n = aMallocSizeOf(this);
|
2013-04-03 05:14:24 +04:00
|
|
|
n += PL_DHashTableSizeOfExcludingThis(&mObjectValueMap, nullptr, aMallocSizeOf);
|
2012-06-15 08:10:08 +04:00
|
|
|
return n;
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t
|
2013-06-23 16:03:39 +04:00
|
|
|
nsPropertyTable::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
2012-06-15 08:10:08 +04:00
|
|
|
{
|
|
|
|
size_t n = 0;
|
|
|
|
|
|
|
|
for (PropertyList *prop = mPropertyList; prop; prop = prop->mNext) {
|
|
|
|
n += prop->SizeOfIncludingThis(aMallocSizeOf);
|
|
|
|
}
|
|
|
|
|
|
|
|
return n;
|
|
|
|
}
|
|
|
|
|
2014-05-01 21:37:54 +04:00
|
|
|
size_t
|
|
|
|
nsPropertyTable::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
|
|
|
{
|
|
|
|
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
|
|
|
}
|
|
|
|
|
2006-02-01 07:43:55 +03:00
|
|
|
/* static */
|
|
|
|
void
|
|
|
|
nsPropertyTable::SupportsDtorFunc(void *aObject, nsIAtom *aPropertyName,
|
|
|
|
void *aPropertyValue, void *aData)
|
|
|
|
{
|
2007-07-08 11:08:04 +04:00
|
|
|
nsISupports *propertyValue = static_cast<nsISupports*>(aPropertyValue);
|
2006-02-01 07:43:55 +03:00
|
|
|
NS_IF_RELEASE(propertyValue);
|
|
|
|
}
|