Bug 442729 - Annotate stack-only classes in layout, r+sr=roc
authorBenjamin Smedberg <benjamin@smedbergs.us>
Tue, 01 Jul 2008 15:16:45 -0400
changeset 15599 0ae69a177872a4f918352a25cb73d26f51412746
parent 15598 c87469016a14fedcd483d4394dbfff0afc40bbe6
child 15600 bb948e433b06ec5f1bda21d0ef9ee1fae5a090c2
push idunknown
push userunknown
push dateunknown
bugs442729
milestone1.9.1a1pre
Bug 442729 - Annotate stack-only classes in layout, r+sr=roc
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsChildIterator.h
layout/base/nsDisplayList.h
layout/base/nsICaret.h
layout/generic/nsFrame.cpp
layout/generic/nsFrameSelection.h
layout/generic/nsIFrame.h
layout/generic/nsSelection.cpp
layout/generic/nsTextFrameThebes.cpp
layout/svg/base/src/nsSVGFilterInstance.h
layout/xul/base/src/nsBoxLayoutState.h
view/public/nsIViewManager.h
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -1122,17 +1122,17 @@ private:
   nsIAtom* mChildListName;
   nsFrameConstructorState* mState;
 
   friend class nsFrameConstructorState;
 };
 
 // Structure used for maintaining state information during the
 // frame construction process
