mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 667883 - Implement nsAttrAndChildArray::SizeOf(). r=bz
This commit is contained in:
parent
14c6dacab7
commit
bbef6d1373
@ -42,6 +42,7 @@
|
||||
|
||||
#include "nsIContent.h"
|
||||
#include "nsEventStates.h"
|
||||
#include "nsDOMMemoryReporter.h"
|
||||
|
||||
class nsEventStateManager;
|
||||
class nsGlobalWindow;
|
||||
@ -97,6 +98,8 @@ public:
|
||||
{}
|
||||
#endif // MOZILLA_INTERNAL_API
|
||||
|
||||
NS_DECL_AND_IMPL_DOM_MEMORY_REPORTER_SIZEOF(Element, nsIContent)
|
||||
|
||||
/**
|
||||
* Method to get the full state of this element. See nsEventStates.h for
|
||||
* the possible bits that could be set here.
|
||||
|
@ -847,3 +847,21 @@ nsAttrAndChildArray::SetChildAtPos(void** aPos, nsIContent* aChild,
|
||||
next->mPreviousSibling = aChild;
|
||||
}
|
||||
}
|
||||
|
||||
PRInt64
|
||||
nsAttrAndChildArray::SizeOf() const
|
||||
{
|
||||
PRInt64 size = sizeof(*this);
|
||||
|
||||
if (mImpl) {
|
||||
// Don't add the size taken by *mMappedAttrs because it's shared.
|
||||
|
||||
// mBuffer cointains InternalAttr and nsIContent* (even if it's void**)
|
||||
// so, we just have to compute the size of *mBuffer given that this object
|
||||
// doesn't own the children list.
|
||||
size += mImpl->mBufferSize * sizeof(*(mImpl->mBuffer)) + NS_IMPL_EXTRA_SIZE;
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
@ -131,6 +131,8 @@ public:
|
||||
!AttrSlotIsTaken(ATTRCHILD_ARRAY_MAX_ATTR_COUNT - 1);
|
||||
}
|
||||
|
||||
PRInt64 SizeOf() const;
|
||||
|
||||
private:
|
||||
nsAttrAndChildArray(const nsAttrAndChildArray& aOther); // Not to be implemented
|
||||
nsAttrAndChildArray& operator=(const nsAttrAndChildArray& aOther); // Not to be implemented
|
||||
|
@ -146,6 +146,7 @@
|
||||
#include "prprf.h"
|
||||
|
||||
#include "nsSVGFeatures.h"
|
||||
#include "nsDOMMemoryReporter.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
namespace css = mozilla::css;
|
||||
@ -5372,3 +5373,15 @@ nsNSElementTearoff::MozMatchesSelector(const nsAString& aSelector, PRBool* aRetu
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
PRInt64
|
||||
nsGenericElement::SizeOf() const
|
||||
{
|
||||
PRInt64 size = MemoryReporter::GetBasicSize<nsGenericElement, Element>(this);
|
||||
|
||||
size -= sizeof(mAttrsAndChildren);
|
||||
size += mAttrsAndChildren.SizeOf();
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
@ -240,6 +240,8 @@ public:
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
|
||||
NS_DECL_DOM_MEMORY_REPORTER_SIZEOF
|
||||
|
||||
/**
|
||||
* Called during QueryInterface to give the binding manager a chance to
|
||||
* get an interface for this element.
|
||||
|
Loading…
Reference in New Issue
Block a user