Bug 1260651 part.4 Rename nsTrivialFunctor to mozilla::TrivialFunctor r=mccr8
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 23 Jun 2016 17:19:35 +0900
changeset 304299 ee514ba8a11346e9cadcab8eed3fad15c90656e4
parent 304298 0e0374a80aa67d5a5f196969a3fd31b0178121ba
child 304300 3c090bdf8ea568ebddac1eac8a2187d0f69dfdf3
push id79299
push usermasayuki@d-toybox.com
push dateSat, 09 Jul 2016 08:01:22 +0000
treeherdermozilla-inbound@942dac383054 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1260651
milestone50.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 1260651 part.4 Rename nsTrivialFunctor to mozilla::TrivialFunctor r=mccr8 MozReview-Commit-ID: B37mZ5otKHU
editor/libeditor/EditorUtils.h
editor/libeditor/nsHTMLDataTransfer.cpp
editor/libeditor/nsHTMLEditRules.cpp
--- a/editor/libeditor/EditorUtils.h
+++ b/editor/libeditor/EditorUtils.h
@@ -220,28 +220,28 @@ class MOZ_RAII nsDOMSubtreeIterator : pu
 {
   public:
     explicit nsDOMSubtreeIterator(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM);
     virtual ~nsDOMSubtreeIterator();
 
     nsresult Init(nsRange& aRange);
 };
 
-class nsTrivialFunctor : public nsBoolDomIterFunctor
+namespace mozilla {
+
+class TrivialFunctor final : public nsBoolDomIterFunctor
 {
-  public:
-    // Used to build list of all nodes iterator covers
-    virtual bool operator()(nsINode* aNode) const
-    {
-      return true;
-    }
+public:
+  // Used to build list of all nodes iterator covers
+  virtual bool operator()(nsINode* aNode) const
+  {
+    return true;
+  }
 };
 
-namespace mozilla {
-
 /******************************************************************************
  * general dom point utility struct
  *****************************************************************************/
 struct MOZ_STACK_CLASS EditorDOMPoint final
 {
   nsCOMPtr<nsINode> node;
   int32_t offset;
 
--- a/editor/libeditor/nsHTMLDataTransfer.cpp
+++ b/editor/libeditor/nsHTMLDataTransfer.cpp
@@ -2246,17 +2246,17 @@ nsHTMLEditor::CreateListOfNodesToPaste(D
   RefPtr<nsRange> docFragRange;
   nsresult rv = nsRange::CreateRange(aStartNode, aStartOffset,
                                      aEndNode, aEndOffset,
                                      getter_AddRefs(docFragRange));
   MOZ_ASSERT(NS_SUCCEEDED(rv));
   NS_ENSURE_SUCCESS(rv, );
 
   // Now use a subtree iterator over the range to create a list of nodes
-  nsTrivialFunctor functor;
+  TrivialFunctor functor;
   nsDOMSubtreeIterator iter;
   rv = iter.Init(*docFragRange);
   NS_ENSURE_SUCCESS(rv, );
   iter.AppendList(functor, outNodeList);
 }
 
 void
 nsHTMLEditor::GetListAndTableParents(StartOrEnd aStartOrEnd,
--- a/editor/libeditor/nsHTMLEditRules.cpp
+++ b/editor/libeditor/nsHTMLEditRules.cpp
@@ -2354,17 +2354,17 @@ nsHTMLEditRules::WillDeleteSelection(Sel
         join = true;
 
         uint32_t rangeCount = aSelection->RangeCount();
         for (uint32_t rangeIdx = 0; rangeIdx < rangeCount; ++rangeIdx) {
           OwningNonNull<nsRange> range = *aSelection->GetRangeAt(rangeIdx);
 
           // Build a list of nodes in the range
           nsTArray<OwningNonNull<nsINode>> arrayOfNodes;
-          nsTrivialFunctor functor;
+          TrivialFunctor functor;
           nsDOMSubtreeIterator iter;
           nsresult res = iter.Init(*range);
           NS_ENSURE_SUCCESS(res, res);
           iter.AppendList(functor, arrayOfNodes);
 
           // Now that we have the list, delete non-table elements
           int32_t listCount = arrayOfNodes.Length();
           for (int32_t j = 0; j < listCount; j++) {
@@ -5624,17 +5624,17 @@ nsHTMLEditRules::GetNodesForOperation(ns
     NS_ENSURE_SUCCESS(res, res);
   }
   // Gather up a list of all the nodes
   for (auto& range : aArrayOfRanges) {
     nsDOMSubtreeIterator iter;
     res = iter.Init(*range);
     NS_ENSURE_SUCCESS(res, res);
     if (aOutArrayOfNodes.Length() == 0) {
-      iter.AppendList(nsTrivialFunctor(), aOutArrayOfNodes);
+      iter.AppendList(TrivialFunctor(), aOutArrayOfNodes);
     } else {
       // We don't want duplicates in aOutArrayOfNodes, so we use an
       // iterator/functor that only return nodes that are not already in
       // aOutArrayOfNodes.
       nsTArray<OwningNonNull<nsINode>> nodes;
       iter.AppendList(nsUniqueFunctor(aOutArrayOfNodes), nodes);
       aOutArrayOfNodes.AppendElements(nodes);
     }