Bug 1260651 part.8 Rename nsAutoUpdateViewBatch to mozilla::AutoUpdateViewBatch r=mccr8
MozReview-Commit-ID: GsisMrwLlET
--- a/editor/libeditor/EditorUtils.h
+++ b/editor/libeditor/EditorUtils.h
@@ -157,49 +157,52 @@ class MOZ_RAII nsAutoTxnsConserveSelecti
}
protected:
nsEditor *mEd;
bool mOldState;
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};
+namespace mozilla {
+
/***************************************************************************
* stack based helper class for batching reflow and paint requests.
*/
-class MOZ_RAII nsAutoUpdateViewBatch
+class MOZ_RAII AutoUpdateViewBatch final
{
- public:
-
- explicit nsAutoUpdateViewBatch(nsEditor *ed MOZ_GUARD_OBJECT_NOTIFIER_PARAM) : mEd(ed)
+public:
+ explicit AutoUpdateViewBatch(nsEditor* aEditor
+ MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
+ : mEditor(aEditor)
{
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
- NS_ASSERTION(mEd, "null mEd pointer!");
+ NS_ASSERTION(mEditor, "null mEditor pointer!");
- if (mEd)
- mEd->BeginUpdateViewBatch();
+ if (mEditor) {
+ mEditor->BeginUpdateViewBatch();
+ }
}
- ~nsAutoUpdateViewBatch()
+ ~AutoUpdateViewBatch()
{
- if (mEd)
- mEd->EndUpdateViewBatch();
+ if (mEditor) {
+ mEditor->EndUpdateViewBatch();
+ }
}
- protected:
- nsEditor *mEd;
+protected:
+ nsEditor* mEditor;
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};
/******************************************************************************
* some helper classes for iterating the dom tree
*****************************************************************************/
-namespace mozilla {
-
class BoolDomIterFunctor
{
public:
virtual bool operator()(nsINode* aNode) const = 0;
};
class MOZ_RAII DOMIterator
{
--- a/editor/libeditor/nsEditor.cpp
+++ b/editor/libeditor/nsEditor.cpp
@@ -707,17 +707,17 @@ nsEditor::DoTransaction(nsITransaction*
// XXX: these selection batch calls no-ops.
// XXX:
// XXX: I suspect that this was placed here to avoid multiple
// XXX: selection changed notifications from happening until after
// XXX: the transaction was done. I suppose that can still happen
// XXX: if an embedding application called DoTransaction() directly
// XXX: to pump its own transactions through the system, but in that
// XXX: case, wouldn't we want to use Begin/EndUpdateViewBatch() or
- // XXX: its auto equivalent nsAutoUpdateViewBatch to ensure that
+ // XXX: its auto equivalent AutoUpdateViewBatch to ensure that
// XXX: selection listeners have access to accurate frame data?
// XXX:
// XXX: Note that if we did add Begin/EndUpdateViewBatch() calls
// XXX: we will need to make sure that they are disabled during
// XXX: the init of the editor for text widgets to avoid layout
// XXX: re-entry during initial reflow. - kin
// get the selection and start a batch change
--- a/editor/libeditor/nsPlaintextEditor.cpp
+++ b/editor/libeditor/nsPlaintextEditor.cpp
@@ -1089,17 +1089,17 @@ nsPlaintextEditor::SetNewlineHandling(in
}
NS_IMETHODIMP
nsPlaintextEditor::Undo(uint32_t aCount)
{
// Protect the edit rules object from dying
nsCOMPtr<nsIEditRules> kungFuDeathGrip(mRules);
- nsAutoUpdateViewBatch beginViewBatching(this);
+ AutoUpdateViewBatch beginViewBatching(this);
ForceCompositionEnd();
NotifyEditorObservers(eNotifyEditorObserversOfBefore);
nsAutoRules beginRulesSniffing(this, EditAction::undo, nsIEditor::eNone);
nsTextRulesInfo ruleInfo(EditAction::undo);
@@ -1118,17 +1118,17 @@ nsPlaintextEditor::Undo(uint32_t aCount)
}
NS_IMETHODIMP
nsPlaintextEditor::Redo(uint32_t aCount)
{
// Protect the edit rules object from dying
nsCOMPtr<nsIEditRules> kungFuDeathGrip(mRules);
- nsAutoUpdateViewBatch beginViewBatching(this);
+ AutoUpdateViewBatch beginViewBatching(this);
ForceCompositionEnd();
NotifyEditorObservers(eNotifyEditorObserversOfBefore);
nsAutoRules beginRulesSniffing(this, EditAction::redo, nsIEditor::eNone);
nsTextRulesInfo ruleInfo(EditAction::redo);