Bug 796902 - Part a: Make nsPaintRequestList hold a list of nsPaintRequests instead of nsIDOMPaintRequests; r=bent
authorMs2ger <ms2ger@gmail.com>
Sat, 22 Dec 2012 09:04:33 +0100
changeset 116672 c4267242d766f8fdbd392cf375fd2b42aff99a4b
parent 116671 a5330daedbac163226d9d8458a1003fbd1b9eefc
child 116673 75157a7f9a06e3cc9e21fcb57d6c58e47564436b
push idunknown
push userunknown
push dateunknown
reviewersbent
bugs796902
milestone20.0a1
Bug 796902 - Part a: Make nsPaintRequestList hold a list of nsPaintRequests instead of nsIDOMPaintRequests; r=bent
content/events/src/nsPaintRequest.h
--- a/content/events/src/nsPaintRequest.h
+++ b/content/events/src/nsPaintRequest.h
@@ -45,17 +45,20 @@ public:
   
   virtual JSObject* WrapObject(JSContext *cx, JSObject *scope,
                                bool *triedToWrap);
   nsISupports* GetParentObject()
   {
     return mParent;
   }
 
-  void Append(nsIDOMPaintRequest* aElement) { mArray.AppendObject(aElement); }
+  void Append(nsPaintRequest* aElement)
+  {
+    mArray.AppendElement(aElement);
+  }
 
   static nsPaintRequestList* FromSupports(nsISupports* aSupports)
   {
 #ifdef DEBUG
     {
       nsCOMPtr<nsIDOMPaintRequestList> list_qi = do_QueryInterface(aSupports);
 
       // If this assertion fires the QI implementation for the object in
@@ -66,29 +69,29 @@ public:
     }
 #endif
 
     return static_cast<nsPaintRequestList*>(aSupports);
   }
 
   uint32_t Length()
   {
-    return mArray.Count();
+    return mArray.Length();
   }
 
-  nsIDOMPaintRequest* Item(uint32_t aIndex)
+  nsPaintRequest* Item(uint32_t aIndex)
   {
-    return mArray.SafeObjectAt(aIndex);
+    return mArray.SafeElementAt(aIndex);
   }
-  nsIDOMPaintRequest* IndexedGetter(uint32_t aIndex, bool& aFound)
+  nsPaintRequest* IndexedGetter(uint32_t aIndex, bool& aFound)
   {
-    aFound = aIndex < static_cast<uint32_t>(mArray.Count());
-    return aFound ? mArray.ObjectAt(aIndex) : nullptr;
+    aFound = aIndex < mArray.Length();
+    return aFound ? mArray.ElementAt(aIndex) : nullptr;
   }
 
 private:
   ~nsPaintRequestList() {}
 
-  nsCOMArray<nsIDOMPaintRequest> mArray;
+  nsTArray< nsRefPtr<nsPaintRequest> > mArray;
   nsCOMPtr<nsIDOMEvent> mParent;
 };
 
 #endif /*NSPAINTREQUEST_H_*/