Граф коммитов

34 Коммитов

Автор SHA1 Сообщение Дата
Nicholas Nethercote af281df032 Bug 1587176 - Fix UBSAN complaints about nsCOMArray. r=erahm
nsCOMArray currently casts a function that takes two `void` pointers into a
function that takes two `nsISupports` pointers. UBSAN doesn't like this.

This commit introduces an extra level of casting machinery. As a result, each
comparison done while sorting goes through an extra level, to get from `(T*,
T*)` comparisons to `(nsISupports*, nsISupports*)` comparisons to `(void*,
void*)` comparisons, as required by `NS_QuickSort()`. It's a bit annoying but I
can't see how else to solve this within the constraint imposed by the existing
`nsCOMArray_base`/`nsCOMArray` split.

Differential Revision: https://phabricator.services.mozilla.com/D51223

--HG--
extra : moz-landing-system : lando
2019-11-05 00:14:10 +00:00
Nicholas Nethercote aa1586413a Bug 1587176 - Rename some nsCOMArray internal stuff. r=erahm
This makes the subsequent commit easier to understand.

Differential Revision: https://phabricator.services.mozilla.com/D51222

--HG--
extra : moz-landing-system : lando
2019-11-05 00:12:06 +00:00
Boris Zbarsky cbf64dc6ab Bug 1551782. Remove now-unused nsCOMArray::Forget and nsCOMArray::Adopt methods. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D31246

--HG--
extra : moz-landing-system : lando
2019-05-16 15:13:44 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Emilio Cobos Álvarez fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Xidorn Quan 01addcd50e Bug 1342303 part 6 - Remove nsCOMArray::Enumerate{Forwards,Backwards}. r=erahm
MozReview-Commit-ID: GLappWGZdtz

--HG--
extra : rebase_source : 0c191193ff5a6040a809d17ac234b5e9e733656e
2017-02-24 21:37:07 +11:00
Xidorn Quan 5068cf4922 Bug 1342303 part 2 - Add range-based for loop support to nsCOMArray. r=erahm
MozReview-Commit-ID: 7T8Z0PVg2ex

--HG--
extra : rebase_source : 8108344d6607145b231e20d82cf2b3792ce5a4bd
2017-02-24 21:31:15 +11:00
Wes Kocher 5bb9a497ef Backed out 6 changesets (bug 1342303) for build bustage a=backout
Backed out changeset 89137679a68c (bug 1342303)
Backed out changeset 20a1bcb47c33 (bug 1342303)
Backed out changeset bc3b2e7a383b (bug 1342303)
Backed out changeset bdc491b9ebde (bug 1342303)
Backed out changeset 5c6042dee665 (bug 1342303)
Backed out changeset b5de1dfff82f (bug 1342303)

MozReview-Commit-ID: BjlVAX480jI
2017-03-02 16:35:43 -08:00
Xidorn Quan 1297589623 Bug 1342303 part 6 - Remove nsCOMArray::Enumerate{Forwards,Backwards}. r=erahm
MozReview-Commit-ID: GLappWGZdtz

--HG--
extra : rebase_source : 72ebafcbf89b8fce123101d23c3d65bbc8c3bdff
2017-02-24 21:37:07 +11:00
Xidorn Quan 9fba97cea0 Bug 1342303 part 2 - Add range-based for loop support to nsCOMArray. r=erahm
MozReview-Commit-ID: 7T8Z0PVg2ex

--HG--
extra : rebase_source : 8108344d6607145b231e20d82cf2b3792ce5a4bd
2017-02-24 21:31:15 +11:00
Benjamin Smedberg 2b3617b084 Bug 1332631 part C - file moves from xpcom/glue to xpcom/ds, r=froydnj
MozReview-Commit-ID: 9ZhC5bROWdO

