diff --git a/mozilla/layout/base/nsDisplayList.cpp b/mozilla/layout/base/nsDisplayList.cpp index cc93c26d407..4e4a64c8f60 100644 --- a/mozilla/layout/base/nsDisplayList.cpp +++ b/mozilla/layout/base/nsDisplayList.cpp @@ -123,7 +123,7 @@ nsDisplayList::FlattenTo(nsVoidArray* aElements) { while ((item = RemoveBottom()) != nsnull) { if (item->GetType() == nsDisplayItem::TYPE_WRAPLIST) { item->GetList()->FlattenTo(aElements); - item->nsDisplayItem::~nsDisplayItem(); + item->~nsDisplayItem(); } else { aElements->AppendElement(item); } @@ -142,7 +142,7 @@ nsDisplayList::OptimizeVisibility(nsDisplayListBuilder* aBuilder, NS_STATIC_CAST(nsDisplayItem*, elements.ElementAt(i - 1)); if (belowItem && item->TryMerge(aBuilder, belowItem)) { - belowItem->nsDisplayItem::~nsDisplayItem(); + belowItem->~nsDisplayItem(); elements.ReplaceElementAt(item, i - 1); continue; } @@ -150,7 +150,7 @@ nsDisplayList::OptimizeVisibility(nsDisplayListBuilder* aBuilder, if (item->OptimizeVisibility(aBuilder, aVisibleRegion)) { AppendToBottom(item); } else { - item->nsDisplayItem::~nsDisplayItem(); + item->~nsDisplayItem(); } } } @@ -186,14 +186,14 @@ nsDisplayItem* nsDisplayList::RemoveBottom() { void nsDisplayList::DeleteBottom() { nsDisplayItem* item = RemoveBottom(); if (item) { - item->nsDisplayItem::~nsDisplayItem(); + item->~nsDisplayItem(); } } void nsDisplayList::DeleteAll() { nsDisplayItem* item; while ((item = RemoveBottom()) != nsnull) { - item->nsDisplayItem::~nsDisplayItem(); + item->~nsDisplayItem(); } } @@ -307,7 +307,7 @@ void nsDisplayList::ExplodeAnonymousChildLists(nsDisplayListBuilder* aBuilder) { tmp.AppendToTop(NS_STATIC_CAST(nsDisplayWrapList*, i)-> WrapWithClone(aBuilder, j)); } - i->nsDisplayItem::~nsDisplayItem(); + i->~nsDisplayItem(); } } @@ -587,10 +587,19 @@ nsresult nsDisplayWrapper::WrapListsInPlace(nsDisplayListBuilder* aBuilder, return WrapEachDisplayItem(aBuilder, aLists.Outlines(), this); } +MOZ_DECL_CTOR_COUNTER(nsDisplayOpacity) + nsDisplayOpacity::nsDisplayOpacity(nsIFrame* aFrame, nsDisplayList* aList) : nsDisplayWrapList(aFrame, aList), mNeedAlpha(PR_TRUE) { + MOZ_COUNT_CTOR(nsDisplayOpacity); } +#ifdef NS_BUILD_REFCNT_LOGGING +nsDisplayOpacity::~nsDisplayOpacity() { + MOZ_COUNT_DTOR(nsDisplayOpacity); +} +#endif + PRBool nsDisplayOpacity::IsOpaque(nsDisplayListBuilder* aBuilder) { // We are never opaque, if our opacity was < 1 then we wouldn't have // been created. @@ -668,14 +677,18 @@ PRBool nsDisplayOpacity::TryMerge(nsDisplayListBuilder* aBuilder, nsDisplayItem* return PR_TRUE; } +MOZ_DECL_CTOR_COUNTER(nsDisplayClip) + nsDisplayClip::nsDisplayClip(nsIFrame* aFrame, nsDisplayItem* aItem, const nsRect& aRect) : nsDisplayWrapList(aFrame, aItem), mClip(aRect) { + MOZ_COUNT_CTOR(nsDisplayClip); } nsDisplayClip::nsDisplayClip(nsIFrame* aFrame, nsDisplayList* aList, const nsRect& aRect) : nsDisplayWrapList(aFrame, aList), mClip(aRect) { + MOZ_COUNT_CTOR(nsDisplayClip); } nsRect nsDisplayClip::GetBounds(nsDisplayListBuilder* aBuilder) { @@ -684,6 +697,12 @@ nsRect nsDisplayClip::GetBounds(nsDisplayListBuilder* aBuilder) { return r; } +#ifdef NS_BUILD_REFCNT_LOGGING +nsDisplayClip::~nsDisplayClip() { + MOZ_COUNT_DTOR(nsDisplayClip); +} +#endif + void nsDisplayClip::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect) { nsRect dirty; diff --git a/mozilla/layout/base/nsDisplayList.h b/mozilla/layout/base/nsDisplayList.h index 01efeca3329..41a32623d39 100644 --- a/mozilla/layout/base/nsDisplayList.h +++ b/mozilla/layout/base/nsDisplayList.h @@ -217,6 +217,10 @@ public: }; private: + // This class is only used on stack, so we don't have to worry about leaking + // it. Don't let us be heap-allocated! + void* operator new(size_t sz) CPP_THROW_NEW; + nsIFrame* mReferenceFrame; nsIFrame* mMovingFrame; nsIFrame* mIgnoreScrollFrame; @@ -235,7 +239,10 @@ class nsDisplayList; * highest in z-order. */ class nsDisplayItemLink { + // This is never instantiated directly, so no need to count constructors and + // destructors. protected: + nsDisplayItemLink() {} nsDisplayItem* mAbove; friend class nsDisplayList; @@ -258,9 +265,12 @@ protected: */ class nsDisplayItem : public nsDisplayItemLink { public: + // This is never instantiated directly (it has pure virtual methods), so no + // need to count constructors and destructors. virtual ~nsDisplayItem() {} - void* operator new(size_t aSize, nsDisplayListBuilder* aBuilder) { + void* operator new(size_t aSize, + nsDisplayListBuilder* aBuilder) CPP_THROW_NEW { return aBuilder->Allocate(aSize); } @@ -546,6 +556,10 @@ public: nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt) const; private: + // This class is only used on stack, so we don't have to worry about leaking + // it. Don't let us be heap-allocated! + void* operator new(size_t sz) CPP_THROW_NEW; + // Utility function used to massage the list during OptimizeVisibility. void FlattenTo(nsVoidArray* aElements); // Utility function used to massage the list during sorting, to rewrite @@ -629,7 +643,12 @@ public: * destination. */ void MoveTo(const nsDisplayListSet& aDestination) const; - + +private: + // This class is only used on stack, so we don't have to worry about leaking + // it. Don't let us be heap-allocated! + void* operator new(size_t sz) CPP_THROW_NEW; + protected: nsDisplayList* mBorderBackground; nsDisplayList* mBlockBorderBackgrounds; @@ -661,6 +680,10 @@ struct nsDisplayListCollection : public nsDisplayListSet { } private: + // This class is only used on stack, so we don't have to worry about leaking + // it. Don't let us be heap-allocated! + void* operator new(size_t sz) CPP_THROW_NEW; + nsDisplayList mLists[6]; }; @@ -674,17 +697,26 @@ private: * custom display item class could be, and fractionally slower. However it does * save code size. We use this for infrequently-used item types. */ +MOZ_DECL_CTOR_COUNTER(nsDisplayGeneric) class nsDisplayGeneric : public nsDisplayItem { public: typedef void (* PaintCallback)(nsIFrame* aFrame, nsIRenderingContext* aCtx, const nsRect& aDirtyRect, nsPoint aFramePt); - nsDisplayGeneric(nsIFrame* aFrame, PaintCallback aPaint, const char* aName) + nsDisplayGeneric(nsIFrame* aFrame, PaintCallback aPaint, const char* aName) : mFrame(aFrame), mPaint(aPaint) #ifdef DEBUG , mName(aName) #endif - {} + { + MOZ_COUNT_CTOR(nsDisplayGeneric); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayGeneric() { + MOZ_COUNT_DTOR(nsDisplayGeneric); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect) { @@ -702,9 +734,18 @@ protected: /** * The standard display item to paint the CSS borders of a frame. */ +MOZ_DECL_CTOR_COUNTER(nsDisplayBorder) class nsDisplayBorder : public nsDisplayItem { public: - nsDisplayBorder(nsIFrame* aFrame) : mFrame(aFrame) {} + nsDisplayBorder(nsIFrame* aFrame) : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayBorder); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayBorder() { + MOZ_COUNT_DTOR(nsDisplayBorder); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); @@ -716,9 +757,18 @@ private: /** * The standard display item to paint the CSS background of a frame. */ +MOZ_DECL_CTOR_COUNTER(nsDisplayBackground) class nsDisplayBackground : public nsDisplayItem { public: - nsDisplayBackground(nsIFrame* aFrame) : mFrame(aFrame) {} + nsDisplayBackground(nsIFrame* aFrame) : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayBackground); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayBackground() { + MOZ_COUNT_DTOR(nsDisplayBackground); + } +#endif + virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt) { return mFrame; } virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual PRBool IsOpaque(nsDisplayListBuilder* aBuilder); @@ -735,9 +785,18 @@ private: /** * The standard display item to paint the CSS outline of a frame. */ +MOZ_DECL_CTOR_COUNTER(nsDisplayOutline) class nsDisplayOutline : public nsDisplayItem { public: - nsDisplayOutline(nsIFrame* aFrame) : mFrame(aFrame) {} + nsDisplayOutline(nsIFrame* aFrame) : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayOutline); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayOutline() { + MOZ_COUNT_DTOR(nsDisplayOutline); + } +#endif + virtual Type GetType() { return TYPE_OUTLINE; } virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder); @@ -751,9 +810,18 @@ private: /** * A class that lets you receive events within the frame bounds but never paints. */ +MOZ_DECL_CTOR_COUNTER(nsDisplayEventReceiver) class nsDisplayEventReceiver : public nsDisplayItem { public: - nsDisplayEventReceiver(nsIFrame* aFrame) : mFrame(aFrame) {} + nsDisplayEventReceiver(nsIFrame* aFrame) : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayEventReceiver); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayEventReceiver() { + MOZ_COUNT_DTOR(nsDisplayEventReceiver); + } +#endif + virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt) { return mFrame; } virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } NS_DISPLAY_DECL_NAME("EventReceiver") @@ -776,6 +844,9 @@ private: * detect and handle this case. */ class nsDisplayWrapList : public nsDisplayItem { + // This is never instantiated directly, so no need to count constructors and + // destructors. + public: /** * Takes all the items from aList and puts them in our list. @@ -816,6 +887,8 @@ public: } protected: + nsDisplayWrapList() {} + nsDisplayList mList; nsIFrame* mFrame; }; @@ -829,6 +902,9 @@ protected: */ class nsDisplayWrapper { public: + // This is never instantiated directly (it has pure virtual methods), so no + // need to count constructors and destructors. + virtual PRBool WrapBorderBackground() { return PR_TRUE; } virtual nsDisplayItem* WrapList(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, nsDisplayList* aList) = 0; @@ -839,15 +915,22 @@ public: const nsDisplayListSet& aIn, const nsDisplayListSet& aOut); nsresult WrapListsInPlace(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, const nsDisplayListSet& aLists); +protected: + nsDisplayWrapper() {} }; /** * The standard display item to paint a stacking context with translucency * set by the stacking context root frame's 'opacity' style. */ +MOZ_DECL_CTOR_COUNTER(nsDisplayOpacity) class nsDisplayOpacity : public nsDisplayWrapList { public: nsDisplayOpacity(nsIFrame* aFrame, nsDisplayList* aList); +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayOpacity(); +#endif + virtual Type GetType() { return TYPE_OPACITY; } virtual PRBool IsOpaque(nsDisplayListBuilder* aBuilder); virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, @@ -875,6 +958,10 @@ class nsDisplayClip : public nsDisplayWrapList { public: nsDisplayClip(nsIFrame* aFrame, nsDisplayItem* aItem, const nsRect& aRect); nsDisplayClip(nsIFrame* aFrame, nsDisplayList* aList, const nsRect& aRect); +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayClip(); +#endif + virtual Type GetType() { return TYPE_CLIP; } virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder); virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, diff --git a/mozilla/layout/forms/nsButtonFrameRenderer.cpp b/mozilla/layout/forms/nsButtonFrameRenderer.cpp index c49536eea76..a6f64e4fb64 100644 --- a/mozilla/layout/forms/nsButtonFrameRenderer.cpp +++ b/mozilla/layout/forms/nsButtonFrameRenderer.cpp @@ -93,9 +93,19 @@ nsButtonFrameRenderer::isDisabled() nsHTMLAtoms::disabled); } +MOZ_DECL_CTOR_COUNTER(nsDisplayButtonBorderBackground) class nsDisplayButtonBorderBackground : public nsDisplayItem { public: - nsDisplayButtonBorderBackground(nsButtonFrameRenderer* aRenderer) : mBFR(aRenderer) {} + nsDisplayButtonBorderBackground(nsButtonFrameRenderer* aRenderer) + : mBFR(aRenderer) { + MOZ_COUNT_CTOR(nsDisplayButtonBorderBackground); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayButtonBorderBackground() { + MOZ_COUNT_DTOR(nsDisplayButtonBorderBackground); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mBFR->GetFrame(); } virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt) { return mBFR->GetFrame(); @@ -107,9 +117,19 @@ private: nsButtonFrameRenderer* mBFR; }; +MOZ_DECL_CTOR_COUNTER(nsDisplayButtonForeground) class nsDisplayButtonForeground : public nsDisplayItem { public: - nsDisplayButtonForeground(nsButtonFrameRenderer* aRenderer) : mBFR(aRenderer) {} + nsDisplayButtonForeground(nsButtonFrameRenderer* aRenderer) + : mBFR(aRenderer) { + MOZ_COUNT_CTOR(nsDisplayButtonForeground); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayButtonForeground() { + MOZ_COUNT_DTOR(nsDisplayButtonForeground); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mBFR->GetFrame(); } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); @@ -118,8 +138,9 @@ private: nsButtonFrameRenderer* mBFR; }; -void nsDisplayButtonBorderBackground::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, - const nsRect& aDirtyRect) +void nsDisplayButtonBorderBackground::Paint(nsDisplayListBuilder* aBuilder, + nsIRenderingContext* aCtx, + const nsRect& aDirtyRect) { nsIFrame* f = mBFR->GetFrame(); NS_ASSERTION(f, "No frame?"); @@ -130,8 +151,9 @@ void nsDisplayButtonBorderBackground::Paint(nsDisplayListBuilder* aBuilder, nsIR mBFR->PaintBorderAndBackground(pc, *aCtx, aDirtyRect, r); } -void nsDisplayButtonForeground::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, - const nsRect& aDirtyRect) +void nsDisplayButtonForeground::Paint(nsDisplayListBuilder* aBuilder, + nsIRenderingContext* aCtx, + const nsRect& aDirtyRect) { nsIFrame* f = mBFR->GetFrame(); NS_ASSERTION(f, "No frame?"); diff --git a/mozilla/layout/forms/nsComboboxControlFrame.cpp b/mozilla/layout/forms/nsComboboxControlFrame.cpp index e0f439c6471..d3d892e4545 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.cpp +++ b/mozilla/layout/forms/nsComboboxControlFrame.cpp @@ -2124,9 +2124,19 @@ nsComboboxControlFrame::UpdateRecentIndex(PRInt32 aIndex) return index; } +MOZ_DECL_CTOR_COUNTER(nsDisplayComboboxFocus) class nsDisplayComboboxFocus : public nsDisplayItem { public: - nsDisplayComboboxFocus(nsComboboxControlFrame* aFrame) : mFrame(aFrame) {} + nsDisplayComboboxFocus(nsComboboxControlFrame* aFrame) + : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayComboboxFocus); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayComboboxFocus() { + MOZ_COUNT_DTOR(nsDisplayComboboxFocus); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); diff --git a/mozilla/layout/forms/nsFieldSetFrame.cpp b/mozilla/layout/forms/nsFieldSetFrame.cpp index 9b26be1c215..bb3b333f4e4 100644 --- a/mozilla/layout/forms/nsFieldSetFrame.cpp +++ b/mozilla/layout/forms/nsFieldSetFrame.cpp @@ -163,9 +163,19 @@ nsFieldSetFrame::SetInitialChildList(nsPresContext* aPresContext, return nsHTMLContainerFrame::SetInitialChildList(aPresContext, nsnull, aChildList); } +MOZ_DECL_CTOR_COUNTER(nsDisplayFieldSetBorderBackground) class nsDisplayFieldSetBorderBackground : public nsDisplayItem { public: - nsDisplayFieldSetBorderBackground(nsFieldSetFrame* aFrame) : mFrame(aFrame) {} + nsDisplayFieldSetBorderBackground(nsFieldSetFrame* aFrame) + : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayFieldSetBorderBackground); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayFieldSetBorderBackground() { + MOZ_COUNT_DTOR(nsDisplayFieldSetBorderBackground); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt); virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, diff --git a/mozilla/layout/forms/nsGfxCheckboxControlFrame.cpp b/mozilla/layout/forms/nsGfxCheckboxControlFrame.cpp index 5e35f4cadda..8c660af5556 100644 --- a/mozilla/layout/forms/nsGfxCheckboxControlFrame.cpp +++ b/mozilla/layout/forms/nsGfxCheckboxControlFrame.cpp @@ -167,9 +167,19 @@ static void PaintCheckMarkFromStyle(nsIFrame* aFrame, ->PaintCheckBoxFromStyle(*aCtx, aPt, aDirtyRect); } +MOZ_DECL_CTOR_COUNTER(nsDisplayCheckMark) class nsDisplayCheckMark : public nsDisplayItem { public: - nsDisplayCheckMark(nsGfxCheckboxControlFrame* aFrame) : mFrame(aFrame) {} + nsDisplayCheckMark(nsGfxCheckboxControlFrame* aFrame) + : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayCheckMark); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayCheckMark() { + MOZ_COUNT_DTOR(nsDisplayCheckMark); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); diff --git a/mozilla/layout/forms/nsGfxRadioControlFrame.cpp b/mozilla/layout/forms/nsGfxRadioControlFrame.cpp index 87b869feebf..8cbbbe1e8cb 100644 --- a/mozilla/layout/forms/nsGfxRadioControlFrame.cpp +++ b/mozilla/layout/forms/nsGfxRadioControlFrame.cpp @@ -189,9 +189,19 @@ nsGfxRadioControlFrame::PaintRadioButtonFromStyle( aDirtyRect, rect, *myBorder, mRadioButtonFaceStyle, 0); } +MOZ_DECL_CTOR_COUNTER(nsDisplayRadioButtonFromStyle) class nsDisplayRadioButtonFromStyle : public nsDisplayItem { public: - nsDisplayRadioButtonFromStyle(nsGfxRadioControlFrame* aFrame) : mFrame(aFrame) {} + nsDisplayRadioButtonFromStyle(nsGfxRadioControlFrame* aFrame) + : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayRadioButtonFromStyle); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayRadioButtonFromStyle() { + MOZ_COUNT_DTOR(nsDisplayRadioButtonFromStyle); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); diff --git a/mozilla/layout/generic/nsBulletFrame.cpp b/mozilla/layout/generic/nsBulletFrame.cpp index 0a74e8712b9..25ab670c1ab 100644 --- a/mozilla/layout/generic/nsBulletFrame.cpp +++ b/mozilla/layout/generic/nsBulletFrame.cpp @@ -174,9 +174,18 @@ nsBulletFrame::DidSetStyleContext(nsPresContext* aPresContext) return NS_OK; } +MOZ_DECL_CTOR_COUNTER(nsDisplayBullet) class nsDisplayBullet : public nsDisplayItem { public: - nsDisplayBullet(nsBulletFrame* aFrame) : mFrame(aFrame) {} + nsDisplayBullet(nsBulletFrame* aFrame) : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayBullet); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayBullet() { + MOZ_COUNT_DTOR(nsDisplayBullet); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index 26f76aa0801..28a5bbea4b3 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -763,10 +763,19 @@ nsFrame::DisplaySelection(nsPresContext* aPresContext, PRBool isOkToTurnOn) return selType; } +MOZ_DECL_CTOR_COUNTER(nsDisplaySelectionOverlay) class nsDisplaySelectionOverlay : public nsDisplayItem { public: nsDisplaySelectionOverlay(nsFrame* aFrame, PRInt16 aSelectionValue) - : mFrame(aFrame), mSelectionValue(aSelectionValue) {} + : mFrame(aFrame), mSelectionValue(aSelectionValue) { + MOZ_COUNT_CTOR(nsDisplaySelectionOverlay); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplaySelectionOverlay() { + MOZ_COUNT_DTOR(nsDisplaySelectionOverlay); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); diff --git a/mozilla/layout/generic/nsFrameSetFrame.cpp b/mozilla/layout/generic/nsFrameSetFrame.cpp index 72b557abdd7..4bf6049599d 100644 --- a/mozilla/layout/generic/nsFrameSetFrame.cpp +++ b/mozilla/layout/generic/nsFrameSetFrame.cpp @@ -1618,9 +1618,18 @@ nsHTMLFramesetBorderFrame::Reflow(nsPresContext* aPresContext, return NS_OK; } +MOZ_DECL_CTOR_COUNTER(nsDisplayFramesetBorder) class nsDisplayFramesetBorder : public nsDisplayItem { public: - nsDisplayFramesetBorder(nsHTMLFramesetBorderFrame* aFrame) : mFrame(aFrame) {} + nsDisplayFramesetBorder(nsHTMLFramesetBorderFrame* aFrame) : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayFramesetBorder); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayFramesetBorder() { + MOZ_COUNT_DTOR(nsDisplayFramesetBorder); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } // REVIEW: see old GetFrameForPoint // Receives events in its bounds @@ -1812,9 +1821,18 @@ nsHTMLFramesetBlankFrame::Reflow(nsPresContext* aPresContext, return NS_OK; } +MOZ_DECL_CTOR_COUNTER(nsDisplayFramesetBlank) class nsDisplayFramesetBlank : public nsDisplayItem { public: - nsDisplayFramesetBlank(nsIFrame* aFrame) : mFrame(aFrame) {} + nsDisplayFramesetBlank(nsIFrame* aFrame) : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayFramesetBlank); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayFramesetBlank() { + MOZ_COUNT_DTOR(nsDisplayFramesetBlank); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); diff --git a/mozilla/layout/generic/nsHTMLContainerFrame.cpp b/mozilla/layout/generic/nsHTMLContainerFrame.cpp index 09face68511..ca0ddcccbeb 100644 --- a/mozilla/layout/generic/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/generic/nsHTMLContainerFrame.cpp @@ -66,11 +66,20 @@ #include "nsLineBox.h" #include "nsDisplayList.h" +MOZ_DECL_CTOR_COUNTER(nsDisplayTextDecoration) class nsDisplayTextDecoration : public nsDisplayItem { public: nsDisplayTextDecoration(nsHTMLContainerFrame* aFrame, PRUint8 aDecoration, nscolor aColor, nsLineBox* aLine) - : mFrame(aFrame), mLine(aLine), mColor(aColor), mDecoration(aDecoration) {} + : mFrame(aFrame), mLine(aLine), mColor(aColor), mDecoration(aDecoration) { + MOZ_COUNT_CTOR(nsDisplayTextDecoration); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayTextDecoration() { + MOZ_COUNT_DTOR(nsDisplayTextDecoration); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); diff --git a/mozilla/layout/generic/nsImageFrame.cpp b/mozilla/layout/generic/nsImageFrame.cpp index b421639ba9f..e868d6bdddc 100644 --- a/mozilla/layout/generic/nsImageFrame.cpp +++ b/mozilla/layout/generic/nsImageFrame.cpp @@ -1259,10 +1259,16 @@ static void PaintDebugImageMap(nsIFrame* aFrame, nsIRenderingContext* aCtx, * image itself, and hence receive events just as if the image itself * received events. */ +MOZ_DECL_CTOR_COUNTER(nsDisplayImage) class nsDisplayImage : public nsDisplayItem { public: nsDisplayImage(nsImageFrame* aFrame, imgIContainer* aImage) - : mFrame(aFrame), mImage(aImage) {} + : mFrame(aFrame), mImage(aImage) { + MOZ_COUNT_CTOR(nsDisplayImage); + } + virtual ~nsDisplayImage() { + MOZ_COUNT_DTOR(nsDisplayImage); + } virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index 0766f6b0f8d..87367e240eb 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -1869,9 +1869,18 @@ nsTextFrame::CharacterDataChanged(nsPresContext* aPresContext, // When we fix nsTextFrame to handle bearing (character glyphs that // extend outside the frame) by giving it overflow area, we'll need to fix // this to use the overflow area as its bounds. +MOZ_DECL_CTOR_COUNTER(nsDisplayText) class nsDisplayText : public nsDisplayItem { public: - nsDisplayText(nsTextFrame* aFrame) : mFrame(aFrame) {} + nsDisplayText(nsTextFrame* aFrame) : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayText); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayText() { + MOZ_COUNT_DTOR(nsDisplayText); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt) { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, diff --git a/mozilla/layout/mathml/base/src/nsMathMLChar.cpp b/mozilla/layout/mathml/base/src/nsMathMLChar.cpp index ecae4d2cf04..cf13371d68a 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLChar.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLChar.cpp @@ -1938,10 +1938,19 @@ nsMathMLChar::ComposeChildren(nsPresContext* aPresContext, return NS_OK; } +MOZ_DECL_CTOR_COUNTER(nsDisplayMathMLSelectionRect) class nsDisplayMathMLSelectionRect : public nsDisplayItem { public: nsDisplayMathMLSelectionRect(nsIFrame* aFrame, const nsRect& aRect) - : mFrame(aFrame), mRect(aRect) {} + : mFrame(aFrame), mRect(aRect) { + MOZ_COUNT_CTOR(nsDisplayMathMLSelectionRect); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayMathMLSelectionRect() { + MOZ_COUNT_DTOR(nsDisplayMathMLSelectionRect); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); @@ -1962,11 +1971,20 @@ void nsDisplayMathMLSelectionRect::Paint(nsDisplayListBuilder* aBuilder, aCtx->FillRect(mRect + aBuilder->ToReferenceFrame(mFrame)); } +MOZ_DECL_CTOR_COUNTER(nsDisplayMathMLCharBackground) class nsDisplayMathMLCharBackground : public nsDisplayItem { public: nsDisplayMathMLCharBackground(nsIFrame* aFrame, const nsRect& aRect, nsStyleContext* aStyleContext) - : mFrame(aFrame), mStyleContext(aStyleContext), mRect(aRect) {} + : mFrame(aFrame), mStyleContext(aStyleContext), mRect(aRect) { + MOZ_COUNT_CTOR(nsDisplayMathMLCharBackground); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayMathMLCharBackground() { + MOZ_COUNT_DTOR(nsDisplayMathMLCharBackground); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); @@ -1990,10 +2008,20 @@ void nsDisplayMathMLCharBackground::Paint(nsDisplayListBuilder* aBuilder, PR_TRUE); } +MOZ_DECL_CTOR_COUNTER(nsDisplayMathMLCharForeground) class nsDisplayMathMLCharForeground : public nsDisplayItem { public: - nsDisplayMathMLCharForeground(nsIFrame* aFrame, nsMathMLChar* aChar, PRBool aIsSelected) - : mFrame(aFrame), mChar(aChar), mIsSelected(aIsSelected) {} + nsDisplayMathMLCharForeground(nsIFrame* aFrame, nsMathMLChar* aChar, + PRBool aIsSelected) + : mFrame(aFrame), mChar(aChar), mIsSelected(aIsSelected) { + MOZ_COUNT_CTOR(nsDisplayMathMLCharForeground); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayMathMLCharForeground() { + MOZ_COUNT_DTOR(nsDisplayMathMLCharForeground); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); @@ -2012,10 +2040,19 @@ void nsDisplayMathMLCharForeground::Paint(nsDisplayListBuilder* aBuilder, } #ifdef NS_DEBUG +MOZ_DECL_CTOR_COUNTER(nsDisplayMathMLCharDebug) class nsDisplayMathMLCharDebug : public nsDisplayItem { public: nsDisplayMathMLCharDebug(nsIFrame* aFrame, const nsRect& aRect) - : mFrame(aFrame), mRect(aRect) {} + : mFrame(aFrame), mRect(aRect) { + MOZ_COUNT_CTOR(nsDisplayMathMLCharDebug); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayMathMLCharDebug() { + MOZ_COUNT_DTOR(nsDisplayMathMLCharDebug); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); diff --git a/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp index 62fedc8480e..16b3e8f6e69 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp @@ -126,10 +126,19 @@ nsMathMLContainerFrame::ReflowError(nsIRenderingContext& aRenderingContext, return NS_OK; } +MOZ_DECL_CTOR_COUNTER(nsDisplayMathMLError) class nsDisplayMathMLError : public nsDisplayItem { public: nsDisplayMathMLError(nsIFrame* aFrame) - : mFrame(aFrame) {} + : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayMathMLError); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayMathMLError() { + MOZ_COUNT_DTOR(nsDisplayMathMLError); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); diff --git a/mozilla/layout/mathml/base/src/nsMathMLFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLFrame.cpp index 1e3f2106735..f6a3072d310 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLFrame.cpp @@ -728,10 +728,19 @@ nsMathMLFrame::MapAttributesIntoCSS(nsPresContext* aPresContext, } #if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX) +MOZ_DECL_CTOR_COUNTER(nsDisplayMathMLBoundingMetrics) class nsDisplayMathMLBoundingMetrics : public nsDisplayItem { public: nsDisplayMathMLBoundingMetrics(nsIFrame* aFrame, const nsRect& aRect) - : mFrame(aFrame), mRect(aRect) {} + : mFrame(aFrame), mRect(aRect) { + MOZ_COUNT_CTOR(nsDisplayMathMLBoundingMetrics); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayMathMLBoundingMetrics() { + MOZ_COUNT_DTOR(nsDisplayMathMLBoundingMetrics); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); @@ -766,10 +775,19 @@ nsMathMLFrame::DisplayBoundingMetrics(nsDisplayListBuilder* aBuilder, } #endif +MOZ_DECL_CTOR_COUNTER(nsDisplayMathMLBar) class nsDisplayMathMLBar : public nsDisplayItem { public: nsDisplayMathMLBar(nsIFrame* aFrame, const nsRect& aRect) - : mFrame(aFrame), mRect(aRect) {} + : mFrame(aFrame), mRect(aRect) { + MOZ_COUNT_CTOR(nsDisplayMathMLBar); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayMathMLBar() { + MOZ_COUNT_DTOR(nsDisplayMathMLBar); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); diff --git a/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp b/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp index 2892f571388..1fbeba631d3 100644 --- a/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp @@ -679,9 +679,18 @@ nsSVGOuterSVGFrame::AttributeChanged(PRInt32 aNameSpaceID, return NS_OK; } +MOZ_DECL_CTOR_COUNTER(nsDisplaySVG) class nsDisplaySVG : public nsDisplayItem { public: - nsDisplaySVG(nsSVGOuterSVGFrame* aFrame) : mFrame(aFrame) {} + nsDisplaySVG(nsSVGOuterSVGFrame* aFrame) : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplaySVG); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplaySVG() { + MOZ_COUNT_DTOR(nsDisplaySVG); + } +#endif + virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt); virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, diff --git a/mozilla/layout/tables/nsTableCellFrame.cpp b/mozilla/layout/tables/nsTableCellFrame.cpp index 04675ac9a71..f700eb2fe12 100644 --- a/mozilla/layout/tables/nsTableCellFrame.cpp +++ b/mozilla/layout/tables/nsTableCellFrame.cpp @@ -358,9 +358,18 @@ nsTableCellFrame::PaintCellBackground(nsIRenderingContext& aRenderingContext, PaintBackground(aRenderingContext, aDirtyRect, aPt); } +MOZ_DECL_CTOR_COUNTER(nsDisplayTableCellBackground) class nsDisplayTableCellBackground : public nsDisplayItem { public: - nsDisplayTableCellBackground(nsTableCellFrame* aFrame) : mFrame(aFrame) {} + nsDisplayTableCellBackground(nsTableCellFrame* aFrame) : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayTableCellBackground); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayTableCellBackground() { + MOZ_COUNT_DTOR(nsDisplayTableCellBackground); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt) { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index 08d7a88fbb1..8057ec82156 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -1343,9 +1343,18 @@ nsTableFrame::GetAdditionalChildListName(PRInt32 aIndex) const return nsnull; } +MOZ_DECL_CTOR_COUNTER(nsDisplayTableBorderBackground) class nsDisplayTableBorderBackground : public nsDisplayItem { public: - nsDisplayTableBorderBackground(nsTableFrame* aFrame) : mFrame(aFrame) {} + nsDisplayTableBorderBackground(nsTableFrame* aFrame) : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayTableBorderBackground); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayTableBorderBackground() { + MOZ_COUNT_DTOR(nsDisplayTableBorderBackground); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); diff --git a/mozilla/layout/tables/nsTableRowFrame.cpp b/mozilla/layout/tables/nsTableRowFrame.cpp index 5f5924ff36e..fe284b6b915 100644 --- a/mozilla/layout/tables/nsTableRowFrame.cpp +++ b/mozilla/layout/tables/nsTableRowFrame.cpp @@ -560,9 +560,18 @@ nsTableRowFrame::CalcHeight(const nsHTMLReflowState& aReflowState) * Table row backgrounds can extend beyond the row frame bounds, when * the row contains row-spanning cells. */ +MOZ_DECL_CTOR_COUNTER(nsDisplayTableRowBackground) class nsDisplayTableRowBackground : public nsDisplayItem { public: - nsDisplayTableRowBackground(nsTableRowFrame* aFrame) : mFrame(aFrame) {} + nsDisplayTableRowBackground(nsTableRowFrame* aFrame) : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayTableRowBackground); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayTableRowBackground() { + MOZ_COUNT_DTOR(nsDisplayTableRowBackground); + } +#endif + virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder) { // the overflow rect contains any row-spanning cells, so it contains // our background. Note that this means we may not be opaque even if diff --git a/mozilla/layout/xul/base/src/nsBoxFrame.cpp b/mozilla/layout/xul/base/src/nsBoxFrame.cpp index c1fd3f3ed46..f0ab40be95d 100644 --- a/mozilla/layout/xul/base/src/nsBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsBoxFrame.cpp @@ -1352,9 +1352,18 @@ nsBoxFrame::GetDebugPref(nsPresContext* aPresContext) gDebug = nsContentUtils::GetBoolPref("xul.debug.box"); } +MOZ_DECL_CTOR_COUNTER(nsDisplayXULDebug) class nsDisplayXULDebug : public nsDisplayItem { public: - nsDisplayXULDebug(nsComboboxControlFrame* aFrame) : mFrame(aFrame) {} + nsDisplayXULDebug(nsComboboxControlFrame* aFrame) : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayXULDebug); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayXULDebug() { + MOZ_COUNT_DTOR(nsDisplayXULDebug); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt) { mFrame->DisplayDebugInfoFor(this, aPt - aBuilder->ToReferenceFrame(mFrame)); diff --git a/mozilla/layout/xul/base/src/nsGroupBoxFrame.cpp b/mozilla/layout/xul/base/src/nsGroupBoxFrame.cpp index 789bb8c5a03..2a7741f5821 100644 --- a/mozilla/layout/xul/base/src/nsGroupBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsGroupBoxFrame.cpp @@ -102,9 +102,18 @@ nsGroupBoxFrame::nsGroupBoxFrame(nsIPresShell* aShell):nsBoxFrame(aShell) { } +MOZ_DECL_CTOR_COUNTER(nsDisplayXULGroupBackground) class nsDisplayXULGroupBackground : public nsDisplayItem { public: - nsDisplayXULGroupBackground(nsGroupBoxFrame* aFrame) : mFrame(aFrame) {} + nsDisplayXULGroupBackground(nsGroupBoxFrame* aFrame) : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayXULGroupBackground); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayXULGroupBackground() { + MOZ_COUNT_DTOR(nsDisplayXULGroupBackground); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt) { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, diff --git a/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp b/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp index 31e4bc715d6..57b2741dc55 100644 --- a/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp @@ -385,9 +385,18 @@ nsImageBoxFrame::UpdateLoadFlags() mLoadFlags = nsIRequest::LOAD_NORMAL; } +MOZ_DECL_CTOR_COUNTER(nsDisplayXULImage) class nsDisplayXULImage : public nsDisplayItem { public: - nsDisplayXULImage(nsImageBoxFrame* aFrame) : mFrame(aFrame) {} + nsDisplayXULImage(nsImageBoxFrame* aFrame) : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayXULImage); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayXULImage() { + MOZ_COUNT_DTOR(nsDisplayXULImage); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } // Doesn't handle HitTest because nsLeafBoxFrame already creates an // event receiver for us diff --git a/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp b/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp index 27fc44495db..c22895b2a4f 100644 --- a/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp @@ -280,9 +280,18 @@ nsTextBoxFrame::UpdateAttributes(nsPresContext* aPresContext, } +MOZ_DECL_CTOR_COUNTER(nsDisplayXULTextBox) class nsDisplayXULTextBox : public nsDisplayItem { public: - nsDisplayXULTextBox(nsTextBoxFrame* aFrame) : mFrame(aFrame) {} + nsDisplayXULTextBox(nsTextBoxFrame* aFrame) : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayXULTextBox); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayXULTextBox() { + MOZ_COUNT_DTOR(nsDisplayXULTextBox); + } +#endif + virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx, const nsRect& aDirtyRect); diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.cpp index 38b9b87d89e..86c4b8d83d9 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.cpp @@ -114,9 +114,18 @@ nsTreeColFrame::Destroy(nsPresContext* aPresContext) return nsBoxFrame::Destroy(aPresContext); } +MOZ_DECL_CTOR_COUNTER(nsDisplayXULTreeColSplitterTarget) class nsDisplayXULTreeColSplitterTarget : public nsDisplayItem { public: - nsDisplayXULTreeColSplitterTarget(nsIFrame* aFrame) : mFrame(aFrame) {} + nsDisplayXULTreeColSplitterTarget(nsIFrame* aFrame) : mFrame(aFrame) { + MOZ_COUNT_CTOR(nsDisplayXULTreeColSplitterTarget); + } +#ifdef NS_BUILD_REFCNT_LOGGING + virtual ~nsDisplayXULTreeColSplitterTarget() { + MOZ_COUNT_DTOR(nsDisplayXULTreeColSplitterTarget); + } +#endif + virtual nsIFrame* HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt); virtual nsIFrame* GetUnderlyingFrame() { return mFrame; } NS_DISPLAY_DECL_NAME("XULTreeColSplitterTarget")