зеркало из https://github.com/mozilla/pjs.git
Added SizeOf() handler for space manager
This commit is contained in:
Родитель
dc46519283
Коммит
6f0d3813a7
|
@ -103,6 +103,7 @@ LAYOUT_ATOM(viewportFrame, "ViewportFrame")
|
|||
LAYOUT_ATOM(cellMap, "TableCellMap")
|
||||
LAYOUT_ATOM(imageMap, "ImageMap")
|
||||
LAYOUT_ATOM(lineBox, "LineBox")
|
||||
LAYOUT_ATOM(spaceManager, "SpaceManager")
|
||||
LAYOUT_ATOM(tableStrategy, "TableLayoutStrategy")
|
||||
LAYOUT_ATOM(textRun, "TextRun")
|
||||
#endif
|
||||
|
|
|
@ -103,6 +103,7 @@ LAYOUT_ATOM(viewportFrame, "ViewportFrame")
|
|||
LAYOUT_ATOM(cellMap, "TableCellMap")
|
||||
LAYOUT_ATOM(imageMap, "ImageMap")
|
||||
LAYOUT_ATOM(lineBox, "LineBox")
|
||||
LAYOUT_ATOM(spaceManager, "SpaceManager")
|
||||
LAYOUT_ATOM(tableStrategy, "TableLayoutStrategy")
|
||||
LAYOUT_ATOM(textRun, "TextRun")
|
||||
#endif
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
class nsIFrame;
|
||||
class nsVoidArray;
|
||||
class nsISizeOfHandler;
|
||||
struct nsSize;
|
||||
|
||||
// IID for the nsISpaceManager interface {17C8FB50-BE96-11d1-80B5-00805F8A274D}
|
||||
|
@ -187,6 +188,10 @@ public:
|
|||
* Dump the state of the spacemanager out to a file
|
||||
*/
|
||||
NS_IMETHOD List(FILE* out) = 0;
|
||||
|
||||
#ifdef DEBUG
|
||||
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const = 0;
|
||||
#endif
|
||||
};
|
||||
|
||||
inline void nsBandTrapezoid::GetRect(nsRect& aRect) const
|
||||
|
|
|
@ -103,6 +103,7 @@ LAYOUT_ATOM(viewportFrame, "ViewportFrame")
|
|||
LAYOUT_ATOM(cellMap, "TableCellMap")
|
||||
LAYOUT_ATOM(imageMap, "ImageMap")
|
||||
LAYOUT_ATOM(lineBox, "LineBox")
|
||||
LAYOUT_ATOM(spaceManager, "SpaceManager")
|
||||
LAYOUT_ATOM(tableStrategy, "TableLayoutStrategy")
|
||||
LAYOUT_ATOM(textRun, "TextRun")
|
||||
#endif
|
||||
|
|
|
@ -1196,3 +1196,34 @@ nsSpaceManager::BandRect::Length() const
|
|||
return len;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
nsSpaceManager::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
*aResult = sizeof(*this);
|
||||
|
||||
// Add in the size of the band data. Don't count the header which has
|
||||
// already been taken into account
|
||||
if (!mBandList.IsEmpty()) {
|
||||
const BandRect* bandRect = mBandList.Head();
|
||||
do {
|
||||
*aResult += sizeof(*bandRect);
|
||||
if (bandRect->mNumFrames > 1) {
|
||||
PRUint32 voidArraySize;
|
||||
|
||||
bandRect->mFrames->SizeOf(aHandler, &voidArraySize);
|
||||
*aResult += voidArraySize;
|
||||
}
|
||||
|
||||
bandRect = bandRect->Next();
|
||||
} while (bandRect != &mBandList);
|
||||
}
|
||||
|
||||
// Add in the size of the hash table
|
||||
if (mFrameInfoMap) {
|
||||
*aResult += sizeof(PLHashTable);
|
||||
*aResult += (1 << (PL_HASH_BITS - mFrameInfoMap->shift)) * sizeof(PLHashEntry*);
|
||||
*aResult += mFrameInfoMap->nentries * sizeof(PLHashEntry);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -56,6 +56,10 @@ public:
|
|||
NS_IMETHOD ClearRegions();
|
||||
NS_IMETHOD List(FILE* out);
|
||||
|
||||
#ifdef DEBUG
|
||||
void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
// Structure that maintains information about the region associated
|
||||
// with a particular frame
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "nsHTMLValue.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
#include "nsISizeOfHandler.h"
|
||||
|
||||
#undef NOISY_MAX_ELEMENT_SIZE
|
||||
#undef NOISY_SPACEMANAGER
|
||||
|
@ -545,6 +546,15 @@ nsAreaFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
|||
}
|
||||
nsBlockFrame::SizeOf(aHandler, aResult);
|
||||
*aResult += sizeof(*this) - sizeof(nsBlockFrame);
|
||||
|
||||
// Add in space taken up by the space manager
|
||||
if (mSpaceManager) {
|
||||
PRUint32 spaceManagerSize;
|
||||
|
||||
mSpaceManager->SizeOf(aHandler, &spaceManagerSize);
|
||||
aHandler->AddSize(nsLayoutAtoms::spaceManager, spaceManagerSize);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1196,3 +1196,34 @@ nsSpaceManager::BandRect::Length() const
|
|||
return len;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
nsSpaceManager::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
||||
{
|
||||
*aResult = sizeof(*this);
|
||||
|
||||
// Add in the size of the band data. Don't count the header which has
|
||||
// already been taken into account
|
||||
if (!mBandList.IsEmpty()) {
|
||||
const BandRect* bandRect = mBandList.Head();
|
||||
do {
|
||||
*aResult += sizeof(*bandRect);
|
||||
if (bandRect->mNumFrames > 1) {
|
||||
PRUint32 voidArraySize;
|
||||
|
||||
bandRect->mFrames->SizeOf(aHandler, &voidArraySize);
|
||||
*aResult += voidArraySize;
|
||||
}
|
||||
|
||||
bandRect = bandRect->Next();
|
||||
} while (bandRect != &mBandList);
|
||||
}
|
||||
|
||||
// Add in the size of the hash table
|
||||
if (mFrameInfoMap) {
|
||||
*aResult += sizeof(PLHashTable);
|
||||
*aResult += (1 << (PL_HASH_BITS - mFrameInfoMap->shift)) * sizeof(PLHashEntry*);
|
||||
*aResult += mFrameInfoMap->nentries * sizeof(PLHashEntry);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -56,6 +56,10 @@ public:
|
|||
NS_IMETHOD ClearRegions();
|
||||
NS_IMETHOD List(FILE* out);
|
||||
|
||||
#ifdef DEBUG
|
||||
void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
// Structure that maintains information about the region associated
|
||||
// with a particular frame
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "nsHTMLValue.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
#include "nsISizeOfHandler.h"
|
||||
|
||||
#undef NOISY_MAX_ELEMENT_SIZE
|
||||
#undef NOISY_SPACEMANAGER
|
||||
|
@ -545,6 +546,15 @@ nsAreaFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
|
|||
}
|
||||
nsBlockFrame::SizeOf(aHandler, aResult);
|
||||
*aResult += sizeof(*this) - sizeof(nsBlockFrame);
|
||||
|
||||
// Add in space taken up by the space manager
|
||||
if (mSpaceManager) {
|
||||
PRUint32 spaceManagerSize;
|
||||
|
||||
mSpaceManager->SizeOf(aHandler, &spaceManagerSize);
|
||||
aHandler->AddSize(nsLayoutAtoms::spaceManager, spaceManagerSize);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче