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

176 Коммитов

Автор SHA1 Сообщение Дата
Yulia Startsev 4f41dd7639 Bug 1800496 - Re-introduce ArrayView; r=asuth
ArrayView is a data structure I removed as part of the simplification of worker cancellation, as it was only used for this purpose in the entire code base. I am bringing it back now, as we are re-implementing that same behavior.

Differential Revision: https://phabricator.services.mozilla.com/D162218
2022-11-18 10:02:28 +00:00
Yulia Startsev 3a715a5b75 Bug 1742438 - Cleanup: Remove nsTArrayView; r=xpcom-reviewers,barret
This class is no longer used, after the removal from the WorkerScriptLoader. It can be removed,
unelss we want to keep it for future use. This cleanup is optional.

Differential Revision: https://phabricator.services.mozilla.com/D146305
2022-07-14 17:07:30 +00:00
Nika Layzell e90c239516 Bug 1497246 - Release-check aCount for underflow in ReplaceElementsAt, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D148456
2022-06-07 17:06:41 +00:00
Nika Layzell 1aa11ffed6 Bug 1754004 - Part 11: Simplify the IPCStream serialization API, r=asuth,necko-reviewers,kershaw
As serializing IPCStream no longer requires a manager or FileDescriptor array,
the arguments are no longer necessary, and can be removed. The AutoIPCStream
helper can also be removed, as managed actors are no longer used for
serialization, so a delayed start callback is not necessary.

The delayed start parameter is also removed from nsIIPCSerializableInputStream
instances, but is still present as `aAllowLazy` on the toplevel serialization
methods.

Differential Revision: https://phabricator.services.mozilla.com/D141048
2022-05-13 14:16:13 +00:00
Noemi Erli 45276205df Backed out 22 changesets (bug 1696894, bug 1759569, bug 1754031, bug 1759563, bug 1759572, bug 1754004) for causing leack failures CLOSED TREE
Backed out changeset 673ecd5337e1 (bug 1754004)
Backed out changeset ecbf5f3c51de (bug 1754004)
Backed out changeset fc6c39f56d21 (bug 1754004)
Backed out changeset 5b3d58fbaf9d (bug 1696894)
Backed out changeset 2e56c89cf55d (bug 1754004)
Backed out changeset b7723490f025 (bug 1754004)
Backed out changeset 1dfbf61ff5dd (bug 1754004)
Backed out changeset e73abb071bb3 (bug 1754004)
Backed out changeset f9abe4fbf501 (bug 1754004)
Backed out changeset ee7aeb631cd9 (bug 1754004)
Backed out changeset d66aacfcf983 (bug 1754004)
Backed out changeset 5c2872ad6912 (bug 1754004)
Backed out changeset e1ae48f30d2c (bug 1754004)
Backed out changeset 849b63707d7f (bug 1754004)
Backed out changeset 36563e3b1e04 (bug 1754004)
Backed out changeset ccb4be659107 (bug 1754004)
Backed out changeset 659581d4159b (bug 1754004)
Backed out changeset 611ea76d7a9c (bug 1754004)
Backed out changeset 9b24b561698c (bug 1759572)
Backed out changeset f820e0f209ff (bug 1759563)
Backed out changeset 8d82066fa181 (bug 1759569)
Backed out changeset a2835afab1ad (bug 1754031)
2022-05-11 06:16:25 +03:00
Nika Layzell 024c6e0c0a Bug 1754004 - Part 11: Simplify the IPCStream serialization API, r=asuth,necko-reviewers,kershaw
As serializing IPCStream no longer requires a manager or FileDescriptor array,
the arguments are no longer necessary, and can be removed. The AutoIPCStream
helper can also be removed, as managed actors are no longer used for
serialization, so a delayed start callback is not necessary.

The delayed start parameter is also removed from nsIIPCSerializableInputStream
instances, but is still present as `aAllowLazy` on the toplevel serialization
methods.

Differential Revision: https://phabricator.services.mozilla.com/D141048
2022-05-10 22:27:46 +00:00
Sebastian Hengst 7ddbeea9d6 Backed out 17 changesets (bug 1696894, bug 1754004) for causing crashes e.g. bug 1767808, and hanging Gmail (bug 1767918). a=backout DONTBUILD
Backed out changeset 63f17a06eba9 (bug 1754004)
Backed out changeset 017e1552d549 (bug 1754004)
Backed out changeset 010dfd821cf3 (bug 1696894)
Backed out changeset 96a39c2ba7a3 (bug 1754004)
Backed out changeset a147df47a0e3 (bug 1754004)
Backed out changeset 9018dd592230 (bug 1754004)
Backed out changeset 234ff9e092c2 (bug 1754004)
Backed out changeset c4f1e86992b6 (bug 1754004)
Backed out changeset 51bd50b57dd5 (bug 1754004)
Backed out changeset d95e7ad0eafa (bug 1754004)
Backed out changeset 35a69828091c (bug 1754004)
Backed out changeset 6802a4326963 (bug 1754004)
Backed out changeset e40e810e18fc (bug 1754004)
Backed out changeset 82b38c12b298 (bug 1754004)
Backed out changeset 0a6cf0817bf5 (bug 1754004)
Backed out changeset 6d8e51b3e8d7 (bug 1754004)
Backed out changeset 2059c2d0d880 (bug 1754004)
2022-05-05 11:27:42 +02:00
Nika Layzell 57997381f5 Bug 1754004 - Part 11: Simplify the IPCStream serialization API, r=asuth,necko-reviewers,kershaw
As serializing IPCStream no longer requires a manager or FileDescriptor array,
the arguments are no longer necessary, and can be removed. The AutoIPCStream
helper can also be removed, as managed actors are no longer used for
serialization, so a delayed start callback is not necessary.

The delayed start parameter is also removed from nsIIPCSerializableInputStream
instances, but is still present as `aAllowLazy` on the toplevel serialization
methods.

Differential Revision: https://phabricator.services.mozilla.com/D141048
2022-05-03 23:30:36 +00:00
Butkovits Atila d0dadcb6f5 Backed out 19 changesets (bug 1759569, bug 1754004, bug 1759563, bug 1754031, bug 1696894, bug 1759572) for causing wpt failures. CLOSED TREE
Backed out changeset 110a8dce4b5d (bug 1696894)
Backed out changeset a62dab05c6cd (bug 1754004)
Backed out changeset 7cf122f6e19f (bug 1754004)
Backed out changeset 2aa9a0a9adbc (bug 1754004)
Backed out changeset cde16b2cdbfb (bug 1754004)
Backed out changeset 452fe0a15c99 (bug 1754004)
Backed out changeset eace8d4756ef (bug 1754004)
Backed out changeset 5e1fad91e935 (bug 1754004)
Backed out changeset eb6de0b1ab8e (bug 1754004)
Backed out changeset 1ac1908ed3d0 (bug 1754004)
Backed out changeset 473cad5b22ab (bug 1754004)
Backed out changeset 1923922be138 (bug 1754004)
Backed out changeset c7966d91f89e (bug 1754004)
Backed out changeset df5ce1f6712c (bug 1754004)
Backed out changeset a3f3f9761ada (bug 1754004)
Backed out changeset c8ec86e0a33b (bug 1759572)
Backed out changeset 6c102f8e3d4a (bug 1759563)
Backed out changeset bd3a2fcf4f0c (bug 1759569)
Backed out changeset 2541d8face65 (bug 1754031)
2022-05-03 06:00:22 +03:00
Nika Layzell d88dc7e3db Bug 1754004 - Part 11: Simplify the IPCStream serialization API, r=asuth,necko-reviewers,kershaw
As serializing IPCStream no longer requires a manager or FileDescriptor array,
the arguments are no longer necessary, and can be removed. The AutoIPCStream
helper can also be removed, as managed actors are no longer used for
serialization, so a delayed start callback is not necessary.

The delayed start parameter is also removed from nsIIPCSerializableInputStream
instances, but is still present as `aAllowLazy` on the toplevel serialization
methods.

Differential Revision: https://phabricator.services.mozilla.com/D141048
2022-05-02 20:44:26 +00:00
Mike Hommey 8d477f6105 Bug 1764705 - Add missing #include <algorithm> for std::stable_sort. r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D143693
2022-04-14 22:18:26 +00:00
Nika Layzell 7743d4fd62 Bug 1761536 - Part 2: Replace nsTArray::elem_type with value_type, r=mccr8
There weren't that many uses of the existing typedef, so it seemed like
it might be worthwhile to just replace all uses of the previous typedef
with the stl-like one.

Differential Revision: https://phabricator.services.mozilla.com/D142705
2022-04-01 17:00:25 +00:00
Nika Layzell 98fc25db17 Bug 1761536 - Part 1: Add a `value_type` typedef to nsTArray, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D142607
2022-04-01 17:00:25 +00:00
Brad Werth 7409cb410c Bug 1738107 Part 1: Remove deprecated std::iterator from nsTArrayBackInserter. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D130311
2021-11-08 22:12:44 +00:00
Jesse Schwartzentruber 512463417e Bug 1624717 - Copy release mode bounds checking from nsTArray to Array r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D124833
2021-09-09 13:29:18 +00:00
Nika Layzell eaa7724180 Bug 1714226 - Return the number of removed elements from nsTArray::RemoveElementsBy, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D116664
2021-06-22 18:17:17 +00:00
Butkovits Atila 83f57b5c69 Backed out 22 changesets (bug 1714226, bug 1706374, bug 1713148) for causing build bustages on MessageChannel.cpp. CLOSED TREE
Backed out changeset ea469eaa54ca (bug 1713148)
Backed out changeset fd8523d5126e (bug 1713148)
Backed out changeset f2e5309c914c (bug 1713148)
Backed out changeset 2da57973ed55 (bug 1713148)
Backed out changeset 677e1ee99bb2 (bug 1713148)
Backed out changeset b4c0619e79bf (bug 1706374)
Backed out changeset c02fa459e77d (bug 1706374)
Backed out changeset 72dc6537cf0b (bug 1706374)
Backed out changeset 48088463c656 (bug 1706374)
Backed out changeset b09ae4c3a94b (bug 1706374)
Backed out changeset 04422175004b (bug 1706374)
Backed out changeset 110b2384e7d1 (bug 1706374)
Backed out changeset ab2b086abbd4 (bug 1706374)
Backed out changeset ffde07f73249 (bug 1706374)
Backed out changeset c6303af17ff4 (bug 1706374)
Backed out changeset 02249671c2f9 (bug 1706374)
Backed out changeset a6a5d05b5636 (bug 1706374)
Backed out changeset e21b6defb805 (bug 1706374)
Backed out changeset c72c5be9ddb1 (bug 1706374)
Backed out changeset 23cd961575a6 (bug 1706374)
Backed out changeset b412d6e9e145 (bug 1706374)
Backed out changeset a8ec285d6472 (bug 1714226)
2021-06-22 04:03:56 +03:00
Nika Layzell 55b81f9748 Bug 1714226 - Return the number of removed elements from nsTArray::RemoveElementsBy, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D116664
2021-06-21 21:53:05 +00:00
Simon Giesecke 15d3d060cf Bug 1184468 - Use nsTHashtable::Keys where possible in netwerk. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D106950
2021-03-24 17:51:12 +00:00
Simon Giesecke 5b5b39393f Bug 1184468 - Add To(T)Array functions that materialize a range into an array. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D109056
2021-03-24 17:51:11 +00:00
Csoregi Natalia f54ee076ae Backed out 13 changesets (bug 708901, bug 1184468) for causing build bustage on GeckoViewHistory.cpp. CLOSED TREE
Backed out changeset b1e4c01e63b8 (bug 708901)
Backed out changeset 37b52cce83c0 (bug 708901)
Backed out changeset eee75f33f060 (bug 708901)
Backed out changeset 479bf64c7986 (bug 708901)
Backed out changeset 15a8fb94d15d (bug 708901)
Backed out changeset be31ccd9a61d (bug 708901)
Backed out changeset fc54f4eaedd5 (bug 708901)
Backed out changeset 03c3a56c3d13 (bug 708901)
Backed out changeset 73f11d3c1298 (bug 708901)
Backed out changeset aed22fd80893 (bug 708901)
Backed out changeset 74d8249fbe7e (bug 708901)
Backed out changeset acb725eb3c1d (bug 1184468)
Backed out changeset 70f3ea6efec4 (bug 1184468)
2021-03-24 19:26:20 +02:00
Simon Giesecke 8aaa3daac8 Bug 1184468 - Use nsTHashtable::Keys where possible in netwerk. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D106950
2021-03-24 16:58:57 +00:00
Simon Giesecke 5a92e6d185 Bug 1184468 - Add To(T)Array functions that materialize a range into an array. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D109056
2021-03-24 16:58:56 +00:00
Gerald Squelart 9250fa99a8 Bug 1699923 - Revert changes to nsTArrayBackInserter::operator=. r=gerald,masayuki a=bustage-fix DONTBUILD
The changes to nsTArrayBackInserter::operator= broke the builds on Windows
under some circumstances. This reverts those changes. Necessary adaptations
in the stack are made in later patch.

Differential Revision: https://phabricator.services.mozilla.com/D109276
2021-03-22 09:11:03 +00:00
Simon Giesecke 3206cac123 Bug 1184468 - Add nsTHashtable::Keys function to get a STL-style range of keys. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D106949
2021-03-19 17:27:28 +00:00
Simon Giesecke 4c057f184c Bug 1692123 - Refactor and improve documentation of nsTArray_RelocateUsingMoveConstructor. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D105454
2021-03-02 08:28:25 +00:00
Simon Giesecke 8924394252 Bug 1676363 - Remove dependency of nsTArray on nsCycleCollectionChild. r=#xpcom-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D96547

Depends on D96546
2020-11-23 16:09:49 +00:00
Sylvestre Ledru c320561565 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D89392
2020-09-08 04:32:00 +00:00
Nathan Froyd e199f12eb0 Bug 1662707 - add HasEmptyHeader function and use it in various nsTArray places; r=xpcom-reviewers,sg
One small step to removing that ugly `const_cast`.

Differential Revision: https://phabricator.services.mozilla.com/D89122
2020-09-02 17:42:56 +00:00
Razvan Maries a842c56a74 Backed out changeset 52ecdec7fb73 (bug 1662707) for perma failures on nsTArray. CLOSED TREE 2020-09-02 18:14:25 +03:00
Nathan Froyd 1fdcd48ad2 Bug 1662707 - add HasEmptyHeader function and use it in various nsTArray places; r=xpcom-reviewers,sg
One small step to removing that ugly `const_cast`.

Differential Revision: https://phabricator.services.mozilla.com/D89122
2020-09-02 14:18:55 +00:00
Razvan Maries e2dfb936e9 Backed out changeset 3c92e174f301 (bug 1662707) for build bustages on nsTArray.h. CLOSED TREE 2020-09-02 17:09:28 +03:00
Nathan Froyd e4edab469b Bug 1662707 - add HasEmptyHeader function and use it in various nsTArray places; r=xpcom-reviewers,sg
One small step to removing that ugly `const_cast`.

Differential Revision: https://phabricator.services.mozilla.com/D89122
2020-09-02 12:13:23 +00:00
Nathan Froyd b1cdc612da Bug 1243463 - make `sEmptyTArrayHeader` const; r=mccr8
We fixed what I think is the lone instance of writing into the (empty)
header in `SetLength` because it was causing TSan violations, so we should
be clear to make this `const`.  This change is not terribly effective on its
own (cf. the `const_cast` required to make this work at all), but in the
next patch, we can rig up `sEmptyTArrayHeader` to be surrounded with "guard
pages" and make rogue accesses off the array header a little more protected.

Differential Revision: https://phabricator.services.mozilla.com/D88657
2020-09-01 18:10:27 +00:00
Simon Giesecke de65a11548 Bug 1656924 - Simplify nsTArray::Assign copying from another array. r=xpcom-reviewers,nika
nsTArray_Impl::Assign/operator= copying from another array cause code bloat by
using ReplaceElementsAtInternal without exploiting the knowledge that the whole
array is being replaced. Since for many instances of the class template, this
is the only ReplaceElementsAtInternal call being done, this unnecessary bloats
the generated code. Apart from that, it is suboptimal at runtime due to
unnecessary checks.

Furthermore, the implementation of ReplaceElementsAtInternal may unnecessarily
relocate the existing elements before destroying them if the storage needs to
be reallocated. While this could be optimized in ReplaceElementsAtInternal as
well, it is simpler to do so in the specialized AssignInternal that is now
introduced.

Differential Revision: https://phabricator.services.mozilla.com/D86723
2020-08-17 07:02:50 +00:00
Simon Giesecke 1a9da56b94 Bug 1653335 - Get rid of MakeSpan functions. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D83818
2020-08-07 07:50:04 +00:00
Simon Giesecke 1e02318b49 Bug 1653335 - Replace MakeSpan uses by constructor calls. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D83817
2020-08-07 07:49:47 +00:00
Simon Giesecke e22ce08596 Bug 1654991 - Simplify moving operator=, Assign and AppendElements. r=froydnj
The mentioned array operations were implemented using SwapElements, which is a
rather generic and therefore complex method (in the sense of template
instantiation and code generation), which doesn't make use of the knowledge that
the target array is empty and does not have any allocated heap storage.
Similar to the introduction of MoveConstructNonAutoArray, a new method, MoveInit,
is introduced that uses this knowledge.

Differential Revision: https://phabricator.services.mozilla.com/D84806
2020-08-04 11:22:34 +00:00
Simon Giesecke c082222bc8 Bug 1654991 - Provide and use special case of ShrinkCapacityToZero. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84805
2020-08-04 11:22:21 +00:00
Simon Giesecke e0b51e4a84 Bug 1654991 - Simplify move constructor of nsTArray_Impl. r=froydnj
The move constructor of nsTArray_Impl (and therefore of nsTArray) was
implemented using SwapElements, which is a rather generic and therefore
complex method (in the sense of template instantiation and code generation),
which doesn't make use of the knowledge that the target array does not have
inline storage and is empty with 0 capacity. Therefore, a new specialized method,
MoveConstructNonAutoArray, is introduced that does use this knowledge. This
adds another method to maintain, but given that the move constructor is a
frequently used operation that is expected to have a small compile-time and
run-time cost (potentially used implicitly), this seems like a reasonable
trade-off.

Differential Revision: https://phabricator.services.mozilla.com/D84804
2020-08-04 11:22:09 +00:00
Noemi Erli 381fca9783 Backed out 4 changesets (bug 1654992, bug 1654991) for causing timeous in mask-opacity-1e.html
Backed out changeset 11f0f54c6e0a (bug 1654992)
Backed out changeset a353dd5b3f08 (bug 1654991)
Backed out changeset 6a7964ba549f (bug 1654991)
Backed out changeset cf3bfb91d98c (bug 1654991)
2020-08-03 22:09:36 +03:00
Simon Giesecke 3db287778f Bug 1654991 - Simplify moving operator=, Assign and AppendElements. r=froydnj
The mentioned array operations were implemented using SwapElements, which is a
rather generic and therefore complex method (in the sense of template
instantiation and code generation), which doesn't make use of the knowledge that
the target array is empty and does not have any allocated heap storage.
Similar to the introduction of MoveConstructNonAutoArray, a new method, MoveInit,
is introduced that uses this knowledge.

Differential Revision: https://phabricator.services.mozilla.com/D84806
2020-08-03 15:14:42 +00:00
Simon Giesecke 45b8036770 Bug 1654991 - Provide and use special case of ShrinkCapacityToZero. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84805
2020-08-03 14:47:54 +00:00
Simon Giesecke fcbd7f145f Bug 1654991 - Simplify move constructor of nsTArray_Impl. r=froydnj
The move constructor of nsTArray_Impl (and therefore of nsTArray) was
implemented using SwapElements, which is a rather generic and therefore
complex method (in the sense of template instantiation and code generation),
which doesn't make use of the knowledge that the target array does not have
inline storage and is empty with 0 capacity. Therefore, a new specialized method,
MoveConstructNonAutoArray, is introduced that does use this knowledge. This
adds another method to maintain, but given that the move constructor is a
frequently used operation that is expected to have a small compile-time and
run-time cost (potentially used implicitly), this seems like a reasonable
trade-off.

Differential Revision: https://phabricator.services.mozilla.com/D84804
2020-08-03 15:14:38 +00:00
Simon Giesecke 0f6236401d Bug 1650749 - Mention tri-state comparison functor in documentation of Comparator. r=TYLin,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D82334
2020-07-17 08:38:31 +00:00
Simon Giesecke 6b1107803f Bug 1649770 - Check for tainted array in RemoveElementsBy. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D81867
2020-07-01 17:13:36 +00:00
Simon Giesecke dc25d4ae8f Bug 1147091 - Add StableSort to nsTArray_Impl. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D81857
2020-07-01 13:25:02 +00:00
Simon Giesecke 89f394789a Bug 1648705 - Add nsTArrayView. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D81294
2020-06-26 16:00:51 +00:00
Simon Giesecke 8d168248fa Bug 1645386 - Use nsTObserverArray::NonObservingRange where possible instead of ForwardRange. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D79507
2020-06-22 08:21:24 +00:00
Simon Giesecke 8c0f977ccd Bug 1645429 - Use std::reverse_iterator instead of mozilla::ReverseIterator where possible. r=froydnj
mozilla::ReverseIterator is required for "stashing iterators", but otherwise
std::reverse_iterator can be used and is potentially more efficient.

Also fix some other glitches in iterator type definitions.

Differential Revision: https://phabricator.services.mozilla.com/D79489
2020-06-16 10:14:01 +00:00