Bug 1438193 - turn Accessible* in AccIterator into const, r=surkov
authorTokio Kajitsuka <kajitsuka-tokio@g.ecc.u-tokyo.ac.jp>
Fri, 04 May 2018 22:37:11 +0900
changeset 473133 a585d77f897ff1c669a426cd70f1deb6278ae56e
parent 473132 7507516552fe76d0d00d32917d88a0056e731fb5
child 473134 6ca277616782b019a0d5fd94f7f5c11bda17b7ef
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs1438193
milestone61.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 1438193 - turn Accessible* in AccIterator into const, r=surkov
accessible/base/AccIterator.cpp
accessible/base/AccIterator.h
--- a/accessible/base/AccIterator.cpp
+++ b/accessible/base/AccIterator.cpp
@@ -13,17 +13,17 @@
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // AccIterator
 ////////////////////////////////////////////////////////////////////////////////
 
-AccIterator::AccIterator(Accessible* aAccessible,
+AccIterator::AccIterator(const Accessible* aAccessible,
                          filters::FilterFuncPtr aFilterFunc) :
   mFilterFunc(aFilterFunc)
 {
   mState = new IteratorState(aAccessible);
 }
 
 AccIterator::~AccIterator()
 {
@@ -58,17 +58,17 @@ AccIterator::Next()
   }
 
   return nullptr;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccIterator::IteratorState
 
-AccIterator::IteratorState::IteratorState(Accessible* aParent,
+AccIterator::IteratorState::IteratorState(const Accessible* aParent,
                                           IteratorState *mParentState) :
   mParent(aParent), mIndex(0), mParentState(mParentState)
 {
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // RelatedAccIterator
--- a/accessible/base/AccIterator.h
+++ b/accessible/base/AccIterator.h
@@ -33,35 +33,35 @@ private:
 
 /**
  * Allows to iterate through accessible children or subtree complying with
  * filter function.
  */
 class AccIterator : public AccIterable
 {
 public:
-  AccIterator(Accessible* aRoot, filters::FilterFuncPtr aFilterFunc);
+  AccIterator(const Accessible* aRoot, filters::FilterFuncPtr aFilterFunc);
   virtual ~AccIterator();
 
   /**
    * Return next accessible complying with filter function. Return the first
    * accessible for the first time.
    */
   virtual Accessible* Next() override;
 
 private:
   AccIterator();
   AccIterator(const AccIterator&);
   AccIterator& operator =(const AccIterator&);
 
   struct IteratorState
   {
-    explicit IteratorState(Accessible* aParent, IteratorState* mParentState = nullptr);
+    explicit IteratorState(const Accessible* aParent, IteratorState* mParentState = nullptr);
 
-    Accessible* mParent;
+    const Accessible* mParent;
     int32_t mIndex;
     IteratorState* mParentState;
   };
 
   filters::FilterFuncPtr mFilterFunc;
   IteratorState* mState;
 };