mirror of
https://github.com/roytam1/palemoon26.git
synced 2026-05-26 13:58:38 +00:00
cherry-picked upstream change - Bug 798914 - Consolidate MallocSizeOf typedefs
This commit is contained in:
@@ -5,6 +5,9 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsNullPrincipalURI.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsEscape.h"
|
||||
#include "nsCRT.h"
|
||||
@@ -272,14 +275,14 @@ nsNullPrincipalURI::SchemeIs(const char *aScheme, bool *_schemeIs)
|
||||
//// nsISizeOf
|
||||
|
||||
size_t
|
||||
nsNullPrincipalURI::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsNullPrincipalURI::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return mScheme.SizeOfExcludingThisIfUnshared(aMallocSizeOf) +
|
||||
mPath.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
|
||||
}
|
||||
|
||||
size_t
|
||||
nsNullPrincipalURI::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
nsNullPrincipalURI::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsString.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
// {51fcd543-3b52-41f7-b91b-6b54102236e6}
|
||||
#define NS_NULLPRINCIPALURI_IMPLEMENTATION_CID \
|
||||
@@ -30,8 +31,8 @@ public:
|
||||
NS_DECL_NSIURI
|
||||
|
||||
// nsISizeOf
|
||||
virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
nsNullPrincipalURI(const nsCString &aSpec);
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#define FragmentOrElement_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsAttrAndChildArray.h" // member
|
||||
#include "nsCycleCollectionParticipant.h" // NS_DECL_CYCLE_*
|
||||
#include "nsIContent.h" // base class
|
||||
@@ -298,7 +299,7 @@ public:
|
||||
void Traverse(nsCycleCollectionTraversalCallback &cb, bool aIsXUL);
|
||||
void Unlink(bool aIsXUL);
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
/**
|
||||
* The .style attribute (an interface that forwards to the actual
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "nsPropertyTable.h" // for typedefs
|
||||
#include "nsTObserverArray.h" // for member
|
||||
#include "nsWindowMemoryReporter.h" // for NS_DECL_SIZEOF_EXCLUDING_THIS
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/EventTarget.h" // for base class
|
||||
|
||||
// Including 'windows.h' will #define GetClassInfo to something else.
|
||||
@@ -299,7 +300,7 @@ public:
|
||||
// way that |this| points to the start of the allocated object, even in
|
||||
// methods of nsINode's sub-classes, and so |aMallocSizeOf(this)| is always
|
||||
// safe to call no matter which object it was invoked on.
|
||||
virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
* utility methods for subclasses, and so forth.
|
||||
*/
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Util.h"
|
||||
#include "mozilla/Likely.h"
|
||||
|
||||
@@ -592,7 +593,7 @@ FragmentOrElement::nsDOMSlots::Unlink(bool aIsXUL)
|
||||
}
|
||||
|
||||
size_t
|
||||
FragmentOrElement::nsDOMSlots::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
FragmentOrElement::nsDOMSlots::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = aMallocSizeOf(this);
|
||||
|
||||
@@ -1831,7 +1832,7 @@ FragmentOrElement::FireNodeRemovedForChildren()
|
||||
}
|
||||
|
||||
size_t
|
||||
FragmentOrElement::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
FragmentOrElement::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = 0;
|
||||
n += nsIContent::SizeOfExcludingThis(aMallocSizeOf);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "Link.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsEventStates.h"
|
||||
#include "nsIURL.h"
|
||||
@@ -546,7 +547,7 @@ Link::SetHrefAttribute(nsIURI *aURI)
|
||||
}
|
||||
|
||||
size_t
|
||||
Link::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
Link::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#define mozilla_dom_Link_h__
|
||||
|
||||
#include "mozilla/IHistory.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsIContent.h"
|
||||
|
||||
namespace mozilla {
|
||||
@@ -103,7 +104,7 @@ public:
|
||||
virtual bool HasDeferredDNSPrefetchRequest() { return true; }
|
||||
|
||||
virtual size_t
|
||||
SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
bool ElementHasHref() const;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "nsAttrAndChildArray.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/CheckedInt.h"
|
||||
|
||||
#include "nsMappedAttributeElement.h"
|
||||
@@ -871,7 +872,7 @@ nsAttrAndChildArray::SetChildAtPos(void** aPos, nsIContent* aChild,
|
||||
}
|
||||
|
||||
size_t
|
||||
nsAttrAndChildArray::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsAttrAndChildArray::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = 0;
|
||||
if (mImpl) {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#define nsAttrAndChildArray_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsAttrName.h"
|
||||
@@ -116,7 +117,7 @@ public:
|
||||
!AttrSlotIsTaken(ATTRCHILD_ARRAY_MAX_ATTR_COUNT - 1);
|
||||
}
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
bool HasMappedAttrs() const
|
||||
{
|
||||
return MappedAttrCount();
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/css/StyleRule.h"
|
||||
#include "mozilla/css/Declaration.h"
|
||||
#include "nsContentUtils.h"
|
||||
@@ -1949,7 +1950,7 @@ nsAttrValue::StringToInteger(const nsAString& aValue, bool* aStrict,
|
||||
}
|
||||
|
||||
size_t
|
||||
nsAttrValue::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsAttrValue::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "SVGAttrValueWrapper.h"
|
||||
#include "nsTArrayForwardDeclare.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/BindingDeclarations.h"
|
||||
|
||||
class nsAString;
|
||||
@@ -371,7 +372,7 @@ public:
|
||||
bool ParseStyleAttribute(const nsAString& aString,
|
||||
nsStyledElementNotElementCSSInlineStyle* aElement);
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
private:
|
||||
// These have to be the same as in ValueType
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "nsDOMAttributeMap.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/Attr.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/MozNamedAttrMapBinding.h"
|
||||
@@ -533,14 +534,14 @@ nsDOMAttributeMap::Enumerate(AttrCache::EnumReadFunction aFunc,
|
||||
size_t
|
||||
AttrCacheSizeEnumerator(const nsAttrKey& aKey,
|
||||
const nsRefPtr<Attr>& aValue,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
return aMallocSizeOf(aValue.get());
|
||||
}
|
||||
|
||||
size_t
|
||||
nsDOMAttributeMap::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsDOMAttributeMap::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = aMallocSizeOf(this);
|
||||
n += mAttributeCache.SizeOfExcludingThis(AttrCacheSizeEnumerator,
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#ifndef nsDOMAttributeMap_h
|
||||
#define nsDOMAttributeMap_h
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/Attr.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
@@ -181,7 +182,7 @@ public:
|
||||
// No supported names we want to show up in iteration.
|
||||
}
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
private:
|
||||
nsCOMPtr<Element> mContent;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Util.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include <algorithm>
|
||||
@@ -454,7 +455,7 @@ nsIdentifierMapEntry::HasIdElementExposedAsHTMLDocumentProperty()
|
||||
// static
|
||||
size_t
|
||||
nsIdentifierMapEntry::SizeOfExcludingThis(nsIdentifierMapEntry* aEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void*)
|
||||
{
|
||||
return aEntry->GetKey().SizeOfExcludingThisIfUnshared(aMallocSizeOf);
|
||||
@@ -11181,14 +11182,14 @@ nsIDocument::DocSizeOfIncludingThis(nsWindowSizes* aWindowSizes) const
|
||||
|
||||
static size_t
|
||||
SizeOfStyleSheetsElementIncludingThis(nsIStyleSheet* aStyleSheet,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aData)
|
||||
{
|
||||
return aStyleSheet->SizeOfIncludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
size_t
|
||||
nsDocument::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsDocument::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
// This SizeOfExcludingThis() overrides the one from nsINode. But
|
||||
// nsDocuments can only appear at the top of the DOM tree, and we use the
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
#include "nsISecurityEventSink.h"
|
||||
#include "nsIChannelEventSink.h"
|
||||
#include "imgIRequest.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/DOMImplementation.h"
|
||||
#include "nsIDOMTouchEvent.h"
|
||||
#include "nsIInlineEventHandlers.h"
|
||||
@@ -224,7 +225,7 @@ public:
|
||||
};
|
||||
|
||||
static size_t SizeOfExcludingThis(nsIdentifierMapEntry* aEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
mozilla::MallocSizeOf aMallocSizeOf,
|
||||
void* aArg);
|
||||
|
||||
private:
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "mozilla/DebugOnly.h"
|
||||
|
||||
#include "nsGenericDOMDataNode.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsEventListenerManager.h"
|
||||
@@ -924,7 +925,7 @@ nsGenericDOMDataNode::GetClassAttributeName() const
|
||||
}
|
||||
|
||||
size_t
|
||||
nsGenericDOMDataNode::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsGenericDOMDataNode::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = nsIContent::SizeOfExcludingThis(aMallocSizeOf);
|
||||
n += mText.SizeOfExcludingThis(aMallocSizeOf);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "mozAutoDocUpdate.h"
|
||||
#include "mozilla/CORSMode.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Util.h"
|
||||
#include "nsAsyncDOMEvent.h"
|
||||
#include "nsAttrValueOrString.h"
|
||||
@@ -2091,7 +2092,7 @@ nsINode::UnbindObject(nsISupports* aObject)
|
||||
}
|
||||
|
||||
size_t
|
||||
nsINode::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsINode::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = 0;
|
||||
nsEventListenerManager* elm =
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "nsHTMLStyleSheet.h"
|
||||
#include "nsRuleWalker.h"
|
||||
#include "mozilla/HashFunctions.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
@@ -248,7 +249,7 @@ nsMappedAttributes::IndexOfAttr(nsIAtom* aLocalName) const
|
||||
}
|
||||
|
||||
size_t
|
||||
nsMappedAttributes::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsMappedAttributes::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
NS_ASSERTION(mAttrCount == mBufferSize,
|
||||
"mBufferSize and mAttrCount are expected to be the same.");
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "nsMappedAttributeElement.h"
|
||||
#include "nsIStyleRule.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
class nsIAtom;
|
||||
class nsHTMLStyleSheet;
|
||||
@@ -77,7 +78,7 @@ public:
|
||||
virtual void List(FILE* out = stdout, int32_t aIndent = 0) const MOZ_OVERRIDE;
|
||||
#endif
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
private:
|
||||
nsMappedAttributes(const nsMappedAttributes& aCopy);
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
*/
|
||||
|
||||
#include "nsPropertyTable.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "pldhash.h"
|
||||
#include "nsError.h"
|
||||
#include "nsIAtom.h"
|
||||
@@ -52,7 +55,7 @@ public:
|
||||
return mName == aPropertyName;
|
||||
}
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf);
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
|
||||
|
||||
nsCOMPtr<nsIAtom> mName; // property name
|
||||
PLDHashTable mObjectValueMap; // map of object/value pairs
|
||||
@@ -340,7 +343,7 @@ nsPropertyTable::PropertyList::DeletePropertyFor(nsPropertyOwner aObject)
|
||||
}
|
||||
|
||||
size_t
|
||||
nsPropertyTable::PropertyList::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf)
|
||||
nsPropertyTable::PropertyList::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
||||
{
|
||||
size_t n = aMallocSizeOf(this);
|
||||
n += PL_DHashTableSizeOfExcludingThis(&mObjectValueMap, nullptr, aMallocSizeOf);
|
||||
@@ -348,7 +351,7 @@ nsPropertyTable::PropertyList::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSize
|
||||
}
|
||||
|
||||
size_t
|
||||
nsPropertyTable::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsPropertyTable::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#ifndef nsPropertyTable_h_
|
||||
#define nsPropertyTable_h_
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nscore.h"
|
||||
|
||||
class nsIAtom;
|
||||
@@ -176,7 +177,7 @@ class nsPropertyTable
|
||||
|
||||
class PropertyList;
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
private:
|
||||
NS_HIDDEN_(void) DestroyPropertyList();
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "nsBidiUtils.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsUTF8Utils.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/SSE.h"
|
||||
#include "nsTextFragmentImpl.h"
|
||||
#include <algorithm>
|
||||
@@ -392,7 +393,7 @@ nsTextFragment::Append(const PRUnichar* aBuffer, uint32_t aLength, bool aUpdateB
|
||||
}
|
||||
|
||||
/* virtual */ size_t
|
||||
nsTextFragment::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
nsTextFragment::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
if (Is2b()) {
|
||||
return aMallocSizeOf(m2b);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#define nsTextFragment_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
@@ -174,7 +175,7 @@ public:
|
||||
uint32_t mLength : 29;
|
||||
};
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
private:
|
||||
void ReleaseText();
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#include "mozilla/CheckedInt.h"
|
||||
@@ -536,7 +537,7 @@ nsXMLHttpRequest::DisconnectFromOwner()
|
||||
|
||||
size_t
|
||||
nsXMLHttpRequest::SizeOfEventTargetIncludingThis(
|
||||
nsMallocSizeOfFun aMallocSizeOf) const
|
||||
MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = aMallocSizeOf(this);
|
||||
n += mResponseBody.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "nsIInputStream.h"
|
||||
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/BindingUtils.h"
|
||||
#include "mozilla/dom/TypedArray.h"
|
||||
#include "mozilla/dom/XMLHttpRequestBinding.h"
|
||||
@@ -229,7 +230,7 @@ public:
|
||||
|
||||
// nsISizeOfEventTarget
|
||||
virtual size_t
|
||||
SizeOfEventTargetIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
SizeOfEventTargetIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsXHREventTarget)
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "nsWrapperCache.h"
|
||||
|
||||
#include "mozilla/LinkedList.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@@ -32,7 +33,7 @@ public:
|
||||
|
||||
void Delete();
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
|
||||
size_t sizeOfCache = mCache ? mCache->SizeOfIncludingThis(aMallocSizeOf) : 0;
|
||||
return aMallocSizeOf(this) + sizeOfCache;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "nsTArray.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
@@ -306,7 +307,7 @@ public:
|
||||
|
||||
void Update();
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return aMallocSizeOf(this) + mTreeData.SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
@@ -558,7 +559,7 @@ bool WebGLElementArrayCache::Validate(GLenum type, uint32_t maxAllowed, size_t f
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t WebGLElementArrayCache::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
size_t WebGLElementArrayCache::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
|
||||
size_t uint8TreeSize = mUint8Tree ? mUint8Tree->SizeOfIncludingThis(aMallocSizeOf) : 0;
|
||||
size_t uint16TreeSize = mUint16Tree ? mUint16Tree->SizeOfIncludingThis(aMallocSizeOf) : 0;
|
||||
size_t uint32TreeSize = mUint32Tree ? mUint32Tree->SizeOfIncludingThis(aMallocSizeOf) : 0;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#ifndef WEBGLELEMENTARRAYCACHE_H
|
||||
#define WEBGLELEMENTARRAYCACHE_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/StandardInteger.h"
|
||||
#include "nscore.h"
|
||||
#include "GLDefs.h"
|
||||
@@ -47,7 +48,7 @@ public:
|
||||
|
||||
~WebGLElementArrayCache();
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "WebGLObjectModel.h"
|
||||
#include "WebGLShader.h"
|
||||
#include "WebGLContext.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/WebGLRenderingContextBinding.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
@@ -39,7 +40,7 @@ WebGLShader::Delete() {
|
||||
}
|
||||
|
||||
size_t
|
||||
WebGLShader::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
WebGLShader::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
|
||||
return aMallocSizeOf(this) +
|
||||
mSource.SizeOfExcludingThisIfUnshared(aMallocSizeOf) +
|
||||
mTranslationLog.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "angle/ShaderLang.h"
|
||||
|
||||
#include "mozilla/LinkedList.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@@ -39,7 +40,7 @@ public:
|
||||
DeleteOnce();
|
||||
}
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
WebGLuint GLName() { return mGLName; }
|
||||
WebGLenum ShaderType() { return mType; }
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsView.h"
|
||||
@@ -1302,7 +1303,7 @@ nsEventListenerManager::GetEventHandlerInternal(nsIAtom *aEventName)
|
||||
}
|
||||
|
||||
size_t
|
||||
nsEventListenerManager::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf)
|
||||
nsEventListenerManager::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf)
|
||||
const
|
||||
{
|
||||
size_t n = aMallocSizeOf(this);
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "nsTObserverArray.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIJSEventListener.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/EventTarget.h"
|
||||
#include "mozilla/dom/EventListenerBinding.h"
|
||||
|
||||
@@ -400,7 +401,7 @@ public:
|
||||
|
||||
bool MayHaveMouseEnterLeaveEventListener() { return mMayHaveMouseEnterLeaveEventListener; }
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
void MarkForCC();
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "mozilla/dom/HTMLAnchorElement.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/HTMLAnchorElementBinding.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
@@ -413,7 +415,7 @@ HTMLAnchorElement::IntrinsicState() const
|
||||
}
|
||||
|
||||
size_t
|
||||
HTMLAnchorElement::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
HTMLAnchorElement::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return nsGenericHTMLElement::SizeOfExcludingThis(aMallocSizeOf) +
|
||||
Link::SizeOfExcludingThis(aMallocSizeOf);
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "mozilla/dom/HTMLAreaElement.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/HTMLAreaElementBinding.h"
|
||||
#include "base/compiler_specific.h"
|
||||
|
||||
@@ -232,7 +234,7 @@ HTMLAreaElement::IntrinsicState() const
|
||||
}
|
||||
|
||||
size_t
|
||||
HTMLAreaElement::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
HTMLAreaElement::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return nsGenericHTMLElement::SizeOfExcludingThis(aMallocSizeOf) +
|
||||
Link::SizeOfExcludingThis(aMallocSizeOf);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "mozilla/dom/HTMLLinkElement.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/HTMLLinkElementBinding.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
@@ -389,7 +390,7 @@ HTMLLinkElement::IntrinsicState() const
|
||||
}
|
||||
|
||||
size_t
|
||||
HTMLLinkElement::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
HTMLLinkElement::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return nsGenericHTMLElement::SizeOfExcludingThis(aMallocSizeOf) +
|
||||
Link::SizeOfExcludingThis(aMallocSizeOf);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "nsIXULAppInfo.h"
|
||||
#include "nsPluginArray.h"
|
||||
#include "nsMimeTypeArray.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/DesktopNotification.h"
|
||||
#include "nsGeolocation.h"
|
||||
#include "nsIHttpProtocolHandler.h"
|
||||
@@ -1570,7 +1571,7 @@ Navigator::GetMozCameras(nsISupports** aCameraManager)
|
||||
}
|
||||
|
||||
size_t
|
||||
Navigator::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
Navigator::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = aMallocSizeOf(this);
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#ifndef mozilla_dom_Navigator_h
|
||||
#define mozilla_dom_Navigator_h
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsIDOMNavigator.h"
|
||||
#include "nsIDOMNavigatorGeolocation.h"
|
||||
#include "nsIDOMNavigatorDeviceStorage.h"
|
||||
@@ -200,7 +201,7 @@ public:
|
||||
|
||||
static bool HasDesktopNotificationSupport();
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
/**
|
||||
* For use during document.write where our inner window changes.
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
/* This must occur *after* base/basictypes.h to avoid typedefs conflicts. */
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
// Local Includes
|
||||
@@ -11385,7 +11386,7 @@ nsGlobalWindow::HasIndexedDBSupport()
|
||||
static size_t
|
||||
SizeOfEventTargetObjectsEntryExcludingThisFun(
|
||||
nsPtrHashKey<nsDOMEventTargetHelper> *aEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void *arg)
|
||||
{
|
||||
nsISupports *supports = aEntry->GetKey();
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "xpcpublic.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/EventHandlerBinding.h"
|
||||
|
||||
#define NS_IJSEVENTLISTENER_IID \
|
||||
@@ -241,7 +242,7 @@ public:
|
||||
mHandler.SetHandler(aHandler);
|
||||
}
|
||||
|
||||
virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -257,7 +258,7 @@ public:
|
||||
// - mEventName: shared with others
|
||||
}
|
||||
|
||||
virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#ifndef nsISizeOfEventTarget_h___
|
||||
#define nsISizeOfEventTarget_h___
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsISupports.h"
|
||||
|
||||
#define NS_ISIZEOFEVENTTARGET_IID \
|
||||
@@ -31,7 +32,7 @@ public:
|
||||
* itself.
|
||||
*/
|
||||
virtual size_t
|
||||
SizeOfEventTargetIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const = 0;
|
||||
SizeOfEventTargetIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const = 0;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsISizeOfEventTarget, NS_ISIZEOFEVENTTARGET_IID)
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "nsCRT.h"
|
||||
#include "nsIObserverService.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Services.h"
|
||||
|
||||
@@ -43,7 +44,7 @@ public:
|
||||
nsString mKey;
|
||||
nsGlobalNameStruct mGlobalName;
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) {
|
||||
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) {
|
||||
// Measurement of the following members may be added later if DMD finds it
|
||||
// is worthwhile:
|
||||
// - mGlobalName
|
||||
@@ -810,7 +811,7 @@ nsScriptNameSpaceManager::EnumerateGlobalNames(GlobalNameEnumerator aEnumerator,
|
||||
}
|
||||
|
||||
static size_t
|
||||
SizeOfEntryExcludingThis(PLDHashEntryHdr *aHdr, nsMallocSizeOfFun aMallocSizeOf,
|
||||
SizeOfEntryExcludingThis(PLDHashEntryHdr *aHdr, MallocSizeOf aMallocSizeOf,
|
||||
void *aArg)
|
||||
{
|
||||
GlobalNameMapEntry* entry = static_cast<GlobalNameMapEntry*>(aHdr);
|
||||
@@ -818,7 +819,7 @@ SizeOfEntryExcludingThis(PLDHashEntryHdr *aHdr, nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
size_t
|
||||
nsScriptNameSpaceManager::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf)
|
||||
nsScriptNameSpaceManager::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf)
|
||||
{
|
||||
size_t n = 0;
|
||||
n += PL_DHashTableSizeOfExcludingThis(&mGlobalNames,
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#ifndef nsScriptNameSpaceManager_h__
|
||||
#define nsScriptNameSpaceManager_h__
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsIScriptNameSpaceManager.h"
|
||||
#include "nsString.h"
|
||||
#include "nsID.h"
|
||||
@@ -156,7 +157,7 @@ public:
|
||||
void EnumerateGlobalNames(GlobalNameEnumerator aEnumerator,
|
||||
void* aClosure);
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf);
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
|
||||
|
||||
private:
|
||||
// Adds a new entry to the hash and returns the nsGlobalNameStruct
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "nsDataHashtable.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "nsArenaMemoryStats.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
@@ -21,15 +22,15 @@
|
||||
// SizeOfExcludingThis from its super-class. SizeOfIncludingThis() need not be
|
||||
// defined, it is inherited from nsINode.
|
||||
#define NS_DECL_SIZEOF_EXCLUDING_THIS \
|
||||
virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
class nsWindowSizes {
|
||||
public:
|
||||
nsWindowSizes(nsMallocSizeOfFun aMallocSizeOf) {
|
||||
nsWindowSizes(mozilla::MallocSizeOf aMallocSizeOf) {
|
||||
memset(this, 0, sizeof(nsWindowSizes));
|
||||
mMallocSizeOf = aMallocSizeOf;
|
||||
}
|
||||
nsMallocSizeOfFun mMallocSizeOf;
|
||||
mozilla::MallocSizeOf mMallocSizeOf;
|
||||
nsArenaMemoryStats mArenaStats;
|
||||
size_t mDOMElementNodes;
|
||||
size_t mDOMTextNodes;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#define nsJSEventListener_h__
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsIDOMKeyEvent.h"
|
||||
#include "nsIJSEventListener.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
@@ -33,7 +34,7 @@ public:
|
||||
|
||||
// nsIJSEventListener
|
||||
|
||||
virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE
|
||||
{
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "mozilla/Base64.h"
|
||||
#include "mozilla/CheckedInt.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "gfxASurface.h"
|
||||
#include "gfxContext.h"
|
||||
@@ -671,14 +672,14 @@ gfxASurface::RecordMemoryFreed()
|
||||
}
|
||||
|
||||
size_t
|
||||
gfxASurface::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
gfxASurface::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
// We don't measure mSurface because cairo doesn't allow it.
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t
|
||||
gfxASurface::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
gfxASurface::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#define MOZ_DUMP_IMAGES
|
||||
#endif
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "gfxTypes.h"
|
||||
#include "gfxRect.h"
|
||||
#include "nsAutoPtr.h"
|
||||
@@ -210,8 +211,8 @@ public:
|
||||
|
||||
virtual int32_t KnownMemoryUsed() { return mBytesRecorded; }
|
||||
|
||||
virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
// gfxASurface has many sub-classes. This method indicates if a sub-class
|
||||
// is capable of measuring its own size accurately. If not, the caller
|
||||
// must fall back to a computed size. (Note that gfxASurface can actually
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#ifdef MOZ_LOGGING
|
||||
@@ -212,7 +213,7 @@ gfxDWriteFontFamily::LocalizedName(nsAString &aLocalizedName)
|
||||
}
|
||||
|
||||
void
|
||||
gfxDWriteFontFamily::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxDWriteFontFamily::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
gfxFontFamily::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@@ -221,7 +222,7 @@ gfxDWriteFontFamily::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxDWriteFontFamily::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxDWriteFontFamily::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
@@ -554,7 +555,7 @@ gfxDWriteFontEntry::IsCJKFont()
|
||||
}
|
||||
|
||||
void
|
||||
gfxDWriteFontEntry::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxDWriteFontEntry::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
gfxFontEntry::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@@ -563,7 +564,7 @@ gfxDWriteFontEntry::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxDWriteFontEntry::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxDWriteFontEntry::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
@@ -1208,7 +1209,7 @@ gfxDWriteFontList::ResolveFontName(const nsAString& aFontName,
|
||||
}
|
||||
|
||||
void
|
||||
gfxDWriteFontList::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxDWriteFontList::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
gfxPlatformFontList::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@@ -1226,7 +1227,7 @@ gfxDWriteFontList::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxDWriteFontList::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxDWriteFontList::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#ifndef GFX_DWRITEFONTLIST_H
|
||||
#define GFX_DWRITEFONTLIST_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "gfxDWriteCommon.h"
|
||||
|
||||
#include "gfxFont.h"
|
||||
@@ -48,9 +49,9 @@ public:
|
||||
|
||||
void SetForceGDIClassic(bool aForce) { mForceGDIClassic = aForce; }
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
protected:
|
||||
@@ -152,9 +153,9 @@ public:
|
||||
void SetForceGDIClassic(bool aForce) { mForceGDIClassic = aForce; }
|
||||
bool GetForceGDIClassic() { return mForceGDIClassic; }
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
protected:
|
||||
@@ -365,9 +366,9 @@ public:
|
||||
|
||||
gfxFloat GetForceGDIClassicMaxFontSize() { return mForceGDIClassicMaxFontSize; }
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "gfxDWriteFonts.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "gfxDWriteShaper.h"
|
||||
#include "gfxHarfBuzzShaper.h"
|
||||
#include <algorithm>
|
||||
@@ -668,7 +671,7 @@ gfxDWriteFont::MeasureGlyphWidth(uint16_t aGlyph)
|
||||
}
|
||||
|
||||
void
|
||||
gfxDWriteFont::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxDWriteFont::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
gfxFont::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@@ -677,7 +680,7 @@ gfxDWriteFont::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxDWriteFont::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxDWriteFont::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontInstances += aMallocSizeOf(this);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#ifndef GFX_WINDOWSDWRITEFONTS_H
|
||||
#define GFX_WINDOWSDWRITEFONTS_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include <dwrite.h>
|
||||
|
||||
#include "gfxFont.h"
|
||||
@@ -58,9 +59,9 @@ public:
|
||||
|
||||
virtual mozilla::TemporaryRef<mozilla::gfx::GlyphRenderingOptions> GetGlyphRenderingOptions();
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
|
||||
virtual FontType GetType() const { return FONT_TYPE_DWRITE; }
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#if defined(MOZ_WIDGET_GTK2)
|
||||
@@ -464,7 +465,7 @@ FT2FontEntry::CopyFontTable(uint32_t aTableTag,
|
||||
}
|
||||
|
||||
void
|
||||
FT2FontEntry::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
FT2FontEntry::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
gfxFontEntry::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@@ -473,7 +474,7 @@ FT2FontEntry::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
FT2FontEntry::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
FT2FontEntry::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#ifndef GFX_FT2FONTLIST_H
|
||||
#define GFX_FT2FONTLIST_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#ifdef XP_WIN
|
||||
#include "gfxWindowsPlatform.h"
|
||||
#include <windows.h>
|
||||
@@ -74,9 +76,9 @@ public:
|
||||
// accordingly so that we avoid using bad font tables
|
||||
void CheckForBrokenFont(gfxFontFamily *aFamily);
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
FT_Face mFTFace;
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "prlog.h"
|
||||
#include "prinit.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
// rounding and truncation functions for a Freetype floating point number
|
||||
@@ -642,7 +643,7 @@ gfxFT2Font::FillGlyphDataForChar(uint32_t ch, CachedGlyphData *gd)
|
||||
}
|
||||
|
||||
void
|
||||
gfxFT2Font::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFT2Font::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
gfxFont::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@@ -651,7 +652,7 @@ gfxFT2Font::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxFT2Font::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFT2Font::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontInstances += aMallocSizeOf(this);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#ifndef GFX_FT2FONTS_H
|
||||
#define GFX_FT2FONTS_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "cairo.h"
|
||||
#include "gfxTypes.h"
|
||||
#include "gfxFont.h"
|
||||
@@ -63,9 +64,9 @@ public: // new functions
|
||||
return &entry->mData;
|
||||
}
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
|
||||
protected:
|
||||
|
||||
+19
-18
@@ -35,6 +35,7 @@
|
||||
#include "nsStyleConsts.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "gfxSVGGlyphs.h"
|
||||
@@ -348,10 +349,10 @@ public:
|
||||
mHashKey = 0;
|
||||
}
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const {
|
||||
return mTableData.SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
@@ -599,7 +600,7 @@ gfxFontEntry::CheckForGraphiteTables()
|
||||
/* static */ size_t
|
||||
gfxFontEntry::FontTableHashEntry::SizeOfEntryExcludingThis
|
||||
(FontTableHashEntry *aEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
FontListSizes *sizes = static_cast<FontListSizes*>(aUserArg);
|
||||
@@ -617,7 +618,7 @@ gfxFontEntry::FontTableHashEntry::SizeOfEntryExcludingThis
|
||||
}
|
||||
|
||||
void
|
||||
gfxFontEntry::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFontEntry::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += mName.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
|
||||
@@ -634,7 +635,7 @@ gfxFontEntry::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxFontEntry::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFontEntry::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
@@ -1220,7 +1221,7 @@ gfxFontFamily::FindFont(const nsAString& aPostscriptName)
|
||||
}
|
||||
|
||||
void
|
||||
gfxFontFamily::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFontFamily::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize +=
|
||||
@@ -1239,7 +1240,7 @@ gfxFontFamily::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxFontFamily::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFontFamily::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
@@ -1498,7 +1499,7 @@ gfxFontCache::ClearCachedWordsForFont(HashEntry* aHashEntry, void* aUserData)
|
||||
/*static*/
|
||||
size_t
|
||||
gfxFontCache::SizeOfFontEntryExcludingThis(HashEntry* aHashEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
HashEntry *entry = static_cast<HashEntry*>(aHashEntry);
|
||||
@@ -1511,7 +1512,7 @@ gfxFontCache::SizeOfFontEntryExcludingThis(HashEntry* aHashEntry,
|
||||
}
|
||||
|
||||
void
|
||||
gfxFontCache::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFontCache::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
// TODO: add the overhead of the expiration tracker (generation arrays)
|
||||
@@ -1521,7 +1522,7 @@ gfxFontCache::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxFontCache::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFontCache::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontInstances += aMallocSizeOf(this);
|
||||
@@ -3685,14 +3686,14 @@ gfxFont::SynthesizeSpaceWidth(uint32_t aCh)
|
||||
|
||||
/*static*/ size_t
|
||||
gfxFont::WordCacheEntrySizeOfExcludingThis(CacheHashEntry* aHashEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
return aMallocSizeOf(aHashEntry->mShapedWord.get());
|
||||
}
|
||||
|
||||
void
|
||||
gfxFont::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFont::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
for (uint32_t i = 0; i < mGlyphExtentsArray.Length(); ++i) {
|
||||
@@ -3705,7 +3706,7 @@ gfxFont::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxFont::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxFont::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontInstances += aMallocSizeOf(this);
|
||||
@@ -3762,7 +3763,7 @@ gfxGlyphExtents::GlyphWidths::~GlyphWidths()
|
||||
}
|
||||
|
||||
uint32_t
|
||||
gfxGlyphExtents::GlyphWidths::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
gfxGlyphExtents::GlyphWidths::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
uint32_t i;
|
||||
uint32_t size = mBlocks.SizeOfExcludingThis(aMallocSizeOf);
|
||||
@@ -3826,14 +3827,14 @@ gfxGlyphExtents::SetTightGlyphExtents(uint32_t aGlyphID, const gfxRect& aExtents
|
||||
}
|
||||
|
||||
size_t
|
||||
gfxGlyphExtents::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
gfxGlyphExtents::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return mContainedGlyphWidths.SizeOfExcludingThis(aMallocSizeOf) +
|
||||
mTightGlyphExtents.SizeOfExcludingThis(nullptr, aMallocSizeOf);
|
||||
}
|
||||
|
||||
size_t
|
||||
gfxGlyphExtents::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
gfxGlyphExtents::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
@@ -6564,7 +6565,7 @@ gfxTextRun::ClusterIterator::ClusterAdvance(PropertyProvider *aProvider) const
|
||||
}
|
||||
|
||||
size_t
|
||||
gfxTextRun::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf)
|
||||
gfxTextRun::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf)
|
||||
{
|
||||
// The second arg is how much gfxTextRun::AllocateStorage would have
|
||||
// allocated.
|
||||
@@ -6578,7 +6579,7 @@ gfxTextRun::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf)
|
||||
}
|
||||
|
||||
size_t
|
||||
gfxTextRun::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf)
|
||||
gfxTextRun::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf)
|
||||
{
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
+20
-19
@@ -25,6 +25,7 @@
|
||||
#include "mozilla/HashFunctions.h"
|
||||
#include "nsIMemoryReporter.h"
|
||||
#include "gfxFontFeatures.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/gfx/Types.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include <algorithm>
|
||||
@@ -196,7 +197,7 @@ public:
|
||||
|
||||
void CalcHash() { mHash = GetChecksum(); }
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
|
||||
return gfxSparseBitSet::SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
@@ -422,9 +423,9 @@ public:
|
||||
virtual void ReleaseGrFace(gr_face* aFace);
|
||||
|
||||
// For memory reporting
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
nsString mName;
|
||||
@@ -636,7 +637,7 @@ private:
|
||||
|
||||
static size_t
|
||||
SizeOfEntryExcludingThis(FontTableHashEntry *aEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
mozilla::MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg);
|
||||
|
||||
private:
|
||||
@@ -797,9 +798,9 @@ public:
|
||||
void CheckForSimpleFamily();
|
||||
|
||||
// For memory reporter
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
// Only used for debugging checks - does a linear search
|
||||
@@ -965,9 +966,9 @@ public:
|
||||
mFonts.EnumerateEntries(ClearCachedWordsForFont, nullptr);
|
||||
}
|
||||
|
||||
void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
|
||||
protected:
|
||||
@@ -1012,7 +1013,7 @@ protected:
|
||||
};
|
||||
|
||||
static size_t SizeOfFontEntryExcludingThis(HashEntry* aHashEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
mozilla::MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg);
|
||||
|
||||
nsTHashtable<HashEntry> mFonts;
|
||||
@@ -1186,8 +1187,8 @@ public:
|
||||
|
||||
int32_t GetAppUnitsPerDevUnit() { return mAppUnitsPerDevUnit; }
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
private:
|
||||
class HashEntry : public nsUint32HashKey {
|
||||
@@ -1224,7 +1225,7 @@ private:
|
||||
return widths[indexInBlock];
|
||||
}
|
||||
|
||||
uint32_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
uint32_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
~GlyphWidths();
|
||||
|
||||
@@ -1692,9 +1693,9 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
|
||||
typedef enum {
|
||||
@@ -1902,7 +1903,7 @@ protected:
|
||||
|
||||
static size_t
|
||||
WordCacheEntrySizeOfExcludingThis(CacheHashEntry* aHashEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
mozilla::MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg);
|
||||
|
||||
nsTHashtable<CacheHashEntry> mWordCache;
|
||||
@@ -2395,7 +2396,7 @@ protected:
|
||||
return details;
|
||||
}
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) {
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) {
|
||||
return aMallocSizeOf(this) +
|
||||
mDetails.SizeOfExcludingThis(aMallocSizeOf) +
|
||||
mOffsetToIndex.SizeOfExcludingThis(aMallocSizeOf);
|
||||
@@ -3153,13 +3154,13 @@ public:
|
||||
|
||||
// return storage used by this run, for memory reporter;
|
||||
// nsTransformedTextRun needs to override this as it holds additional data
|
||||
virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf)
|
||||
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
||||
MOZ_MUST_OVERRIDE;
|
||||
virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf)
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
||||
MOZ_MUST_OVERRIDE;
|
||||
|
||||
// Get the size, if it hasn't already been gotten, marking as it goes.
|
||||
size_t MaybeSizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) {
|
||||
size_t MaybeSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) {
|
||||
if (mFlags & gfxTextRunFactory::TEXT_RUN_SIZE_ACCOUNTED) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "nsAutoPtr.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/Endian.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "zlib.h"
|
||||
#include <algorithm>
|
||||
@@ -257,7 +258,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
|
||||
size_t total = mBlocks.SizeOfExcludingThis(aMallocSizeOf);
|
||||
for (uint32_t i = 0; i < mBlocks.Length(); i++) {
|
||||
if (mBlocks[i]) {
|
||||
@@ -267,7 +268,7 @@ public:
|
||||
return total;
|
||||
}
|
||||
|
||||
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const {
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "gfxGDIFont.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "gfxGDIShaper.h"
|
||||
#include "gfxUniscribeShaper.h"
|
||||
#include "gfxHarfBuzzShaper.h"
|
||||
@@ -561,7 +564,7 @@ gfxGDIFont::GetGlyphWidth(gfxContext *aCtx, uint16_t aGID)
|
||||
}
|
||||
|
||||
void
|
||||
gfxGDIFont::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxGDIFont::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
gfxFont::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@@ -570,7 +573,7 @@ gfxGDIFont::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxGDIFont::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxGDIFont::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontInstances += aMallocSizeOf(this);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#ifndef GFX_GDIFONT_H
|
||||
#define GFX_GDIFONT_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "gfxFont.h"
|
||||
#include "gfxGDIFontList.h"
|
||||
|
||||
@@ -53,9 +54,9 @@ public:
|
||||
// get hinted glyph width in pixels as 16.16 fixed-point value
|
||||
virtual int32_t GetGlyphWidth(gfxContext *aCtx, uint16_t aGID);
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
|
||||
virtual FontType GetType() const { return FONT_TYPE_GDI; }
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#include "nsISimpleEnumerator.h"
|
||||
#include "nsIWindowsRegKey.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include <usp10.h>
|
||||
#include <t2embapi.h>
|
||||
|
||||
@@ -442,7 +444,7 @@ GDIFontEntry::CreateFontEntry(const nsAString& aName,
|
||||
}
|
||||
|
||||
void
|
||||
GDIFontEntry::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
GDIFontEntry::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
@@ -1062,7 +1064,7 @@ gfxGDIFontList::ResolveFontName(const nsAString& aFontName, nsAString& aResolved
|
||||
}
|
||||
|
||||
void
|
||||
gfxGDIFontList::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxGDIFontList::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
gfxPlatformFontList::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@@ -1078,7 +1080,7 @@ gfxGDIFontList::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxGDIFontList::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxGDIFontList::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#ifndef GFX_GDIFONTLIST_H
|
||||
#define GFX_GDIFONTLIST_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "gfxWindowsPlatform.h"
|
||||
#include "gfxPlatformFontList.h"
|
||||
#include "nsGkAtoms.h"
|
||||
@@ -239,7 +240,7 @@ public:
|
||||
|
||||
virtual bool TestCharacterMap(uint32_t aCh);
|
||||
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
// create a font entry for a font with a given name
|
||||
@@ -321,9 +322,9 @@ public:
|
||||
virtual bool ResolveFontName(const nsAString& aFontName,
|
||||
nsAString& aResolvedFontName);
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "gfxAlphaRecovery.h"
|
||||
#include "gfxImageSurface.h"
|
||||
|
||||
@@ -197,7 +198,7 @@ gfxImageSurface::ComputeStride(const gfxIntSize& aSize, gfxImageFormat aFormat)
|
||||
}
|
||||
|
||||
size_t
|
||||
gfxImageSurface::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
gfxImageSurface::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = gfxASurface::SizeOfExcludingThis(aMallocSizeOf);
|
||||
if (mOwnsData) {
|
||||
@@ -207,7 +208,7 @@ gfxImageSurface::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
}
|
||||
|
||||
size_t
|
||||
gfxImageSurface::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
gfxImageSurface::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#ifndef GFX_IMAGESURFACE_H
|
||||
#define GFX_IMAGESURFACE_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "gfxASurface.h"
|
||||
#include "gfxPoint.h"
|
||||
|
||||
@@ -113,9 +114,9 @@ public:
|
||||
|
||||
static long ComputeStride(const gfxIntSize&, gfxImageFormat);
|
||||
|
||||
virtual size_t SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
MOZ_OVERRIDE;
|
||||
virtual size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
MOZ_OVERRIDE;
|
||||
virtual bool SizeOfIsMeasured() const MOZ_OVERRIDE;
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "gfxMacFont.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "gfxCoreTextShaper.h"
|
||||
#include "gfxHarfBuzzShaper.h"
|
||||
#include <algorithm>
|
||||
@@ -410,7 +413,7 @@ gfxMacFont::GetScaledFont(DrawTarget *aTarget)
|
||||
}
|
||||
|
||||
void
|
||||
gfxMacFont::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxMacFont::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
gfxFont::SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
@@ -419,7 +422,7 @@ gfxMacFont::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxMacFont::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
gfxMacFont::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontInstances += aMallocSizeOf(this);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#ifndef GFX_MACFONT_H
|
||||
#define GFX_MACFONT_H
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "gfxFont.h"
|
||||
#include "gfxMacPlatformFontList.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
@@ -42,9 +43,9 @@ public:
|
||||
|
||||
virtual mozilla::TemporaryRef<mozilla::gfx::ScaledFont> GetScaledFont(mozilla::gfx::DrawTarget *aTarget);
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes* aSizes) const;
|
||||
|
||||
virtual FontType GetType() const { return FONT_TYPE_MAC; }
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#ifndef gfxMacPlatformFontList_H_
|
||||
#define gfxMacPlatformFontList_H_
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsDataHashtable.h"
|
||||
#include "nsRefPtrHashtable.h"
|
||||
|
||||
@@ -44,7 +45,7 @@ public:
|
||||
// use CGFontRef API to get direct access to system font data
|
||||
virtual hb_blob_t *GetFontTable(uint32_t aTag) MOZ_OVERRIDE;
|
||||
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
nsresult ReadCMAP();
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
#include "nsISimpleEnumerator.h"
|
||||
#include "nsCharTraits.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
#include <unistd.h>
|
||||
@@ -423,7 +424,7 @@ MacOSFontEntry::HasFontTable(uint32_t aTableTag)
|
||||
}
|
||||
|
||||
void
|
||||
MacOSFontEntry::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
MacOSFontEntry::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
|
||||
@@ -748,7 +749,7 @@ gfxPlatformFontList::GetPrefsAndStartLoader()
|
||||
static size_t
|
||||
SizeOfFamilyEntryExcludingThis(const nsAString& aKey,
|
||||
const nsRefPtr<gfxFontFamily>& aFamily,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
FontListSizes *sizes = static_cast<FontListSizes*>(aUserArg);
|
||||
@@ -766,7 +767,7 @@ SizeOfFamilyEntryExcludingThis(const nsAString& aKey,
|
||||
gfxPlatformFontList::SizeOfFamilyNameEntryExcludingThis
|
||||
(const nsAString& aKey,
|
||||
const nsRefPtr<gfxFontFamily>& aFamily,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
// we don't count the size of the family here, because this is an *extra*
|
||||
@@ -777,7 +778,7 @@ gfxPlatformFontList::SizeOfFamilyNameEntryExcludingThis
|
||||
static size_t
|
||||
SizeOfFontNameEntryExcludingThis(const nsAString& aKey,
|
||||
const nsRefPtr<gfxFontEntry>& aFont,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
// the font itself is counted by its owning family; here we only care about
|
||||
@@ -789,7 +790,7 @@ static size_t
|
||||
SizeOfPrefFontEntryExcludingThis
|
||||
(const uint32_t& aKey,
|
||||
const nsTArray<nsRefPtr<gfxFontFamily> >& aList,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
// again, we only care about the size of the array itself; we don't follow
|
||||
@@ -800,7 +801,7 @@ SizeOfPrefFontEntryExcludingThis
|
||||
|
||||
static size_t
|
||||
SizeOfStringEntryExcludingThis(nsStringHashKey* aHashEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
return aHashEntry->GetKey().SizeOfExcludingThisIfUnshared(aMallocSizeOf);
|
||||
@@ -808,7 +809,7 @@ SizeOfStringEntryExcludingThis(nsStringHashKey* aHashEntry,
|
||||
|
||||
static size_t
|
||||
SizeOfSharedCmapExcludingThis(CharMapHashKey* aHashEntry,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg)
|
||||
{
|
||||
FontListSizes *sizes = static_cast<FontListSizes*>(aUserArg);
|
||||
@@ -822,8 +823,8 @@ SizeOfSharedCmapExcludingThis(CharMapHashKey* aHashEntry,
|
||||
}
|
||||
|
||||
void
|
||||
gfxPlatformFontList::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
gfxPlatformFontList::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize +=
|
||||
mFontFamilies.SizeOfExcludingThis(SizeOfFamilyEntryExcludingThis,
|
||||
@@ -861,8 +862,8 @@ gfxPlatformFontList::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
}
|
||||
|
||||
void
|
||||
gfxPlatformFontList::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
gfxPlatformFontList::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const
|
||||
{
|
||||
aSizes->mFontListSize += aMallocSizeOf(this);
|
||||
SizeOfExcludingThis(aMallocSizeOf, aSizes);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#include "nsIMemoryReporter.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
class CharMapHashKey : public PLDHashEntryHdr
|
||||
{
|
||||
@@ -161,9 +162,9 @@ public:
|
||||
// (platforms may override, eg Mac)
|
||||
virtual bool GetStandardFamilyName(const nsAString& aFontName, nsAString& aFamilyName);
|
||||
|
||||
virtual void SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
virtual void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||
virtual void SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontListSizes* aSizes) const;
|
||||
|
||||
// search for existing cmap that matches the input
|
||||
@@ -252,7 +253,7 @@ protected:
|
||||
static size_t
|
||||
SizeOfFamilyNameEntryExcludingThis(const nsAString& aKey,
|
||||
const nsRefPtr<gfxFontFamily>& aFamily,
|
||||
nsMallocSizeOfFun aMallocSizeOf,
|
||||
mozilla::MallocSizeOf aMallocSizeOf,
|
||||
void* aUserArg);
|
||||
|
||||
// canonical family name ==> family entry (unique, one name per family entry)
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "FrameBlender.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "RasterImage.h"
|
||||
#include "imgFrame.h"
|
||||
|
||||
@@ -573,7 +574,7 @@ FrameBlender::Discard()
|
||||
|
||||
size_t
|
||||
FrameBlender::SizeOfDecodedWithComputedFallbackIfHeap(gfxASurface::MemoryLocation aLocation,
|
||||
nsMallocSizeOfFun aMallocSizeOf) const
|
||||
MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = 0;
|
||||
for (uint32_t i = 0; i < mFrames.Length(); ++i) {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#define mozilla_imagelib_FrameBlender_h_
|
||||
|
||||
#include "nsTArray.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "gfxASurface.h"
|
||||
|
||||
@@ -57,7 +58,7 @@ public:
|
||||
void SetSize(nsIntSize aSize) { mSize = aSize; }
|
||||
|
||||
size_t SizeOfDecodedWithComputedFallbackIfHeap(gfxASurface::MemoryLocation aLocation,
|
||||
nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
void ResetAnimation();
|
||||
|
||||
|
||||
+3
-2
@@ -6,6 +6,7 @@
|
||||
#ifndef MOZILLA_IMAGELIB_IMAGE_H_
|
||||
#define MOZILLA_IMAGELIB_IMAGE_H_
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "imgIContainer.h"
|
||||
#include "imgStatusTracker.h"
|
||||
#include "nsIURI.h"
|
||||
@@ -78,8 +79,8 @@ public:
|
||||
/**
|
||||
* The components that make up SizeOfData().
|
||||
*/
|
||||
virtual size_t HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const = 0;
|
||||
virtual size_t HeapSizeOfDecodedWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const = 0;
|
||||
virtual size_t HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const = 0;
|
||||
virtual size_t HeapSizeOfDecodedWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const = 0;
|
||||
virtual size_t NonHeapSizeOfDecoded() const = 0;
|
||||
virtual size_t OutOfProcessSizeOfDecoded() const = 0;
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "ImageWrapper.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "Orientation.h"
|
||||
|
||||
using mozilla::layers::LayerManager;
|
||||
@@ -39,13 +41,13 @@ ImageWrapper::SizeOfData()
|
||||
}
|
||||
|
||||
size_t
|
||||
ImageWrapper::HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
ImageWrapper::HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return mInnerImage->HeapSizeOfSourceWithComputedFallback(aMallocSizeOf);
|
||||
}
|
||||
|
||||
size_t
|
||||
ImageWrapper::HeapSizeOfDecodedWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
ImageWrapper::HeapSizeOfDecodedWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return mInnerImage->HeapSizeOfDecodedWithComputedFallback(aMallocSizeOf);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#ifndef MOZILLA_IMAGELIB_IMAGEWRAPPER_H_
|
||||
#define MOZILLA_IMAGELIB_IMAGEWRAPPER_H_
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "Image.h"
|
||||
|
||||
namespace mozilla {
|
||||
@@ -29,8 +30,8 @@ public:
|
||||
virtual nsIntRect FrameRect(uint32_t aWhichFrame) MOZ_OVERRIDE;
|
||||
|
||||
virtual uint32_t SizeOfData() MOZ_OVERRIDE;
|
||||
virtual size_t HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE;
|
||||
virtual size_t HeapSizeOfDecodedWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE;
|
||||
virtual size_t HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
|
||||
virtual size_t HeapSizeOfDecodedWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
|
||||
virtual size_t NonHeapSizeOfDecoded() const MOZ_OVERRIDE;
|
||||
virtual size_t OutOfProcessSizeOfDecoded() const MOZ_OVERRIDE;
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
|
||||
#include "gfxContext.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/StandardInteger.h"
|
||||
@@ -1192,7 +1193,7 @@ RasterImage::UpdateImageContainer()
|
||||
}
|
||||
|
||||
size_t
|
||||
RasterImage::HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
RasterImage::HeapSizeOfSourceWithComputedFallback(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
// n == 0 is possible for two reasons.
|
||||
// - This is a zero-length image.
|
||||
@@ -1207,7 +1208,7 @@ RasterImage::HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeO
|
||||
|
||||
size_t
|
||||
RasterImage::SizeOfDecodedWithComputedFallbackIfHeap(gfxASurface::MemoryLocation aLocation,
|
||||
nsMallocSizeOfFun aMallocSizeOf) const
|
||||
MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
size_t n = mFrameBlender.SizeOfDecodedWithComputedFallbackIfHeap(aLocation, aMallocSizeOf);
|
||||
|
||||
@@ -1219,7 +1220,7 @@ RasterImage::SizeOfDecodedWithComputedFallbackIfHeap(gfxASurface::MemoryLocation
|
||||
}
|
||||
|
||||
size_t
|
||||
RasterImage::HeapSizeOfDecodedWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
RasterImage::HeapSizeOfDecodedWithComputedFallback(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
return SizeOfDecodedWithComputedFallbackIfHeap(gfxASurface::MEMORY_IN_PROCESS_HEAP,
|
||||
aMallocSizeOf);
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "DiscardTracker.h"
|
||||
#include "Orientation.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/LinkedList.h"
|
||||
#include "mozilla/Mutex.h"
|
||||
#include "mozilla/ReentrantMonitor.h"
|
||||
@@ -180,8 +181,8 @@ public:
|
||||
/* The total number of frames in this image. */
|
||||
uint32_t GetNumFrames() const;
|
||||
|
||||
virtual size_t HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t HeapSizeOfDecodedWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
virtual size_t HeapSizeOfDecodedWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
virtual size_t NonHeapSizeOfDecoded() const;
|
||||
virtual size_t OutOfProcessSizeOfDecoded() const;
|
||||
|
||||
@@ -594,7 +595,7 @@ private:
|
||||
mozilla::TimeStamp GetCurrentImgFrameEndTime() const;
|
||||
|
||||
size_t SizeOfDecodedWithComputedFallbackIfHeap(gfxASurface::MemoryLocation aLocation,
|
||||
nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
inline void EnsureAnimExists()
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "gfxUtils.h"
|
||||
#include "imgDecoderObserver.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/SVGSVGElement.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsIObserverService.h"
|
||||
@@ -346,7 +347,7 @@ VectorImage::FrameRect(uint32_t aWhichFrame)
|
||||
}
|
||||
|
||||
size_t
|
||||
VectorImage::HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
VectorImage::HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
// We're not storing the source data -- we just feed that directly to
|
||||
// our helper SVG document as we receive it, for it to parse.
|
||||
@@ -355,7 +356,7 @@ VectorImage::HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeO
|
||||
}
|
||||
|
||||
size_t
|
||||
VectorImage::HeapSizeOfDecodedWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
VectorImage::HeapSizeOfDecodedWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
// XXXdholbert TODO: return num bytes used by helper SVG doc. (bug 590790)
|
||||
return 0;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "Image.h"
|
||||
#include "nsIStreamListener.h"
|
||||
#include "nsIRequest.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "mozilla/WeakPtr.h"
|
||||
|
||||
@@ -43,8 +44,8 @@ public:
|
||||
uint32_t aFlags);
|
||||
virtual nsIntRect FrameRect(uint32_t aWhichFrame) MOZ_OVERRIDE;
|
||||
|
||||
virtual size_t HeapSizeOfSourceWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t HeapSizeOfDecodedWithComputedFallback(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
virtual size_t HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
virtual size_t HeapSizeOfDecodedWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
virtual size_t NonHeapSizeOfDecoded() const;
|
||||
virtual size_t OutOfProcessSizeOfDecoded() const;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ static bool gDisableOptimize = false;
|
||||
#include "GoannaProfiler.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/CheckedInt.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#if defined(XP_WIN)
|
||||
|
||||
@@ -798,7 +799,7 @@ void imgFrame::SetCompositingFailed(bool val)
|
||||
// |aMallocSizeOf|. If that fails (because the platform doesn't support it) or
|
||||
// it's non-heap memory, we fall back to computing the size analytically.
|
||||
size_t
|
||||
imgFrame::SizeOfExcludingThisWithComputedFallbackIfHeap(gfxASurface::MemoryLocation aLocation, nsMallocSizeOfFun aMallocSizeOf) const
|
||||
imgFrame::SizeOfExcludingThisWithComputedFallbackIfHeap(gfxASurface::MemoryLocation aLocation, mozilla::MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
// aMallocSizeOf is only used if aLocation==MEMORY_IN_PROCESS_HEAP. It
|
||||
// should be NULL otherwise.
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#ifndef imgFrame_h
|
||||
#define imgFrame_h
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "nsRect.h"
|
||||
#include "nsPoint.h"
|
||||
#include "nsSize.h"
|
||||
@@ -104,7 +105,7 @@ public:
|
||||
|
||||
size_t SizeOfExcludingThisWithComputedFallbackIfHeap(
|
||||
gfxASurface::MemoryLocation aLocation,
|
||||
nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
uint8_t GetPaletteDepth() const { return mPaletteDepth; }
|
||||
uint32_t PaletteDataLength() const {
|
||||
|
||||
@@ -409,7 +409,7 @@ bool Histogram::HasValidRangeChecksum() const {
|
||||
return CalculateRangeChecksum() == range_checksum_;
|
||||
}
|
||||
|
||||
size_t Histogram::SizeOfIncludingThis(size_t (*aMallocSizeOf)(const void*))
|
||||
size_t Histogram::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
||||
{
|
||||
size_t n = 0;
|
||||
n += aMallocSizeOf(this);
|
||||
@@ -420,7 +420,7 @@ size_t Histogram::SizeOfIncludingThis(size_t (*aMallocSizeOf)(const void*))
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t Histogram::SampleSet::SizeOfExcludingThis(size_t (*aMallocSizeOf)(const void*))
|
||||
size_t Histogram::SampleSet::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
||||
{
|
||||
// We're not allowed to do deep dives into STL data structures. This
|
||||
// is as close as we can get to measuring this array.
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
#define BASE_METRICS_HISTOGRAM_H_
|
||||
#pragma once
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -316,10 +318,7 @@ class Histogram {
|
||||
const char* description; // Null means end of a list of pairs.
|
||||
};
|
||||
|
||||
// To avoid depending on XPCOM headers, we define our own MallocSizeOf type.
|
||||
typedef size_t (*MallocSizeOf)(const void*);
|
||||
|
||||
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf);
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Statistic values, developed over the life of the histogram.
|
||||
@@ -357,7 +356,7 @@ class Histogram {
|
||||
bool Serialize(Pickle* pickle) const;
|
||||
bool Deserialize(void** iter, const Pickle& pickle);
|
||||
|
||||
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf);
|
||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf);
|
||||
|
||||
protected:
|
||||
// Actual histogram data is stored in buckets, showing the count of values
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/Casting.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/PodOperations.h"
|
||||
#include "mozilla/TypeTraits.h"
|
||||
#include "mozilla/Util.h"
|
||||
@@ -204,10 +205,10 @@ class HashMap
|
||||
|
||||
// Don't just call |impl.sizeOfExcludingThis()| because there's no
|
||||
// guarantee that |impl| is the first field in HashMap.
|
||||
size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const {
|
||||
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
|
||||
return impl.sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const {
|
||||
size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
|
||||
return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
|
||||
@@ -412,10 +413,10 @@ class HashSet
|
||||
|
||||
// Don't just call |impl.sizeOfExcludingThis()| because there's no
|
||||
// guarantee that |impl| is the first field in HashSet.
|
||||
size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const {
|
||||
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
|
||||
return impl.sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const {
|
||||
size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
|
||||
return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
|
||||
@@ -1340,12 +1341,12 @@ class HashTable : private AllocPolicy
|
||||
return gen;
|
||||
}
|
||||
|
||||
size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const
|
||||
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
|
||||
{
|
||||
return mallocSizeOf(table);
|
||||
}
|
||||
|
||||
size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const
|
||||
size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const
|
||||
{
|
||||
return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
// These declarations are not within jsapi.h because they are highly likely to
|
||||
// change in the future. Depend on them at your own risk.
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "jsalloc.h"
|
||||
@@ -363,7 +365,7 @@ struct CompartmentStats
|
||||
|
||||
struct RuntimeStats
|
||||
{
|
||||
RuntimeStats(JSMallocSizeOfFun mallocSizeOf)
|
||||
RuntimeStats(mozilla::MallocSizeOf mallocSizeOf)
|
||||
: runtime(),
|
||||
gcHeapChunkTotal(0),
|
||||
gcHeapDecommittedArenas(0),
|
||||
@@ -420,7 +422,7 @@ struct RuntimeStats
|
||||
|
||||
ZoneStats *currZoneStats;
|
||||
|
||||
JSMallocSizeOfFun mallocSizeOf_;
|
||||
mozilla::MallocSizeOf mallocSizeOf_;
|
||||
|
||||
virtual void initExtraCompartmentStats(JSCompartment *c, CompartmentStats *cstats) = 0;
|
||||
virtual void initExtraZoneStats(JS::Zone *zone, ZoneStats *zstats) = 0;
|
||||
|
||||
@@ -818,11 +818,6 @@ inline bool IsPoisonedPtr(T *v)
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* This is SpiderMonkey's equivalent to |nsMallocSizeOfFun|.
|
||||
*/
|
||||
typedef size_t(*JSMallocSizeOfFun)(const void *p);
|
||||
|
||||
/* sixgill annotation defines */
|
||||
#ifndef HAVE_STATIC_ANNOTATIONS
|
||||
# define HAVE_STATIC_ANNOTATIONS
|
||||
|
||||
+5
-4
@@ -8,6 +8,7 @@
|
||||
#define js_Vector_h
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/TypeTraits.h"
|
||||
|
||||
#include "TemplateLib.h"
|
||||
@@ -504,13 +505,13 @@ class Vector : private AllocPolicy
|
||||
/*
|
||||
* Measure the size of the Vector's heap-allocated storage.
|
||||
*/
|
||||
size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const;
|
||||
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
|
||||
|
||||
/*
|
||||
* Like sizeOfExcludingThis, but also measures the size of the Vector
|
||||
* object (which must be heap-allocated) itself.
|
||||
*/
|
||||
size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const;
|
||||
size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
|
||||
|
||||
void swap(Vector &other);
|
||||
};
|
||||
@@ -1070,14 +1071,14 @@ Vector<T,N,AP>::replaceRawBuffer(T *p, size_t aLength)
|
||||
|
||||
template <class T, size_t N, class AP>
|
||||
inline size_t
|
||||
Vector<T,N,AP>::sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const
|
||||
Vector<T,N,AP>::sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
|
||||
{
|
||||
return usingInlineStorage() ? 0 : mallocSizeOf(beginNoCheck());
|
||||
}
|
||||
|
||||
template <class T, size_t N, class AP>
|
||||
inline size_t
|
||||
Vector<T,N,AP>::sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const
|
||||
Vector<T,N,AP>::sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const
|
||||
{
|
||||
return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "ctypes/CTypes.h"
|
||||
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/StandardInteger.h"
|
||||
|
||||
#include <limits>
|
||||
@@ -1337,7 +1338,7 @@ JS_SetCTypesCallbacks(JSObject *ctypesObj, JSCTypesCallbacks* callbacks)
|
||||
namespace js {
|
||||
|
||||
JS_FRIEND_API(size_t)
|
||||
SizeOfDataIfCDataObject(JSMallocSizeOfFun mallocSizeOf, JSObject *obj)
|
||||
SizeOfDataIfCDataObject(mozilla::MallocSizeOf mallocSizeOf, JSObject *obj)
|
||||
{
|
||||
if (!CData::IsCData(obj))
|
||||
return 0;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/MemoryChecking.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/PodOperations.h"
|
||||
#include "mozilla/TypeTraits.h"
|
||||
|
||||
@@ -89,7 +90,7 @@ class BumpChunk
|
||||
|
||||
size_t used() const { return bump - bumpBase(); }
|
||||
|
||||
size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) {
|
||||
size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) {
|
||||
return mallocSizeOf(this);
|
||||
}
|
||||
|
||||
@@ -346,7 +347,7 @@ class LifoAlloc
|
||||
}
|
||||
|
||||
// Get the total size of the arena chunks (including unused space).
|
||||
size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const {
|
||||
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
|
||||
size_t n = 0;
|
||||
for (BumpChunk *chunk = first; chunk; chunk = chunk->next())
|
||||
n += chunk->sizeOfIncludingThis(mallocSizeOf);
|
||||
@@ -354,7 +355,7 @@ class LifoAlloc
|
||||
}
|
||||
|
||||
// Like sizeOfExcludingThis(), but includes the size of the LifoAlloc itself.
|
||||
size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const {
|
||||
size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
|
||||
return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/GuardObjects.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#include "jscntxt.h"
|
||||
@@ -260,7 +261,7 @@ struct Zone : private JS::shadow::Zone,
|
||||
|
||||
void discardJitCode(js::FreeOp *fop, bool discardConstraints);
|
||||
|
||||
void sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf, size_t *typePool);
|
||||
void sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf, size_t *typePool);
|
||||
|
||||
void setGCLastBytes(size_t lastBytes, js::JSGCInvocationKind gckind);
|
||||
void reduceGCTriggerBytes(size_t amount);
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "BaselineCompiler.h"
|
||||
#include "BaselineIC.h"
|
||||
#include "BaselineJIT.h"
|
||||
@@ -854,7 +856,7 @@ jit::IonCompartment::toggleBaselineStubBarriers(bool enabled)
|
||||
}
|
||||
|
||||
void
|
||||
jit::SizeOfBaselineData(JSScript *script, JSMallocSizeOfFun mallocSizeOf, size_t *data,
|
||||
jit::SizeOfBaselineData(JSScript *script, mozilla::MallocSizeOf mallocSizeOf, size_t *data,
|
||||
size_t *fallbackStubs)
|
||||
{
|
||||
*data = 0;
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#ifdef JS_ION
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "jscntxt.h"
|
||||
#include "jscompartment.h"
|
||||
|
||||
@@ -157,7 +159,7 @@ struct BaselineScript
|
||||
return offsetof(BaselineScript, method_);
|
||||
}
|
||||
|
||||
void sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf, size_t *data,
|
||||
void sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf, size_t *data,
|
||||
size_t *fallbackStubs) const {
|
||||
*data = mallocSizeOf(this);
|
||||
|
||||
@@ -280,7 +282,7 @@ void
|
||||
FinishDiscardBaselineScript(FreeOp *fop, JSScript *script);
|
||||
|
||||
void
|
||||
SizeOfBaselineData(JSScript *script, JSMallocSizeOfFun mallocSizeOf, size_t *data,
|
||||
SizeOfBaselineData(JSScript *script, mozilla::MallocSizeOf mallocSizeOf, size_t *data,
|
||||
size_t *fallbackStubs);
|
||||
|
||||
void
|
||||
|
||||
+3
-1
@@ -4,6 +4,8 @@
|
||||
* 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/. */
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "BaselineJIT.h"
|
||||
#include "BaselineCompiler.h"
|
||||
#include "BaselineInspector.h"
|
||||
@@ -2405,7 +2407,7 @@ jit::PurgeCaches(JSScript *script, Zone *zone)
|
||||
}
|
||||
|
||||
size_t
|
||||
jit::SizeOfIonData(JSScript *script, JSMallocSizeOfFun mallocSizeOf)
|
||||
jit::SizeOfIonData(JSScript *script, mozilla::MallocSizeOf mallocSizeOf)
|
||||
{
|
||||
size_t result = 0;
|
||||
|
||||
|
||||
+3
-1
@@ -9,6 +9,8 @@
|
||||
|
||||
#ifdef JS_ION
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "jscntxt.h"
|
||||
#include "jscompartment.h"
|
||||
#include "IonCode.h"
|
||||
@@ -349,7 +351,7 @@ void ForbidCompilation(JSContext *cx, JSScript *script, ExecutionMode mode);
|
||||
uint32_t UsesBeforeIonRecompile(JSScript *script, jsbytecode *pc);
|
||||
|
||||
void PurgeCaches(JSScript *script, JS::Zone *zone);
|
||||
size_t SizeOfIonData(JSScript *script, JSMallocSizeOfFun mallocSizeOf);
|
||||
size_t SizeOfIonData(JSScript *script, mozilla::MallocSizeOf mallocSizeOf);
|
||||
void DestroyIonScripts(FreeOp *fop, JSScript *script);
|
||||
void TraceIonScripts(JSTracer* trc, JSScript *script);
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#ifndef jit_IonCode_h
|
||||
#define jit_IonCode_h
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/PodOperations.h"
|
||||
|
||||
#include "IonTypes.h"
|
||||
@@ -435,7 +436,7 @@ struct IonScript
|
||||
size_t callTargetEntries() const {
|
||||
return callTargetEntries_;
|
||||
}
|
||||
size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const {
|
||||
size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
|
||||
return mallocSizeOf(this);
|
||||
}
|
||||
EncapsulatedValue &getConstant(size_t index) {
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#ifdef JS_ION
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "IonCode.h"
|
||||
#include "jsweakcache.h"
|
||||
#include "js/Value.h"
|
||||
@@ -80,7 +82,7 @@ struct ICStubSpace
|
||||
|
||||
JS_DECLARE_NEW_METHODS(allocate, alloc, inline)
|
||||
|
||||
size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const {
|
||||
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
|
||||
return allocator_.sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
};
|
||||
|
||||
+5
-4
@@ -10,6 +10,7 @@
|
||||
#define jsapi_h
|
||||
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/RangedPtr.h"
|
||||
#include "mozilla/StandardInteger.h"
|
||||
#include "mozilla/ThreadLocal.h"
|
||||
@@ -379,10 +380,10 @@ class AutoHashMapRooter : protected AutoGCRooter
|
||||
return map.capacity();
|
||||
}
|
||||
|
||||
size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const {
|
||||
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
|
||||
return map.sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const {
|
||||
size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
|
||||
return map.sizeOfIncludingThis(mallocSizeOf);
|
||||
}
|
||||
|
||||
@@ -494,10 +495,10 @@ class AutoHashSetRooter : protected AutoGCRooter
|
||||
return set.capacity();
|
||||
}
|
||||
|
||||
size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const {
|
||||
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
|
||||
return set.sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const {
|
||||
size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
|
||||
return set.sizeOfIncludingThis(mallocSizeOf);
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -22,6 +22,7 @@
|
||||
# include <string>
|
||||
#endif // ANDROID
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#include "jstypes.h"
|
||||
@@ -112,7 +113,7 @@ NewObjectCache::clearNurseryObjects(JSRuntime *rt)
|
||||
}
|
||||
|
||||
void
|
||||
JSRuntime::sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf, JS::RuntimeSizes *rtSizes)
|
||||
JSRuntime::sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf, JS::RuntimeSizes *rtSizes)
|
||||
{
|
||||
rtSizes->object = mallocSizeOf(this);
|
||||
|
||||
@@ -1489,7 +1490,7 @@ JSContext::updateJITEnabled()
|
||||
}
|
||||
|
||||
size_t
|
||||
JSContext::sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const
|
||||
JSContext::sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const
|
||||
{
|
||||
/*
|
||||
* There are other JSContext members that could be measured; the following
|
||||
|
||||
+3
-2
@@ -10,6 +10,7 @@
|
||||
#define jscntxt_h
|
||||
|
||||
#include "mozilla/LinkedList.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/PodOperations.h"
|
||||
|
||||
#include <string.h>
|
||||
@@ -1473,7 +1474,7 @@ struct JSRuntime : public JS::shadow::Runtime,
|
||||
return jitHardening;
|
||||
}
|
||||
|
||||
void sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf, JS::RuntimeSizes *runtime);
|
||||
void sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf, JS::RuntimeSizes *runtime);
|
||||
|
||||
private:
|
||||
|
||||
@@ -1920,7 +1921,7 @@ struct JSContext : js::ThreadSafeContext,
|
||||
*/
|
||||
bool runningWithTrustedPrincipals() const;
|
||||
|
||||
JS_FRIEND_API(size_t) sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const;
|
||||
JS_FRIEND_API(size_t) sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
|
||||
|
||||
void mark(JSTracer *trc);
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "jscompartment.h"
|
||||
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "jscntxt.h"
|
||||
#include "jsgc.h"
|
||||
@@ -827,7 +828,7 @@ JSCompartment::clearTraps(FreeOp *fop)
|
||||
}
|
||||
|
||||
void
|
||||
JSCompartment::sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf, size_t *compartmentObject,
|
||||
JSCompartment::sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf, size_t *compartmentObject,
|
||||
JS::TypeInferenceSizes *tiSizes, size_t *shapesCompartmentTables,
|
||||
size_t *crossCompartmentWrappersArg, size_t *regexpCompartment,
|
||||
size_t *debuggeesSet, size_t *baselineStubsOptimized)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#ifndef jscompartment_h
|
||||
#define jscompartment_h
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#include "jscntxt.h"
|
||||
@@ -195,10 +196,10 @@ struct JSCompartment
|
||||
js::RegExpCompartment regExps;
|
||||
|
||||
private:
|
||||
void sizeOfTypeInferenceData(JS::TypeInferenceSizes *stats, JSMallocSizeOfFun mallocSizeOf);
|
||||
void sizeOfTypeInferenceData(JS::TypeInferenceSizes *stats, mozilla::MallocSizeOf mallocSizeOf);
|
||||
|
||||
public:
|
||||
void sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf, size_t *compartmentObject,
|
||||
void sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf, size_t *compartmentObject,
|
||||
JS::TypeInferenceSizes *tiSizes,
|
||||
size_t *shapesCompartmentTables, size_t *crossCompartmentWrappers,
|
||||
size_t *regexpCompartment, size_t *debuggeesSet,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user