-class nsFrameConstructorState {
+class NS_STACK_CLASS nsFrameConstructorState {
 public:
   nsPresContext            *mPresContext;
   nsIPresShell             *mPresShell;
   nsFrameManager           *mFrameManager;
 
 #ifdef MOZ_XUL
   // The root box, if any.
   nsIRootBox*               mRootBox;
@@ -1726,17 +1726,17 @@ MoveChildrenTo(nsFrameManager*          
   }
 }
 
 // -----------------------------------------------------------
 
 
 // Structure used to ensure that bindings are properly enqueued in the
 // binding manager's attached queue.
-struct nsAutoEnqueueBinding
+struct NS_STACK_CLASS nsAutoEnqueueBinding
 {
   nsAutoEnqueueBinding(nsIDocument* aDocument) :
     mDocument(aDocument)
   {}
 
   ~nsAutoEnqueueBinding();
 
   nsRefPtr<nsXBLBinding> mBinding;
--- a/layout/base/nsChildIterator.h
+++ b/layout/base/nsChildIterator.h
@@ -47,17 +47,17 @@
 #include "nsIDOMNode.h"
 
 /**
  * Helper class for iterating children during frame construction.
  * This class should always be used in lieu of the straight content
  * node APIs, since it handles XBL-generated anonymous content as
  * well.
  */
-class ChildIterator
+class NS_STACK_CLASS ChildIterator
 {
 protected:
   nsCOMPtr<nsIContent> mContent;
   PRUint32 mIndex;
   nsCOMPtr<nsIDOMNodeList> mNodes;
 
 public:
   ChildIterator()
--- a/layout/base/nsDisplayList.h
+++ b/layout/base/nsDisplayList.h
@@ -112,17 +112,17 @@ class nsDisplayTableItem;
  * This manages a display list and is passed as a parameter to
  * nsIFrame::BuildDisplayList.
  * It contains the parameters that don't change from frame to frame and manages
  * the display list memory using a PLArena. It also establishes the reference
  * coordinate system for all display list items. Some of the parameters are
  * available from the prescontext/presshell, but we copy them into the builder
  * for faster/more convenient access.
  */
-class nsDisplayListBuilder {
+class NS_STACK_CLASS nsDisplayListBuilder {
 public:
   /**
    * @param aReferenceFrame the frame at the root of the subtree; its origin
    * is the origin of the reference coordinate system for this display list
    * @param aIsForEvents PR_TRUE if we're creating this list in order to
    * determine which frame is under the mouse position
    * @param aBuildCaret whether or not we should include the caret in any
    * display lists that we make.
--- a/layout/base/nsICaret.h
+++ b/layout/base/nsICaret.h
@@ -199,17 +199,17 @@ public:
 NS_DEFINE_STATIC_IID_ACCESSOR(nsICaret, NS_ICARET_IID)
 
 nsresult
 NS_NewCaret(nsICaret** aInstancePtrResult);
 
 
 // handy stack-based class for temporarily disabling the caret
 
-class StCaretHider
+class NS_STACK_CLASS StCaretHider
 {
 public:
                StCaretHider(nsICaret* aSelCon)
                : mWasVisible(PR_FALSE), mCaret(aSelCon)
                {
                  if (mCaret)
                  {
                    mCaret->GetCaretVisible(&mWasVisible);
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -2330,17 +2330,17 @@ NS_IMETHODIMP nsFrame::HandleRelease(nsP
 
   return selectionOff
     ? NS_OK
     : HandleFrameSelection(frameselection, offsets, handleTableSelection,
                            contentOffsetForTableSel, targetForTableSel,
                            parentContent, aEvent, aEventStatus);
 }
 
-struct FrameContentRange {
+struct NS_STACK_CLASS FrameContentRange {
   FrameContentRange(nsIContent* aContent, PRInt32 aStart, PRInt32 aEnd) :
     content(aContent), start(aStart), end(aEnd) { }
   nsCOMPtr<nsIContent> content;
   PRInt32 start;
   PRInt32 end;
 };
 
 // Retrieve the content offsets of a frame
--- a/layout/generic/nsFrameSelection.h
+++ b/layout/generic/nsFrameSelection.h
@@ -72,17 +72,17 @@ struct SelectionDetails
 class nsIPresShell;
 
 enum EWordMovementType { eStartWord, eEndWord, eDefaultBehavior };
 
 /** PeekOffsetStruct is used to group various arguments (both input and output)
  *  that are passed to nsFrame::PeekOffset(). See below for the description of
  *  individual arguments.
  */
-struct nsPeekOffsetStruct
+struct NS_STACK_CLASS nsPeekOffsetStruct
 {
   void SetData(nsSelectionAmount aAmount,
                nsDirection aDirection,
                PRInt32 aStartOffset,
                nscoord aDesiredX,
                PRBool aJumpLines,
                PRBool aScrollViewStop,
                PRBool aIsKeyboardSelect,
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -940,17 +940,17 @@ public:
   // a point; there is a primary and a secondary offset associated with any
   // point.  The primary and secondary offsets differ when the point is over a
   // non-text object.  The primary offset is the expected position of the
   // cursor calculated from a point; the secondary offset, when it is different,
   // indicates that the point is in the boundaries of some selectable object.
   // Note that the primary offset can be after the secondary offset; for places
   // that need the beginning and end of the object, the StartOffset and 
   // EndOffset helpers can be used.
-  struct ContentOffsets {
+  struct NS_STACK_CLASS ContentOffsets {
     nsCOMPtr<nsIContent> content;
     PRBool IsNull() { return !content; }
     PRInt32 offset;
     PRInt32 secondaryOffset;
     // Helpers for places that need the ends of the offsets and expect them in
     // numerical order, as opposed to wanting the primary and secondary offsets
     PRInt32 StartOffset() { return PR_MIN(offset, secondaryOffset); }
     PRInt32 EndOffset() { return PR_MAX(offset, secondaryOffset); }
@@ -973,17 +973,17 @@ public:
                                                             PRBool aIgnoreSelectionStyle = PR_FALSE)
   { return GetContentOffsetsFromPoint(aPoint, aIgnoreSelectionStyle); }
 
   /**
    * This structure holds information about a cursor. mContainer represents a
    * loaded image that should be preferred. If it is not possible to use it, or
    * if it is null, mCursor should be used.
    */
-  struct Cursor {
+  struct NS_STACK_CLASS Cursor {
     nsCOMPtr<imgIContainer> mContainer;
     PRInt32                 mCursor;
     PRBool                  mHaveHotspot;
     float                   mHotspotX, mHotspotY;
   };
   /**
    * Get the cursor for a given frame.
    */
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -376,26 +376,26 @@ private:
   CachedOffsetForFrame *mCachedOffsetForFrame;
   nsDirection mDirection;
   SelectionType mType;
   PRPackedBool mTrueDirection;
   PRPackedBool mFixupState;
 };
 
 // Stack-class to turn on/off selection batching for table selection
-class nsSelectionBatcher
+class NS_STACK_CLASS NS_FINAL_CLASS nsSelectionBatcher
 {
 private:
   nsCOMPtr<nsISelectionPrivate> mSelection;
 public:
   nsSelectionBatcher(nsISelectionPrivate *aSelection) : mSelection(aSelection)
   {
     if (mSelection) mSelection->StartBatchChanges();
   }
-  virtual ~nsSelectionBatcher() 
+  ~nsSelectionBatcher() 
   { 
     if (mSelection) mSelection->EndBatchChanges();
   }
 };
 
 class nsSelectionIterator : public nsIBidirectionalEnumerator
 {
 public:
--- a/layout/generic/nsTextFrameThebes.cpp
+++ b/layout/generic/nsTextFrameThebes.cpp
@@ -1972,17 +1972,17 @@ static PRBool IsInBounds(const gfxSkipCh
   if (aContentLength == PR_INT32_MAX)
     return PR_TRUE;
   gfxSkipCharsIterator iter(aStart);
   iter.AdvanceOriginal(aContentLength);
   return iter.GetSkippedOffset() >= aOffset + aLength;
 }
 #endif
 
-class PropertyProvider : public gfxTextRun::PropertyProvider {
+class NS_STACK_CLASS PropertyProvider : public gfxTextRun::PropertyProvider {
 public:
   /**
    * Use this constructor for reflow, when we don't know what text is
    * really mapped by the frame and we have a lot of other data around.
    * 
    * @param aLength can be PR_INT32_MAX to indicate we cover all the text
    * associated with aFrame up to where its flow chain ends in the given
    * textrun. If PR_INT32_MAX is passed, justification and hyphen-related methods
@@ -4705,17 +4705,17 @@ nsTextFrame::PeekOffsetNoAmount(PRBool a
 /**
  * This class iterates through the clusters before or after the given
  * aPosition (which is a content offset). You can test each cluster
  * to see if it's whitespace (as far as selection/caret movement is concerned),
  * or punctuation, or if there is a word break before the cluster. ("Before"
  * is interpreted according to aDirection, so if aDirection is -1, "before"
  * means actually *after* the cluster content.)
  */
-class ClusterIterator {
+class NS_STACK_CLASS ClusterIterator {
 public:
   ClusterIterator(nsTextFrame* aTextFrame, PRInt32 aPosition, PRInt32 aDirection,
                   nsString& aContext);
 
   PRBool NextCluster();
   PRBool IsWhitespace();
   PRBool IsPunctuation();
   PRBool HaveWordBreakBefore() { return mHaveWordBreak; }
--- a/layout/svg/base/src/nsSVGFilterInstance.h
+++ b/layout/svg/base/src/nsSVGFilterInstance.h
@@ -46,17 +46,17 @@
 #include "nsIContent.h"
 #include "nsAutoPtr.h"
 
 #include "gfxImageSurface.h"
 
 class nsSVGLength2;
 class nsSVGElement;
 
-class nsSVGFilterInstance
+class NS_STACK_CLASS nsSVGFilterInstance
 {
 public:
   class ColorModel {
   public:
     enum ColorSpace { SRGB, LINEAR_RGB };
     enum AlphaChannel { UNPREMULTIPLIED, PREMULTIPLIED };
 
     ColorModel(ColorSpace aColorSpace, AlphaChannel aAlphaChannel) :
--- a/layout/xul/base/src/nsBoxLayoutState.h
+++ b/layout/xul/base/src/nsBoxLayoutState.h
@@ -51,17 +51,17 @@
 #include "nsIPresShell.h"
 
 class nsIRenderingContext;
 class nsCalculatedBoxInfo;
 struct nsHTMLReflowMetrics;
 class nsString;
 class nsHTMLReflowCommand;
 
-class nsBoxLayoutState
+class NS_STACK_CLASS nsBoxLayoutState
 {
 public:
   nsBoxLayoutState(nsPresContext* aPresContext, nsIRenderingContext* aRenderingContext = nsnull,
                    PRUint16 aReflowDepth = 0) NS_HIDDEN;
   nsBoxLayoutState(const nsBoxLayoutState& aState) NS_HIDDEN;
 
   nsPresContext* PresContext() const { return mPresContext; }
   nsIPresShell* PresShell() const { return mPresContext->PresShell(); }
--- a/view/public/nsIViewManager.h
+++ b/view/public/nsIViewManager.h
@@ -317,17 +317,17 @@ public:
   /**
    * allow the view manager to refresh. this may cause a synchronous
    * paint to occur inside the call.
    * @param aUpdateFlags see bottom of nsIViewManager.h for description
    * @return error status
    */
   NS_IMETHOD EnableRefresh(PRUint32 aUpdateFlags) = 0;
 
-  class UpdateViewBatch {
+  class NS_STACK_CLASS UpdateViewBatch {
   public:
     UpdateViewBatch() {}
   /**
    * prevents the view manager from refreshing. allows UpdateView()
    * to notify widgets of damaged regions that should be repainted
    * when the batch is ended. Call EndUpdateViewBatch on this object
    * before it is destroyed
    * @return error status