--HG--
rename : xpcom/glue/Observer.h => xpcom/ds/Observer.h
rename : xpcom/glue/PLDHashTable.cpp => xpcom/ds/PLDHashTable.cpp
rename : xpcom/glue/PLDHashTable.h => xpcom/ds/PLDHashTable.h
rename : xpcom/glue/nsArrayEnumerator.cpp => xpcom/ds/nsArrayEnumerator.cpp
rename : xpcom/glue/nsArrayEnumerator.h => xpcom/ds/nsArrayEnumerator.h
rename : xpcom/glue/nsArrayUtils.cpp => xpcom/ds/nsArrayUtils.cpp
rename : xpcom/glue/nsArrayUtils.h => xpcom/ds/nsArrayUtils.h
rename : xpcom/glue/nsBaseHashtable.h => xpcom/ds/nsBaseHashtable.h
rename : xpcom/glue/nsCOMArray.cpp => xpcom/ds/nsCOMArray.cpp
rename : xpcom/glue/nsCOMArray.h => xpcom/ds/nsCOMArray.h
rename : xpcom/glue/nsClassHashtable.h => xpcom/ds/nsClassHashtable.h
rename : xpcom/glue/nsDataHashtable.h => xpcom/ds/nsDataHashtable.h
rename : xpcom/glue/nsDeque.cpp => xpcom/ds/nsDeque.cpp
rename : xpcom/glue/nsDeque.h => xpcom/ds/nsDeque.h
rename : xpcom/glue/nsEnumeratorUtils.cpp => xpcom/ds/nsEnumeratorUtils.cpp
rename : xpcom/glue/nsEnumeratorUtils.h => xpcom/ds/nsEnumeratorUtils.h
rename : xpcom/glue/nsHashKeys.h => xpcom/ds/nsHashKeys.h
rename : xpcom/glue/nsInterfaceHashtable.h => xpcom/ds/nsInterfaceHashtable.h
rename : xpcom/glue/nsJSThingHashtable.h => xpcom/ds/nsJSThingHashtable.h
rename : xpcom/glue/nsPointerHashKeys.h => xpcom/ds/nsPointerHashKeys.h
rename : xpcom/glue/nsQuickSort.cpp => xpcom/ds/nsQuickSort.cpp
rename : xpcom/glue/nsQuickSort.h => xpcom/ds/nsQuickSort.h
rename : xpcom/glue/nsRefPtrHashtable.h => xpcom/ds/nsRefPtrHashtable.h
rename : xpcom/glue/nsTArray-inl.h => xpcom/ds/nsTArray-inl.h
rename : xpcom/glue/nsTArray.cpp => xpcom/ds/nsTArray.cpp
rename : xpcom/glue/nsTArray.h => xpcom/ds/nsTArray.h
rename : xpcom/glue/nsTArrayForwardDeclare.h => xpcom/ds/nsTArrayForwardDeclare.h
rename : xpcom/glue/nsTHashtable.h => xpcom/ds/nsTHashtable.h
rename : xpcom/glue/nsTObserverArray.cpp => xpcom/ds/nsTObserverArray.cpp
rename : xpcom/glue/nsTObserverArray.h => xpcom/ds/nsTObserverArray.h
rename : xpcom/glue/nsTPriorityQueue.h => xpcom/ds/nsTPriorityQueue.h
extra : rebase_source : 5f0638e3268acb932e1a8d3f499d283bc1922acd
extra : histedit_source : dcea9485885877bb02f95a1ecc627465a507f757
2017-01-20 13:59:21 -05:00
bsmedberg%covad.net 7112d805ca Bug 289010 - Move nsVoidArray/nsCOMArray to the XPCOM glue, and a few other things to make the glue easier to use, r=shaver+darin . The following files were CVS-copied from xpcom/ds to xpcom/glue: nsVoidArray.h nsVoidArray.cpp nsCOMArray.h nsCOMArray.cpp nsQuickSort.h nsQuickSort.cpp 2005-11-02 20:39:39 +00:00
gerv%gerv.net c9e600ac91 Bug 236613: change to MPL/LGPL/GPL tri-license. 2005-02-01 15:28:15 +00:00
dbaron%dbaron.org 3118860f30 Add nsVoidArray::FastElementAt that requires the caller to do bounds checks (0 <= aIndex < Count()). Make ElementAt a little safer without loss of speed (back to the old safety). Make nsCOMArray<T>::ObjectAt use FastElementAt. b=96108 r=darin 2004-09-14 17:17:21 +00:00
timeless%mozdev.org d8323ba73f Bug 106386 Correct misspellings in source code
Changes strings which meant "referring"
patch by ajvincent@juno.com r=timeless sr=dmose
2003-11-17 10:05:45 +00:00
sicking%bigfoot.com 56ad1b1cba Bug 225507: Implement nsCOMArray::SafeObjectAt for out-of-bounds safe access.
r=bryner sr=alecf
2003-11-13 17:01:20 +00:00
bsmedberg%covad.net 2034fc15f9 Bug 212222 - Load default prefs from the GRE and from the application. r/sr=alecf/darin
NOTE: This is only the backend work necessary to load prefs. The actual separation of prefs into application/embedding will happen in another bug.
2003-11-03 16:46:13 +00:00
dbaron%dbaron.org 3ca027dcc3 nsCOMArray should not use nsDerivedSafe. b=221525 r=bryner 2003-10-07 23:17:58 +00:00
dougt%meer.net 1d91b8a1dd add Sort() to nsCOMArray. Patch from ari the_great_spam_bin@yahoo.com. r=alecf, b=211535 2003-10-07 05:42:28 +00:00
neil%parkwaycc.co.uk 25738e0473 Bug 198685 need nsCOMArray function like IndexOf that checks COM object identity p=bsmedberg@covad.net r=alecf (no sr needed) 2003-03-25 13:16:02 +00:00
sicking%bigfoot.com 5ff462a000 Bug 162115: Make nsCOMArray return nsDeriviedSafes to avoid bad addrefs/releases
r=bz sr=alecf
2003-01-18 14:04:23 +00:00
bzbarsky%mit.edu 7e9b235805 Make the nsCOMArray destructor release all the objects. Bug 178813,
r=bbaetz, sr=rpotts
2002-11-07 13:34:18 +00:00
mkaply%us.ibm.com 38cc1792a7 #177543
r=me, sr=bz
OS/2 build bustage - add explicit casts
2002-11-07 04:48:56 +00:00
bzbarsky%mit.edu e1ecd5f25d Add AppendObjects/InsertObjectsAt to nsCOMArray. Bug 175137,
r=timeless, sr=alecf, a=dbaron
2002-10-25 01:40:50 +00:00
bzbarsky%mit.edu 58a7681df2 Make IndexOf a const method. Bug 174940, r=dougt, sr=alecf 2002-10-17 19:26:27 +00:00
varga%netscape.com 54b5577b97 Fix for bug 174443. nsCOMArray::ApendObject() shouldn't addref
r=dougt, sr=alecf, a=asa
2002-10-15 23:59:20 +00:00
bbaetz%student.usyd.edu.au 35ddc78531 Change the never-defined copy-constructor signature to refer to nsCOMArray<T>
instead of nsCOMArray. Should fix OS2 bustage, which noticed this because
it instantiates the function even when its not used
r=sicking, sr=mozbot, a=tinderbox
2002-10-15 05:19:30 +00:00
alecf%netscape.com 1bae8680e1 more work on bug 162115 - use "friend" to allow nsCOMArray<T>'s copy constructor to be protected, but still usable from nsArray
not part of build
2002-10-02 18:54:12 +00:00
alecf%netscape.com 101b6c67d1 add support for a nsISimpleEnumerator implementation for nsCOMArray<T> and nsIArray, and update existing interfaces to support that:
- move nsCOMArray_base's ObjectAt/[]/Count() methods into the public so that nsCOMArrayEnumerator can get to it
- tweak NS_NewArray() to match the existing enumerator NS_New* API
- hook up NS_NewArrayEnumerator to nsArray::Enumerate
Not part of the build, for bug 162115
2002-10-01 17:34:25 +00:00
alecf%netscape.com 7c8eb9e9d2 - fix ReplaceObjectAt to properly account for existing null entries
- make nsCOMArray_base accessible from nsCOMArray<T> so that a nsCOMArray<T> can passed to NS_NewArray
for bug 162115, not part of build
2002-10-01 00:37:41 +00:00
alecf%netscape.com 950bb44445 not part of build, more for bug 162115:
- fix some spelling, add documentation
- add NS_NewArray(), including one that takes an existing nsCOMArray<T>
- implement copy constructor for nsCOMArray_base, so that NS_NewArray can work
not part of build
2002-09-30 23:02:31 +00:00
alecf%netscape.com 4b31552c74 match up some reviewers comments:
- tri-license with MPL, not NPL
- be consistent with policy on null in the array (it is allowed)
- move Clear() into implementation file, and hide static callback there too
- make sure to AddRef() on the way out of nsArray::IndexOf()
- handle failure of ReplaceElementAt more gracefully
bug 162115, not part of build yet
2002-09-30 22:01:46 +00:00
alecf%netscape.com 8d1e0ebc54 continuing work in progress on nsCOMArray<T> - take darin's suggestion and move all nsISupports-related code into a non-template base class nsCOMArray_base. This allows the generated template to be paper thin (or really, non-existent!)
Then, we move some of the non-trivial methods of this class into a .cpp file
2002-09-27 19:29:45 +00:00
alecf%netscape.com 5274331b83 continue work-in-progress with freezable array.
Also introduce nsCOMArray<nsIFoo>
not part of build
2002-09-27 06:08:49 +00:00