Backed out changeset 1904a234e142 (bug 1198385) for bustage.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 25 Aug 2015 16:09:05 -0400
changeset 259320 57a3cadc3990cf99329f0b0e082832e2cc378a80
parent 259319 1904a234e1425871b9b87bd317b3b1b9c6a05666
child 259321 1d82f63f06e705da27bd1ebbb8149a7eefe417f5
push id29277
push userryanvm@gmail.com
push dateWed, 26 Aug 2015 18:32:23 +0000
treeherdermozilla-central@fea87cbeaa6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1198385
milestone43.0a1
backs out1904a234e1425871b9b87bd317b3b1b9c6a05666
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
Backed out changeset 1904a234e142 (bug 1198385) for bustage. CLOSED TREE
editor/libeditor/nsEditorUtils.cpp
editor/libeditor/nsEditorUtils.h
--- a/editor/libeditor/nsEditorUtils.cpp
+++ b/editor/libeditor/nsEditorUtils.cpp
@@ -26,21 +26,19 @@ class nsRange;
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 /******************************************************************************
  * nsAutoSelectionReset
  *****************************************************************************/
 
-nsAutoSelectionReset::nsAutoSelectionReset(Selection* aSel, nsEditor* aEd
-                                           MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
+nsAutoSelectionReset::nsAutoSelectionReset(Selection* aSel, nsEditor* aEd)
   : mSel(nullptr), mEd(nullptr)
 {
-  MOZ_GUARD_OBJECT_NOTIFIER_INIT;
   if (!aSel || !aEd) return;    // not much we can do, bail.
   if (aEd->ArePreservingSelection()) return;   // we already have initted mSavedSel, so this must be nested call.
   mSel = aSel;
   mEd = aEd;
   if (mSel)
   {
     mEd->PreserveSelectionAcrossActions(mSel);
   }
@@ -63,34 +61,32 @@ nsAutoSelectionReset::Abort()
     mEd->StopPreservingSelection();
 }
 
 
 /******************************************************************************
  * some helper classes for iterating the dom tree
  *****************************************************************************/
 
-nsDOMIterator::nsDOMIterator(nsINode& aNode MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
+nsDOMIterator::nsDOMIterator(nsINode& aNode)
 {
-  MOZ_GUARD_OBJECT_NOTIFIER_INIT;
   mIter = NS_NewContentIterator();
   DebugOnly<nsresult> res = mIter->Init(&aNode);
   MOZ_ASSERT(NS_SUCCEEDED(res));
 }
 
 nsresult
 nsDOMIterator::Init(nsRange& aRange)
 {
   mIter = NS_NewContentIterator();
   return mIter->Init(&aRange);
 }
 
-nsDOMIterator::nsDOMIterator(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)
+nsDOMIterator::nsDOMIterator()
 {
-  MOZ_GUARD_OBJECT_NOTIFIER_INIT;
 }
 
 nsDOMIterator::~nsDOMIterator()
 {
 }
 
 void
 nsDOMIterator::AppendList(const nsBoolDomIterFunctor& functor,
@@ -101,18 +97,17 @@ nsDOMIterator::AppendList(const nsBoolDo
     nsCOMPtr<nsINode> node = mIter->GetCurrentNode();
 
     if (functor(node)) {
       arrayOfNodes.AppendElement(*node);
     }
   }
 }
 
-nsDOMSubtreeIterator::nsDOMSubtreeIterator(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)
-  : nsDOMIterator(MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)
+nsDOMSubtreeIterator::nsDOMSubtreeIterator()
 {
 }
 
 nsresult
 nsDOMSubtreeIterator::Init(nsRange& aRange)
 {
   mIter = NS_NewContentSubtreeIterator();
   return mIter->Init(&aRange);
--- a/editor/libeditor/nsEditorUtils.h
+++ b/editor/libeditor/nsEditorUtils.h
@@ -9,17 +9,16 @@
 
 
 #include "nsCOMPtr.h"
 #include "nsDebug.h"
 #include "nsEditor.h"
 #include "nsIDOMNode.h"
 #include "nsIEditor.h"
 #include "nscore.h"
-#include "mozilla/GuardObjects.h"
 
 class nsIAtom;
 class nsIContentIterator;
 class nsIDOMDocument;
 class nsRange;
 namespace mozilla {
 template <class T> class OwningNonNull;
 namespace dom {
@@ -30,87 +29,67 @@ class Selection;
 /***************************************************************************
  * stack based helper class for batching a collection of txns inside a
  * placeholder txn.
  */
 class MOZ_STACK_CLASS nsAutoPlaceHolderBatch
 {
   private:
     nsCOMPtr<nsIEditor> mEd;
-    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
   public:
-    nsAutoPlaceHolderBatch(nsIEditor *aEd, nsIAtom *atom MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
-      : mEd(do_QueryInterface(aEd))
-    {
-      MOZ_GUARD_OBJECT_NOTIFIER_INIT;
-      if (mEd) {
-        mEd->BeginPlaceHolderTransaction(atom);
-      }
-    }
-    ~nsAutoPlaceHolderBatch()
-    {
-      if (mEd) {
-        mEd->EndPlaceHolderTransaction();
-      }
-    }
+    nsAutoPlaceHolderBatch( nsIEditor *aEd, nsIAtom *atom) : mEd(do_QueryInterface(aEd))
+                   { if (mEd) mEd->BeginPlaceHolderTransaction(atom); }
+    ~nsAutoPlaceHolderBatch() { if (mEd) mEd->EndPlaceHolderTransaction(); }
 };
 
 /***************************************************************************
  * stack based helper class for batching a collection of txns.
  * Note: I changed this to use placeholder batching so that we get
  * proper selection save/restore across undo/redo.
  */
 class MOZ_STACK_CLASS nsAutoEditBatch : public nsAutoPlaceHolderBatch
 {
-  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
   public:
-    explicit nsAutoEditBatch(nsIEditor *aEd MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
-      : nsAutoPlaceHolderBatch(aEd, nullptr)
-    {
-      MOZ_GUARD_OBJECT_NOTIFIER_INIT;
-    }
+    explicit nsAutoEditBatch( nsIEditor *aEd) : nsAutoPlaceHolderBatch(aEd,nullptr)  {}
     ~nsAutoEditBatch() {}
 };
 
 /***************************************************************************
  * stack based helper class for saving/restoring selection.  Note that this
  * assumes that the nodes involved are still around afterwards!
  */
 class MOZ_STACK_CLASS nsAutoSelectionReset
 {
   private:
     /** ref-counted reference to the selection that we are supposed to restore */
     nsRefPtr<mozilla::dom::Selection> mSel;
     nsEditor *mEd;  // non-owning ref to nsEditor
-    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 
   public:
     /** constructor responsible for remembering all state needed to restore aSel */
-    nsAutoSelectionReset(mozilla::dom::Selection* aSel, nsEditor* aEd MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
+    nsAutoSelectionReset(mozilla::dom::Selection* aSel, nsEditor* aEd);
 
     /** destructor restores mSel to its former state */
     ~nsAutoSelectionReset();
 
     /** Abort: cancel selection saver */
     void Abort();
 };
 
 /***************************************************************************
  * stack based helper class for StartOperation()/EndOperation() sandwich
  */
 class MOZ_STACK_CLASS nsAutoRules
 {
   public:
 
   nsAutoRules(nsEditor *ed, EditAction action,
-              nsIEditor::EDirection aDirection
-              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
-    : mEd(ed), mDoNothing(false)
+              nsIEditor::EDirection aDirection) :
+         mEd(ed), mDoNothing(false)
   {
-    MOZ_GUARD_OBJECT_NOTIFIER_INIT;
     if (mEd && !mEd->mAction) // mAction will already be set if this is nested call
     {
       mEd->StartOperation(action, aDirection);
     }
     else mDoNothing = true; // nested calls will end up here
   }
   ~nsAutoRules()
   {
@@ -118,32 +97,29 @@ class MOZ_STACK_CLASS nsAutoRules
     {
       mEd->EndOperation();
     }
   }
 
   protected:
   nsEditor *mEd;
   bool mDoNothing;
-  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 
 /***************************************************************************
  * stack based helper class for turning off active selection adjustment
  * by low level transactions
  */
 class MOZ_STACK_CLASS nsAutoTxnsConserveSelection
 {
   public:
 
-  explicit nsAutoTxnsConserveSelection(nsEditor *ed MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
-    : mEd(ed), mOldState(true)
+  explicit nsAutoTxnsConserveSelection(nsEditor *ed) : mEd(ed), mOldState(true)
   {
-    MOZ_GUARD_OBJECT_NOTIFIER_INIT;
     if (mEd)
     {
       mOldState = mEd->GetShouldTxnSetSelection();
       mEd->SetShouldTxnSetSelection(false);
     }
   }
 
   ~nsAutoTxnsConserveSelection()
@@ -152,77 +128,73 @@ class MOZ_STACK_CLASS nsAutoTxnsConserve
     {
       mEd->SetShouldTxnSetSelection(mOldState);
     }
   }
 
   protected:
   nsEditor *mEd;
   bool mOldState;
-  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 /***************************************************************************
  * stack based helper class for batching reflow and paint requests.
  */
 class MOZ_STACK_CLASS nsAutoUpdateViewBatch
 {
   public:
 
-  explicit nsAutoUpdateViewBatch(nsEditor *ed MOZ_GUARD_OBJECT_NOTIFIER_PARAM) : mEd(ed)
+  explicit nsAutoUpdateViewBatch(nsEditor *ed) : mEd(ed)
   {
-    MOZ_GUARD_OBJECT_NOTIFIER_INIT;
     NS_ASSERTION(mEd, "null mEd pointer!");
 
     if (mEd)
       mEd->BeginUpdateViewBatch();
   }
 
   ~nsAutoUpdateViewBatch()
   {
     if (mEd)
       mEd->EndUpdateViewBatch();
   }
 
   protected:
   nsEditor *mEd;
-  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 /******************************************************************************
  * some helper classes for iterating the dom tree
  *****************************************************************************/
 
 class nsBoolDomIterFunctor
 {
   public:
     virtual bool operator()(nsINode* aNode) const = 0;
 };
 
 class MOZ_STACK_CLASS nsDOMIterator
 {
   public:
-    nsDOMIterator(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM);
+    nsDOMIterator();
 
-    explicit nsDOMIterator(nsINode& aNode MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
+    explicit nsDOMIterator(nsINode& aNode);
     virtual ~nsDOMIterator();
 
     nsresult Init(nsRange& aRange);
 
     void AppendList(const nsBoolDomIterFunctor& functor,
                     nsTArray<mozilla::OwningNonNull<nsINode>>& arrayOfNodes) const;
   protected:
     nsCOMPtr<nsIContentIterator> mIter;
-    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 class MOZ_STACK_CLASS nsDOMSubtreeIterator : public nsDOMIterator
 {
   public:
-    nsDOMSubtreeIterator(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM);
+    nsDOMSubtreeIterator();
     virtual ~nsDOMSubtreeIterator();
 
     nsresult Init(nsRange& aRange);
 };
 
 class nsTrivialFunctor : public nsBoolDomIterFunctor
 {
   public: