Bug 1260651 part.52 Rename nsAutoLockListener to mozilla::AutoLockListener r=mccr8 draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 24 Jun 2016 21:22:26 +0900
changeset 385884 21a0009004e8e5f6a5755f7809b67dda864c4f78
parent 385883 160e1bd45fd77b6e979299a56d77409469736361
child 385885 39832ef77626f83b791314300d719ebb9e5d5624
push id22587
push usermasayuki@d-toybox.com
push dateSat, 09 Jul 2016 06:59:31 +0000
reviewersmccr8
bugs1260651
milestone50.0a1
Bug 1260651 part.52 Rename nsAutoLockListener to mozilla::AutoLockListener r=mccr8 MozReview-Commit-ID: 728oPlrpb3Q
editor/libeditor/HTMLEditRules.cpp
editor/libeditor/TextEditRules.h
--- a/editor/libeditor/HTMLEditRules.cpp
+++ b/editor/libeditor/HTMLEditRules.cpp
@@ -1320,17 +1320,17 @@ HTMLEditRules::WillInsertText(EditAction
     NS_ENSURE_STATE(mHTMLEditor);
     res = mHTMLEditor->IsPreformatted(GetAsDOMNode(selNode), &isPRE);
     NS_ENSURE_SUCCESS(res, res);
 
     // turn off the edit listener: we know how to
     // build the "doc changed range" ourselves, and it's
     // must faster to do it once here than to track all
     // the changes one at a time.
-    nsAutoLockListener lockit(&mListenerEnabled);
+    AutoLockListener lockit(&mListenerEnabled);
 
     // don't spaz my selection in subtransactions
     NS_ENSURE_STATE(mHTMLEditor);
     AutoTransactionsConserveSelection dontSpazMySelection(mHTMLEditor);
     nsAutoString tString(*inString);
     const char16_t *unicodeBuf = tString.get();
     int32_t pos = 0;
     NS_NAMED_LITERAL_STRING(newlineStr, LFSTR);
--- a/editor/libeditor/TextEditRules.h
+++ b/editor/libeditor/TextEditRules.h
@@ -319,39 +319,39 @@ public:
       mRules->mLockRulesSniffing = false;
     }
   }
 
 protected:
   TextEditRules* mRules;
 };
 
-} // namespace mozilla
-
-/***************************************************************************
- * stack based helper class for turning on/off the edit listener.
+/**
+ * Stack based helper class for turning on/off the edit listener.
  */
-class nsAutoLockListener
+class MOZ_STACK_CLASS AutoLockListener final
 {
 public:
-
-  explicit nsAutoLockListener(bool *enabled)
-    : mEnabled(enabled), mOldState(false)
+  explicit AutoLockListener(bool* aEnabled)
+    : mEnabled(aEnabled)
+    , mOldState(false)
   {
     if (mEnabled) {
       mOldState = *mEnabled;
       *mEnabled = false;
     }
   }
 
-  ~nsAutoLockListener()
+  ~AutoLockListener()
   {
     if (mEnabled) {
       *mEnabled = mOldState;
     }
   }
 
 protected:
-  bool *mEnabled;
+  bool* mEnabled;
   bool mOldState;
 };
 
+} // namespace mozilla
+
 #endif // #ifndef mozilla_TextEditRules_h