Bug 1342303 part 6 - Remove nsCOMArray::Enumerate{Forwards,Backwards}. r?froydnj draft
authorXidorn Quan <me@upsuper.org>
Fri, 24 Feb 2017 21:37:07 +1100
changeset 489872 413aad310c5203429eb1ce1e578ad7b9c1f93b6d
parent 489871 b9a8be66e511f65cb9a2880557f8ca1c31748be0
child 547100 6f47ad101d27fbe0c8c418b41af7ddb4b9d0ca70
push id46926
push userxquan@mozilla.com
push dateSun, 26 Feb 2017 23:47:03 +0000
reviewersfroydnj
bugs1342303
milestone54.0a1
Bug 1342303 part 6 - Remove nsCOMArray::Enumerate{Forwards,Backwards}. r?froydnj MozReview-Commit-ID: GLappWGZdtz
layout/style/GroupRule.h
xpcom/ds/nsCOMArray.h
--- a/layout/style/GroupRule.h
+++ b/layout/style/GroupRule.h
@@ -53,17 +53,17 @@ public:
   virtual void SetStyleSheet(StyleSheet* aSheet) override;
 
 public:
   void AppendStyleRule(Rule* aRule);
 
   int32_t StyleRuleCount() const { return mRules.Count(); }
   Rule* GetStyleRuleAt(int32_t aIndex) const;
 
-  typedef IncrementalClearCOMRuleArray::nsCOMArrayEnumFunc RuleEnumFunc;
+  typedef bool (*RuleEnumFunc)(Rule* aElement, void* aData);
   bool EnumerateRulesForwards(RuleEnumFunc aFunc, void * aData) const;
 
   /*
    * The next three methods should never be called unless you have first
    * called WillDirty() on the parent stylesheet.  After they are
    * called, DidDirty() needs to be called on the sheet.
    */
   nsresult DeleteStyleRuleAt(uint32_t aIndex);
--- a/xpcom/ds/nsCOMArray.h
+++ b/xpcom/ds/nsCOMArray.h
@@ -339,34 +339,16 @@ public:
     nsCOMArray_base::ReplaceObjectAt(aObject, aIndex);
   }
   // nsTArray-compatible version
   void ReplaceElementAt(uint32_t aIndex, T* aElement)
   {
     nsCOMArray_base::ReplaceElementAt(aIndex, aElement);
   }
 
-  // Enumerator callback function. Return false to stop
-  // Here's a more readable form:
-  // bool enumerate(T* aElement, void* aData)
-  typedef bool (*nsCOMArrayEnumFunc)(T* aElement, void* aData);
-
-  // enumerate through the array with a callback.
-  bool EnumerateForwards(nsCOMArrayEnumFunc aFunc, void* aData)
-  {
-    return nsCOMArray_base::EnumerateForwards(nsBaseArrayEnumFunc(aFunc),
-                                              aData);
-  }
-
-  bool EnumerateBackwards(nsCOMArrayEnumFunc aFunc, void* aData)
-  {
-    return nsCOMArray_base::EnumerateBackwards(nsBaseArrayEnumFunc(aFunc),
-                                               aData);
-  }
-
   typedef int (*nsCOMArrayComparatorFunc)(T* aElement1, T* aElement2,
                                           void* aData);
 
   void Sort(nsCOMArrayComparatorFunc aFunc, void* aData)
   {
     nsCOMArray_base::Sort(nsBaseArrayComparatorFunc(aFunc), aData);
   }