mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 670962 - Make nsGenericDOMDataNode and nsTextFragment participate to the DOM Memory Reporter. r=jst
This commit is contained in:
parent
fe35661680
commit
f91f167ea8
@ -67,7 +67,7 @@
|
||||
#include "pldhash.h"
|
||||
#include "prprf.h"
|
||||
|
||||
namespace css = mozilla::css;
|
||||
using namespace mozilla;
|
||||
|
||||
nsGenericDOMDataNode::nsGenericDOMDataNode(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
: nsIContent(aNodeInfo)
|
||||
@ -1065,3 +1065,13 @@ nsGenericDOMDataNode::GetClassAttributeName() const
|
||||
{
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
PRInt64
|
||||
nsGenericDOMDataNode::SizeOf() const
|
||||
{
|
||||
PRInt64 size = dom::MemoryReporter::GetBasicSize<nsGenericDOMDataNode,
|
||||
nsIContent>(this);
|
||||
size += mText.SizeOf() - sizeof(mText);
|
||||
return size;
|
||||
}
|
||||
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "nsGenericElement.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsDOMMemoryReporter.h"
|
||||
|
||||
#ifdef MOZ_SMIL
|
||||
#include "nsISMILAttr.h"
|
||||
@ -84,6 +85,8 @@ class nsGenericDOMDataNode : public nsIContent
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
|
||||
NS_DECL_DOM_MEMORY_REPORTER_SIZEOF
|
||||
|
||||
nsGenericDOMDataNode(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
virtual ~nsGenericDOMDataNode();
|
||||
|
||||
|
@ -47,6 +47,8 @@
|
||||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "nsDOMMemoryReporter.h"
|
||||
|
||||
class nsString;
|
||||
class nsCString;
|
||||
|
||||
@ -224,6 +226,17 @@ public:
|
||||
PRUint32 mLength : 29;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the size taken in memory by this text fragment.
|
||||
* @return the size taken in memory by this text fragment.
|
||||
*/
|
||||
PRInt64 SizeOf() const
|
||||
{
|
||||
PRInt64 size = sizeof(*this);
|
||||
size += GetLength() * Is2b() ? sizeof(*m2b) : sizeof(*m1b);
|
||||
return size;
|
||||
}
|
||||
|
||||
private:
|
||||
void ReleaseText();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user