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 125774 c4267242d766f8fdbd392cf375fd2b42aff99a4b
parent 125773 a5330daedbac163226d9d8458a1003fbd1b9eefc
child 125775 75157a7f9a06e3cc9e21fcb57d6c58e47564436b
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs796902
milestone20.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 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_*/