Bug 1263773 - Mark a bunch of classes in layout as MOZ_RAII. r=dholbert
authorJonathan Watt <jwatt@jwatt.org>
Mon, 28 Mar 2016 13:34:26 +0100
changeset 292788 774962b54f183a2952cdd22d5a9e185f247d211f
parent 292787 7a3813330df614bf841937c242be13f36424883f
child 292789 f1631a25825bc0da92bbc8dcca350bcd893edfe0
push id74978
push userjwatt@jwatt.org
push dateTue, 12 Apr 2016 11:06:14 +0000
treeherdermozilla-inbound@f1631a25825b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1263773
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1263773 - Mark a bunch of classes in layout as MOZ_RAII. r=dholbert
layout/base/RestyleManager.cpp
layout/base/RestyleManager.h
layout/base/StackArena.h
layout/forms/nsListControlFrame.h
layout/generic/RubyUtils.h
layout/generic/Selection.h
layout/generic/nsContainerFrame.h
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -2786,17 +2786,17 @@ ElementRestyler::CaptureChange(nsStyleCo
     }
   }
   NS_UpdateHint(mHintsNotHandledForDescendants,
                 NS_HintsNotHandledForDescendantsIn(ourChange));
   LOG_RESTYLE("mHintsNotHandledForDescendants = %s",
               RestyleManager::ChangeHintToString(mHintsNotHandledForDescendants).get());
 }
 
-class MOZ_STACK_CLASS AutoSelectorArrayTruncater final
+class MOZ_RAII AutoSelectorArrayTruncater final
 {
 public:
   explicit AutoSelectorArrayTruncater(
         nsTArray<nsCSSSelector*>& aSelectorsForDescendants)
     : mSelectorsForDescendants(aSelectorsForDescendants)
     , mOriginalLength(aSelectorsForDescendants.Length())
   {
   }
--- a/layout/base/RestyleManager.h
+++ b/layout/base/RestyleManager.h
@@ -914,17 +914,17 @@ private:
 };
 
 /**
  * This pushes any display:contents nodes onto a TreeMatchContext.
  * Use it before resolving style for kids of aParent where aParent
  * (and further ancestors) may be display:contents nodes which have
  * not yet been pushed onto TreeMatchContext.
  */
-class MOZ_STACK_CLASS AutoDisplayContentsAncestorPusher final
+class MOZ_RAII AutoDisplayContentsAncestorPusher final
 {
  public:
   typedef mozilla::dom::Element Element;
   AutoDisplayContentsAncestorPusher(TreeMatchContext& aTreeMatchContext,
                                     nsPresContext*    aPresContext,
                                     nsIContent*       aParent);
   ~AutoDisplayContentsAncestorPusher();
   bool IsEmpty() const { return mAncestors.Length() == 0; }
--- a/layout/base/StackArena.h
+++ b/layout/base/StackArena.h
@@ -55,17 +55,17 @@ private:
 // lifetime of a stack-allocated object can use this class.  First,
 // declare an AutoStackArena object on the stack.  Then all subsequent
 // calls to Allocate will allocate memory from an arena pool that will
 // be freed when that variable goes out of scope.  Nesting is allowed.
 //
 // Individual allocations cannot exceed StackBlock::MAX_USABLE_SIZE
 // bytes.
 //
-class MOZ_STACK_CLASS AutoStackArena {
+class MOZ_RAII AutoStackArena {
 public:
   AutoStackArena()
     : mOwnsStackArena(false)
   {
     if (!gStackArena) {
       gStackArena = new StackArena();
       mOwnsStackArena = true;
     }
--- a/layout/forms/nsListControlFrame.h
+++ b/layout/forms/nsListControlFrame.h
@@ -447,17 +447,17 @@ protected:
   int32_t mReflowId;
 #endif
 
 private:
   // for incremental typing navigation
   static nsAString& GetIncrementalString ();
   static DOMTimeStamp gLastKeyTime;
 
-  class MOZ_STACK_CLASS AutoIncrementalSearchResetter
+  class MOZ_RAII AutoIncrementalSearchResetter
   {
   public:
     AutoIncrementalSearchResetter() :
       mCancelled(false)
     {
     }
     ~AutoIncrementalSearchResetter()
     {
--- a/layout/generic/RubyUtils.h
+++ b/layout/generic/RubyUtils.h
@@ -91,17 +91,17 @@ public:
   static void ClearReservedISize(nsIFrame* aFrame);
   static nscoord GetReservedISize(nsIFrame* aFrame);
 };
 
 /**
  * This array stores all ruby text containers of the ruby segment
  * of the given ruby base container.
  */
-class MOZ_STACK_CLASS AutoRubyTextContainerArray final
+class MOZ_RAII AutoRubyTextContainerArray final
   : public AutoTArray<nsRubyTextContainerFrame*, RTC_ARRAY_SIZE>
 {
 public:
   explicit AutoRubyTextContainerArray(nsRubyBaseContainerFrame* aBaseContainer);
 };
 
 /**
  * This enumerator enumerates each ruby segment.
--- a/layout/generic/Selection.h
+++ b/layout/generic/Selection.h
@@ -349,17 +349,17 @@ public:
   ~SelectionBatcher()
   {
     if (mSelection) {
       mSelection->EndBatchChangesInternal();
     }
   }
 };
 
-class MOZ_STACK_CLASS AutoHideSelectionChanges final
+class MOZ_RAII AutoHideSelectionChanges final
 {
 private:
   RefPtr<Selection> mSelection;
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 public:
   explicit AutoHideSelectionChanges(const nsFrameSelection* aFrame);
 
   explicit AutoHideSelectionChanges(Selection* aSelection
--- a/layout/generic/nsContainerFrame.h
+++ b/layout/generic/nsContainerFrame.h
@@ -741,17 +741,17 @@ public:
    * next-in-flow. This function MUST be called before stealing or
    * deleting aChild's next-in-flow.
    * The AutoFinish helper object does that for you. Use it like so:
    * if (kidNextInFlow) {
    *   nsOverflowContinuationTracker::AutoFinish fini(tracker, kid);
    *   ... DeleteNextInFlowChild/StealFrame(kidNextInFlow) here ...
    * }
    */
-  class MOZ_STACK_CLASS AutoFinish {
+  class MOZ_RAII AutoFinish {
   public:
     AutoFinish(nsOverflowContinuationTracker* aTracker, nsIFrame* aChild)
       : mTracker(aTracker), mChild(aChild)
     {
       if (mTracker) mTracker->BeginFinish(mChild);
     }
     ~AutoFinish() 
     {