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

2253 Коммитов

Автор SHA1 Сообщение Дата
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Christian Holler d105e402b1 no bug - TSan library excludes miss libdconfsettings. r=Gankro
Differential Revision: https://phabricator.services.mozilla.com/D93506
2020-10-14 19:35:24 +00:00
Cameron McCormack cff9802c01 Bug 1656114 - Part 2: Add mozilla::BitSet. r=froydnj
Adding this to be used when the bit set needs to be sent across IPC.

Differential Revision: https://phabricator.services.mozilla.com/D87186
2020-10-11 22:03:33 +00:00
Sylvestre Ledru d9cd198ba1 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,necko-reviewers,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D92459
2020-10-06 16:12:00 +00:00
Simon Giesecke bd5cfda423 Bug 1669421 - Make andThen accept a function that accepts a rvalue reference. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D92552
2020-10-06 09:03:14 +00:00
Paul Bone e4588196e4 Bug 1668421 - Fix a commeint in fallible.h r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D92017
2020-10-05 00:50:31 +00:00
Alexis Beingessner dc6f1e5b44 Bug 1668750 - manually expand JammedWithFlags tests for compat with clang-cl-9. r=decoder
I have no idea what the issue is, but this fixes it. I figure it's not
worth putting too much effort into since this was just to make the tests
as DRY as possible, and not actually important.

Differential Revision: https://phabricator.services.mozilla.com/D92237
2020-10-02 15:00:28 +00:00
Alexis Beingessner 4484175a12 Bug 1601980 - Introduce a MOZ_ATOMIC_BITFIELDS macro. r=njn
Differential Revision: https://phabricator.services.mozilla.com/D91622
2020-10-01 08:25:15 +00:00
Simon Giesecke 67084ddd9b Bug 1666216 - Enable ScopedLogExtraInfo logging. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D90877
2020-09-30 08:24:18 +00:00
Simon Giesecke c711008a61 Bug 1666219 - Introduce QM_TRY_INSPECT to avoid unwrapping Result objects where not necessary. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D90843
2020-09-29 10:57:14 +00:00
Simon Giesecke e003e4d581 Bug 1667019 - Simplify moving of Results for PackingStrategy NullIsOk. r=emilio
No longer reset a moved-from Result to an error state, which required
UnusedZero<E>::GetDefaultValue, which was somewhat confusing, and might
also be inefficient. Leaving Result in a valid state, which might be a
success or error state is sufficient.

Differential Revision: https://phabricator.services.mozilla.com/D91250
2020-09-29 08:09:02 +00:00
Emilio Cobos Álvarez 3aa40e5fb9 Bug 1658571 - Add a missing "explicit" in a test.
MANUAL PUSH: unit test fix in CLOSED TREE
2020-09-24 19:51:46 +02:00
Emilio Cobos Álvarez 061fc9d988 Bug 1658571 - Add MainThreadWeakPtr and use it in PreloaderBase::RedirectSink. r=sg,smaug
Per matrix discussion, this is safer to uplift (instead of relying on
the RedirectSink being released on the main thread).

Differential Revision: https://phabricator.services.mozilla.com/D91270
2020-09-24 16:38:35 +00:00
Simon Giesecke 8804eb9be3 Bug 1666416 - Allow conversion from Result with convertible error type. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D90960
2020-09-22 11:24:08 +00:00
Simon Giesecke ccdc97d011 Bug 1666422 - Add missing include for cstdint. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D90963
2020-09-22 08:52:51 +00:00
Simon Giesecke 32f7547296 Bug 1666200 - Support in-place construction of Result success value. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D90839
2020-09-21 13:15:13 +00:00
Simon Giesecke 2b1eb28b6a Bug 1665927 - Use free LSB optimization for empty types with mozilla::Result. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D90699
2020-09-21 13:14:53 +00:00
Simon Giesecke c8ed33ab9d Bug 1665850 - Remove specifics for reference error types from mozilla::Result. r=emilio,jandem
Also update the documentation on optimizations and representation to
better reflect the current situation.

Differential Revision: https://phabricator.services.mozilla.com/D90662
2020-09-21 13:14:28 +00:00
Simon Giesecke eaa00050e4 Bug 1665850 - Switch JS to use non-reference errors with mozilla::Result. r=jandem
Also switch optimizations for HasFreeLSB and existing tests to no longer
use references.

Differential Revision: https://phabricator.services.mozilla.com/D90661
2020-09-21 13:14:10 +00:00
Simon Giesecke 2e065c64d6 Bug 1665614 - Make mozilla::Result work with non-copyable/non-param error types. r=emilio,jandem
Among other things, there were some misuses of std::forward, and
GenericErrorResult was (presumably accidentally) instatiated with
references as the template argument type, e.g. const nsresult&,
which circumvented the check for not calling it with NS_OK in
ResultExtensions.h

Differential Revision: https://phabricator.services.mozilla.com/D90561
2020-09-21 13:12:48 +00:00
Bogdan Tara 395ecea593 Backed out changeset a1e4531f2091 (bug 1666200) for TestResult.cpp related bustage CLOSED TREE 2020-09-21 15:55:42 +03:00
Simon Giesecke 2cf66d3f89 Bug 1666200 - Support in-place construction of Result success value. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D90839
2020-09-21 11:47:47 +00:00
Butkovits Atila 270e7e2200 Backed out 5 changesets (bug 1665927, bug 1665614, bug 1665850) for causing bustage on Result.h. CLOSED TREE
Backed out changeset 1467e76399e8 (bug 1665927)
Backed out changeset ebd4dfbc0a88 (bug 1665850)
Backed out changeset 5e23340e3b39 (bug 1665850)
Backed out changeset 5bc547e7a773 (bug 1665850)
Backed out changeset 8d88afb85a78 (bug 1665614)
2020-09-21 15:25:16 +03:00
Simon Giesecke 6b3d1793e7 Bug 1665927 - Use free LSB optimization for empty types with mozilla::Result. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D90699
2020-09-21 11:09:31 +00:00
Simon Giesecke f193981fb7 Bug 1665850 - Remove specifics for reference error types from mozilla::Result. r=emilio,jandem
Also update the documentation on optimizations and representation to
better reflect the current situation.

Differential Revision: https://phabricator.services.mozilla.com/D90662
2020-09-21 11:09:09 +00:00
Simon Giesecke 70bda1ef61 Bug 1665850 - Switch JS to use non-reference errors with mozilla::Result. r=jandem
Also switch optimizations for HasFreeLSB and existing tests to no longer
use references.

Differential Revision: https://phabricator.services.mozilla.com/D90661
2020-09-21 11:11:02 +00:00
Simon Giesecke 3b0420646e Bug 1665614 - Make mozilla::Result work with non-copyable/non-param error types. r=emilio,jandem
Among other things, there were some misuses of std::forward, and
GenericErrorResult was (presumably accidentally) instatiated with
references as the template argument type, e.g. const nsresult&,
which circumvented the check for not calling it with NS_OK in
ResultExtensions.h

Differential Revision: https://phabricator.services.mozilla.com/D90561
2020-09-21 10:38:19 +00:00
Simon Giesecke 0fef58f699 Bug 1664844 - Add DebugOnly::inspect member function. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D90133
2020-09-18 06:33:12 +00:00
Csoregi Natalia 2306d2079a Backed out 11 changesets (bug 1663924, bug 1664844) for multiple failures. CLOSED TREE
Backed out changeset 2da9fde7a109 (bug 1663924)
Backed out changeset 9353759cc783 (bug 1663924)
Backed out changeset 309354891d60 (bug 1663924)
Backed out changeset 4e51461c369c (bug 1663924)
Backed out changeset e3196b68932c (bug 1663924)
Backed out changeset 25b16cbae152 (bug 1664844)
Backed out changeset e02961ac5ee7 (bug 1663924)
Backed out changeset dde2058c20ef (bug 1663924)
Backed out changeset a80f52551e3a (bug 1663924)
Backed out changeset 0c37ce712c2c (bug 1663924)
Backed out changeset 8cc5dcc86f40 (bug 1663924)
2020-09-18 04:52:32 +03:00
Simon Giesecke db717b00e5 Bug 1664844 - Add DebugOnly::inspect member function. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D90133
2020-09-17 08:44:30 +00:00
Simon Giesecke 59cd4601d7 Bug 1663902 - Avoid gcc emitting lots of static constructors for UnusedZero<T&>::defaultValue. r=dmajor
Differential Revision: https://phabricator.services.mozilla.com/D90359
2020-09-16 13:58:49 +00:00
Razvan Maries 559e163f24 Backed out 9 changesets (bug 1663924, bug 1664844) for Linux Mochitests leaks. CLOSED TREE
Backed out changeset 8d28611ac9b2 (bug 1663924)
Backed out changeset e0b0b3a19544 (bug 1663924)
Backed out changeset 884e286909f9 (bug 1663924)
Backed out changeset ffed28f0b547 (bug 1664844)
Backed out changeset 4c22c3c8aa28 (bug 1663924)
Backed out changeset fcaed021597c (bug 1663924)
Backed out changeset 30394cbcaaf6 (bug 1663924)
Backed out changeset 014bcf5d13b9 (bug 1663924)
Backed out changeset ccf09dfa817a (bug 1663924)
2020-09-16 19:16:21 +03:00
Simon Giesecke ab0b7510ad Bug 1665026 - Prevent ToResultInvoke from being instantiated with a raw pointer result type. r=janv
Differential Revision: https://phabricator.services.mozilla.com/D90264
2020-09-16 15:11:56 +00:00
Simon Giesecke 7c10b87921 Bug 1664844 - Add DebugOnly::inspect member function. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D90133
2020-09-16 14:56:02 +00:00
Simon Giesecke 720fbb0265 Bug 1661404 - Add MOZ_TO_RESULT_INVOKE_TYPED macro. r=janv
Differential Revision: https://phabricator.services.mozilla.com/D90368
2020-09-16 10:18:19 +00:00
Gerald Squelart b3972fb3c4 Bug 1657033 - There is no more need for JSONWriteFunc::WriteLiteral - r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D86193
2020-09-14 01:48:39 +00:00
Gerald Squelart 782cf5d3ad Bug 1657033 - Use Span<const char> in JSONWriter - r=froydnj
In most situations, JSONWriter users already know string lengths (either directly, or through `nsCString` and friends), so we should keep this information through JSONWriter and not recompute it again.
This also allows using JSONWriter with sub-strings (e.g., from a bigger buffer), without having to create null-terminated strings.

Public JSONWriter functions have overloads that accept literal strings.

Differential Revision: https://phabricator.services.mozilla.com/D86192
2020-09-14 02:33:20 +00:00
Gerald Squelart 89b62c22de Bug 1657033 - Make `MakeStringSpan` constexpr - r=froydnj
MakeStringSpan("...") will be able to construct spans from string literals at compile time.

Differential Revision: https://phabricator.services.mozilla.com/D86190
2020-09-14 01:44:39 +00:00
Simon Giesecke 250dabd821 Bug 1663628 - Make Maybe::extract work with MOZ_NON_AUTOABLE type T. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D89445
2020-09-08 13:22:16 +00:00
Jan Varga d4d58eddc9 Bug 1663648 - Fix mozilla::Result::map's return type definition; r=dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D89457
2020-09-08 14:39:41 +00:00
Simon Giesecke 2d21df0e59 Bug 1661428 - Support PackingVariant::NullIsOk also with non-trivially-default-constructible V. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D88444
2020-09-03 14:14:41 +00:00
Simon Giesecke d85bd68479 Bug 1661457 - Add in-place constructor to CompactPair. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D88418
2020-09-02 17:56:35 +00:00
Simon Giesecke 5cacc3e1dc Bug 1661502 - Make Result move-only. r=froydnj,jandem
Differential Revision: https://phabricator.services.mozilla.com/D88443
2020-09-02 17:56:23 +00:00
Simon Giesecke bf7bd90871 Bug 1661497 - Make DebugOnly work with move-only value types. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D88442
2020-09-02 17:56:10 +00:00
Simon Giesecke bd28698eb3 Bug 1661428 - Use CompactPair instead of Variant for trivially default-constructible V and UnusedZero E. r=froydnj
It seems that the clang toolchain has trouble optimizing away the tag access in
a `mozilla::Variant`. Use of a `CompactPair` seems to be better when `E` is
small (all cases where `UnusedZero<E>` is true are small right now anyway).
While this doesn't change `sizeof(Result<V, E>)` in most cases, it makes
the generated code simpler/smaller: As of now, this reduce the overall VM size
of libxul.so by ca. 59K.

Without additional effort, this requires and leads to default-construction of
a `V` even in cases where it is never accessed, so this is restricted to
trivially default-constructible `V` for now.

This could be avoided by replacing  `CompactPair<V, E>` by
`CompactPair<AlignedStorage2<V>, E>`.

Differential Revision: https://phabricator.services.mozilla.com/D88393
2020-09-02 17:55:55 +00:00
Razvan Maries eae150a880 Backed out 5 changesets (bug 1661457, bug 1661428, bug 1661497, bug 1661502) for build bustages on Result.h. CLOSED TREE
Backed out changeset fbf42b3b51f3 (bug 1661428)
Backed out changeset 83f3f36d540f (bug 1661457)
Backed out changeset 8a9dce0d08ce (bug 1661502)
Backed out changeset 733df139089a (bug 1661497)
Backed out changeset fca770fc0956 (bug 1661428)
2020-09-02 19:44:47 +03:00
Simon Giesecke 261cda7f20 Bug 1661428 - Support PackingVariant::NullIsOk also with non-trivially-default-constructible V. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D88444
2020-09-02 16:31:43 +00:00
Simon Giesecke 156682b3c2 Bug 1661457 - Add in-place constructor to CompactPair. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D88418
2020-09-02 16:23:13 +00:00
Simon Giesecke d4179392a0 Bug 1661502 - Make Result move-only. r=froydnj,jandem
Differential Revision: https://phabricator.services.mozilla.com/D88443
2020-09-02 16:23:01 +00:00
Simon Giesecke 80d380f0ed Bug 1661497 - Make DebugOnly work with move-only value types. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D88442
2020-09-02 16:22:38 +00:00
Simon Giesecke d5f6d76c5a Bug 1661428 - Use CompactPair instead of Variant for trivially default-constructible V and UnusedZero E. r=froydnj
It seems that the clang toolchain has trouble optimizing away the tag access in
a `mozilla::Variant`. Use of a `CompactPair` seems to be better when `E` is
small (all cases where `UnusedZero<E>` is true are small right now anyway).
While this doesn't change `sizeof(Result<V, E>)` in most cases, it makes
the generated code simpler/smaller: As of now, this reduce the overall VM size
of libxul.so by ca. 59K.

Without additional effort, this requires and leads to default-construction of
a `V` even in cases where it is never accessed, so this is restricted to
trivially default-constructible `V` for now.

This could be avoided by replacing  `CompactPair<V, E>` by
`CompactPair<AlignedStorage2<V>, E>`.

Differential Revision: https://phabricator.services.mozilla.com/D88393
2020-09-02 16:22:25 +00:00
Kartikaya Gupta 49c359630a Bug 1661798 - Have the LinkedList destructor emit the buggy template specialization. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D88663
2020-08-28 20:07:26 +00:00
Simon Giesecke 1997b4ea0d Bug 1661083 - Support raw pointers with MOZ_TO_RESULT_INVOKE. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D88168
2020-08-28 15:50:49 +00:00
Simon Giesecke ff85972891 Bug 1661476 - Prevent Result<const V, E> or Result<V, const E> from being instantiated. r=froydnj
Also, remove the existing uses of Result<const nsCString, nsresult> in URLPreloader
and Result<CryptoScheme, const nsCString> in SampleIterator.

Differential Revision: https://phabricator.services.mozilla.com/D88419
2020-08-28 14:16:35 +00:00
Razvan Maries 7a010f17ae Backed out 11 changesets (bug 1661083, bug 1661085, bug 1661084) for build bustages on ResultExtensions.h. CLOSED TREE
Backed out changeset 962967831dd4 (bug 1661085)
Backed out changeset 8e61a7d2daf9 (bug 1661085)
Backed out changeset 1edbc081c9f0 (bug 1661085)
Backed out changeset c640f4126079 (bug 1661085)
Backed out changeset b5fc9ebaac12 (bug 1661085)
Backed out changeset 4e3faaadccb6 (bug 1661085)
Backed out changeset 522cdd011e03 (bug 1661085)
Backed out changeset 896e47fc24e3 (bug 1661085)
Backed out changeset bf4043d4ce8e (bug 1661085)
Backed out changeset d0162bb5012e (bug 1661084)
Backed out changeset f0e7db520938 (bug 1661083)
2020-08-28 16:27:58 +03:00
Simon Giesecke a7f224accb Bug 1661083 - Support raw pointers with MOZ_TO_RESULT_INVOKE. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D88168
2020-08-28 10:02:36 +00:00
Jan Varga ecaff7daea Bug 1659673 - Add the `mozilla::Result::orElse` method; r=froydnj,dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D87418
2020-08-24 14:44:50 +00:00
Jan Varga d749be0c59 Bug 1659660 - Improve documentation and testing for mozilla::Result::map and mozilla::Result::mapErr; r=froydnj,dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D87414
2020-08-20 11:04:12 +00:00
Butkovits Atila 850817430e Backed out 3 changesets (bug 1658874, bug 1658324, bug 1659660) for bustage at ActorsParent.cpp. CLOSED TREE
Backed out changeset b69e256013a3 (bug 1659660)
Backed out changeset 4939692a9047 (bug 1658874)
Backed out changeset e27fb7cd29fe (bug 1658324)
2020-08-20 13:57:20 +03:00
Jan Varga f66e9112b5 Bug 1659660 - Improve documentation and testing for mozilla::Result::map and mozilla::Result::mapErr; r=froydnj,dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D87414
2020-08-20 09:22:09 +00:00
Jeff Gilbert 0d33c47098 Bug 1656545 - Range cannot support nullptr with non-zero length. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D87528
2020-08-20 00:33:52 +00:00
Jan Varga 246bfa7db7 Bug 1659962 - Add additional MOZ_ARG_* macros; r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D87579
2020-08-19 14:31:40 +00:00
Jan Varga 8773058b99 Bug 1659909 - ToResultInvoke should also work with RefPtr/nsCOMPtr on win32; r=dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D87556
2020-08-19 14:34:06 +00:00
Eugen Sawin 9caff81fa1 Bug 1623715 - [4.1] Fix LinkedList::length() for a const context. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84543
2020-08-18 17:29:07 +00:00
Razvan Maries 1cad430a1a Backed out 7 changesets (bug 1623715) for build bustages on nsWindow.cpp. CLOSED TREE
Backed out changeset 9704afdeefb1 (bug 1623715)
Backed out changeset 2e7e298cfe27 (bug 1623715)
Backed out changeset 579df1a653ee (bug 1623715)
Backed out changeset 4361ef84e780 (bug 1623715)
Backed out changeset 898972ec680c (bug 1623715)
Backed out changeset a118a4d72bef (bug 1623715)
Backed out changeset 4ff55894774d (bug 1623715)
2020-08-18 18:38:43 +03:00
Eugen Sawin 9ee999f3c0 Bug 1623715 - [4.1] Fix LinkedList::length() for a const context. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84543
2020-08-18 14:37:27 +00:00
Dorel Luca 6e3ab7e5fa Backed out 7 changesets (bug 1623715) for Linting failure and android build bustage. CLOSED TREE
Backed out changeset c8ca1d1866e7 (bug 1623715)
Backed out changeset 1b7c3fb0da3b (bug 1623715)
Backed out changeset 4887dea37231 (bug 1623715)
Backed out changeset 47f3eb481909 (bug 1623715)
Backed out changeset 6e7ce9e5f89b (bug 1623715)
Backed out changeset ddff358f800e (bug 1623715)
Backed out changeset cd585490e79b (bug 1623715)
2020-08-18 00:20:24 +03:00
Eugen Sawin e7ef0233d7 Bug 1623715 - [4.1] Fix LinkedList::length() for a const context. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84543
2020-08-17 20:37:37 +00:00
Simon Giesecke fa7f470279 Bug 1658528 - Add MOZ_TO_RESULT_INVOKE macro. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D75754
2020-08-17 06:34:39 +00:00
Simon Giesecke 531508b985 Bug 1658524 - Make ToResultInvoke also accept RefPtr<T>/nsCOMPtr<T>. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D86692
2020-08-12 18:33:14 +00:00
Tom Ritter 73764ca6a5 Bug 1656896 - Improve the Tainting macros and add unit tests r=froydnj
The patch:
 - Changes from an explicit capture in MOZ_VALIDATE_AND_GET_HELPER3/MOZ_IS_VALID
   to a default capture, to support referencing local variables in conditions.
 - Moves things around in Tainting.h and adds comments
 - Adds unit tests for the macros

Differential Revision: https://phabricator.services.mozilla.com/D85889
2020-08-07 19:14:22 +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 48dd75b228 Bug 1653335 - Add/fix constructors and deduction guides for Span. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D83813
2020-08-07 07:42:52 +00:00
Simon Giesecke dea5b543db Bug 1653335 - Remove uses of MakeSpan in return statements. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D83812
2020-08-07 07:42:50 +00:00
David Major 7bdbf197ee Bug 1657455 - Give EnumSet an assignment operator r=sg
Newer clangs complain that we explicitly defined a copy constructor but not a copy assignment.

Differential Revision: https://phabricator.services.mozilla.com/D86061
2020-08-06 20:40:37 +00:00
Kagami Sascha Rosylight b6115988e8 Bug 1656041 - Part 2: Return a struct from GetFrameFromDirection r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D85317
2020-08-04 15:23:47 +00:00
Simon Giesecke 18d9c43178 Bug 1654564 - Fix documentation of requirements on target in MOZ_TRY_VAR. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84531
2020-08-04 08:50:26 +00:00
Csoregi Natalia e321d2b4c3 Backed out changeset 6b53d90ee8b4 (bug 1656894) for asan bustage on xxhash.h. CLOSED TREE 2020-08-03 22:53:58 +03:00
Ryan VanderMeulen 4837f819c1 Bug 1656894 - Update xxHash to version 0.8.0. r=dthayer
Differential Revision: https://phabricator.services.mozilla.com/D85767
2020-08-03 17:30:19 +00:00
Nathan Froyd a527a4b54d Bug 1223932 - remove mfbt/GuardObjects.h; r=jwalden
We no longer need this for reasons outlined in the previous commit.

Depends on D85168

Differential Revision: https://phabricator.services.mozilla.com/D85169
2020-07-31 18:58:32 +00:00
Sylvestre Ledru 843f943758 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D85678
2020-08-02 15:29:15 +00:00
Jeff Gilbert fa50c42c4b Bug 1656034 - Add UnderlyingValue() to mfbt. - r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D85495
2020-07-31 23:04:44 +00:00
Chris Martin 552aa91269 Bug 1652561 - Remote Win32k calls in nsLookAndFeel::GetFontImpl() r=emilio,geckoview-reviewers,agi,froydnj
Content processes will now receive cached values for GetFontImpl() from the
parent process during initialization and whenever the theme changes.

This eliminates the use of several Win32k calls in content.

Differential Revision: https://phabricator.services.mozilla.com/D83406
2020-07-31 16:21:44 +00:00
Nathan Froyd e3ebda1914 Bug 1223932 - delete guard object uses from the tree; r=jwalden
CLOSED TREE

We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Mihai Alexandru Michis a911a108d0 Backed out changeset ac9c811bc427 (bug 1223932) for causing spidermonkey rust failures.
CLOSED TREE
2020-07-30 18:23:21 +03:00
Nathan Froyd bec9f9b93a Bug 1223932 - delete guard object uses from the tree; r=jwalden
We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Chris Peterson fd6ca4ec31 Bug 1652914 - Part 2: Remove unused MOZ_STATIC_ASSERT macro. r=jwalden
Depends on D83736

Differential Revision: https://phabricator.services.mozilla.com/D83737
2020-07-17 02:48:36 +00:00
Emilio Cobos Álvarez ff61891772 Bug 1653011 - Simplify and make WeakPtr<Derived> usable and compact. r=froydnj,sg,geckoview-reviewers,jgilbert,kvark,snorp
Having two classes in the inheritance chain inherit from SupportsWeakPtr
now won't compile, but you can use WeakPtr<Derived> when any base class
inherits from SupportsWeakPtr.

Differential Revision: https://phabricator.services.mozilla.com/D83674
2020-07-23 14:51:46 +00:00
Jeff Gilbert 35f892e782 Bug 1607940 - Stand up webgl.out-of-process:true path. r=handyman,nika,froydnj
* Use clearer pref names.
* Default (and only support) IPDL dispatching.
* Make DispatchCommands async-only.
* Sync ipdl command per sync webgl entrypoint.
  * Eat the boilerplate cost, since there's not too many.
* Run SerializedSize off same path as Serialize.
* All shmem uploads go through normal DispatchCommands.
* Defer pruning of dead code for now so we can iterate quickly.
* Use Read/Write(begin,end) instead of (begin,size).
  * This would have prevented a bug where we read/wrote N*sizeof(T)*sizeof(T).

Differential Revision: https://phabricator.services.mozilla.com/D81495
2020-07-21 22:56:52 +00:00
Frederik Braun c4e884127c Bug 1651977 - add MOZ_NO_VALIDATE r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D83069
2020-07-13 09:01:00 +00:00
Simon Giesecke 4fa1e97bce Bug 1651323 - Add MOZ_LIFETIME_BOUND attribute. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D82681
2020-07-10 12:16:13 +00:00
Jean-Yves Avenard bd648e63b9 Bug 1649974 - P1. Make WeakPtr work with generic taskqueue. r=froydnj
It worked until now as IPC's MessageChannel was only used with background taskqueue; which use a threadpool made of a single thread only.

Differential Revision: https://phabricator.services.mozilla.com/D82499
2020-07-10 01:36:12 +00:00
Razvan Maries 05fa077757 Backed out 5 changesets (bug 1650996, bug 1649974) for perma failures on Android 7.0. CLOSED TREE
Backed out changeset 8f8174ba409d (bug 1650996)
Backed out changeset 374598f9c37a (bug 1650996)
Backed out changeset 236757acc073 (bug 1650996)
Backed out changeset 89d5cabfa2df (bug 1649974)
Backed out changeset 6e475ddbd18c (bug 1649974)
2020-07-09 10:33:45 +03:00
Jean-Yves Avenard 09c6a1b3f4 Bug 1649974 - P1. Make WeakPtr work with generic taskqueue. r=froydnj
It worked until now as IPC's MessageChannel was only used with background taskqueue; which use a threadpool made of a single thread only.

Differential Revision: https://phabricator.services.mozilla.com/D82499
2020-07-09 06:10:24 +00:00
Mihai Alexandru Michis b29ef28dc4 Backed out 2 changesets (bug 1649974) as requested by jyavenard.
CLOSED TREE

Backed out changeset 4d7301e8eeb3 (bug 1649974)
Backed out changeset 69bacb6e8287 (bug 1649974)
2020-07-09 05:43:59 +03:00
Nick Alexander aa96e0fc28 Bug 1651130 - Part 2: Add a new `tools/update-programs` build project. r=froydnj
Here "update programs" refers to the various standalone binaries we
produce in order to update Firefox.  There's not strong conceptual
coherence between them; rather, it's the pieces that the
Install/Update team generally work on.

To use this build project, prepare a minimal mozconfig with
`--enable-project=tools/update-programs`.  Depending on the mozconfig
options and host and target OS, some of the following will be built:

1. the maintenance service;
2. the updater binary;
3. the Windows Default Browser Agent;
4. the Background Update Agent.

Differential Revision: https://phabricator.services.mozilla.com/D82644
2020-07-08 23:03:21 +00:00
Jean-Yves Avenard d7560b65c6 Bug 1649974 - P1. Make WeakPtr work with generic taskqueue. r=froydnj
It worked until now as IPC's MessageChannel was only used with background taskqueue; which use a threadpool made of a single thread only.

Differential Revision: https://phabricator.services.mozilla.com/D82499
2020-07-08 13:15:42 +00:00
Bogdan Tara 0867b964e2 Backed out 5 changesets (bug 1650996, bug 1649974) for hazard failures CLOSED TREE
Backed out changeset de5e55b59a31 (bug 1650996)
Backed out changeset 35faa46f46f1 (bug 1650996)
Backed out changeset 6f779a3875a8 (bug 1650996)
Backed out changeset fac1e5a07a6c (bug 1649974)
Backed out changeset 3c5157a9e872 (bug 1649974)
2020-07-08 16:07:56 +03:00
Jean-Yves Avenard 9194155201 Bug 1649974 - P1. Make WeakPtr work with generic taskqueue. r=froydnj
It worked until now as IPC's MessageChannel was only used with background taskqueue; which use a threadpool made of a single thread only.

Differential Revision: https://phabricator.services.mozilla.com/D82499
2020-07-08 03:58:18 +00:00
june wilde 99fcac8838 Bug 1649967 - Add missing annotation attributes to builds with clang-plugin enabled; r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D81958
2020-07-06 17:03:23 +00:00
Sylvestre Ledru caf785c695 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D82178
2020-07-04 09:38:43 +00:00
Simon Giesecke 273b5b9fd1 Bug 1649704 - Improve consistency of Span's span_iterator comparison. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D81827
2020-07-02 13:46:01 +00:00
Nathan Froyd b272eadc07 Bug 1323307 - use compiler-builtin preprocessor macros for endianness always; r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D81551
2020-07-02 14:36:54 +00:00
Mike Hommey 77976c2cc1 Bug 1463035 - Remove MOZ_SIGNAL_TRAMPOLINE. r=gerald
This was previously r=jchen and landed, but was backed out because some
Android tests were running on an unrealistically old Linux kernel. These
tests have been retired, so this can reland.

Differential Revision: https://phabricator.services.mozilla.com/D81278
2020-06-26 03:48:49 +00:00
David Major a0cb558b98 Bug 1648541 - Rename details namespace in SPSCQueue r=froydnj
I will admit from the start that this patch is goofy and is not the "proper" fix.

If you're unlucky enough to tickle the current unification in `dom/media`, then there's a conflict between `namespace mozilla::details` of `SPSCQueue.h` and `namespace details` of Chromium's `task.h`. Ultimately, the badness stems from some unified file doing `using namespace mozilla;`, but I'm really not enthusiastic about reworking that when I just want to get unblocked.

I'm going to attempt to justify the yuckiness of this patch on the basis that:
* `SPSCQueue.h` is super self-contained and rarely looked at, I bet nobody will notice this change
* Tons of other code prefers the spelling `mozilla::detail` anyway

Differential Revision: https://phabricator.services.mozilla.com/D81162
2020-06-25 19:30:52 +00:00
Simon Giesecke 9235fda693 Bug 1648452 - Make construction of NotNull work with MovingNotNull of derived-type. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D81077
2020-06-25 13:10:08 +00:00
Simon Giesecke 6fbe4dd29b Bug 1648044 - Add Maybe<T&>::refEquals methods. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80845
2020-06-25 15:09:58 +00:00
Simon Giesecke e30a7e3356 Bug 1647647 - Add InitializedOnce::ref methods. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80843
2020-06-25 13:12:47 +00:00
John Paul Adrian Glaubitz 1304678d83 Bug 1318905 - mfbt:tests: Define RETURN_INSTR for riscv64 in TestPoisonArea r=glandium
Define RETURN_INSTR for riscv64 in TestPoisonArea, i.e. the riscv64 assembly
opcodes for "ret ; ret".

Differential Revision: https://phabricator.services.mozilla.com/D78625
2020-06-18 07:11:09 +00:00
Simon Giesecke 2c863dcd11 Bug 1646391 - Simplify ReverseIterator. r=froydnj
The following simplifications are made:
* Unnecessary function template arguments are removed.
* Unnecessary copy constructor definitions are removed (making the types
  movable where possible).
* Iterators are moved where possible rather than copied.
* Unnecessary MOZ_IMPLICIT on a constructor with two arguments is removed.

Differential Revision: https://phabricator.services.mozilla.com/D80015
2020-06-18 07:49:16 +00:00
Mihai Alexandru Michis b0915875b3 Backed out changeset 186d892dc218 (bug 1646391) for causing bustages in TestReverseIterator.cpp
CLOSED TREE
2020-06-17 20:08:01 +03:00
Simon Giesecke 9fa5c13f41 Bug 1646391 - Simplify ReverseIterator. r=froydnj
The following simplifications are made:
* Unnecessary function template arguments are removed.
* Unnecessary copy constructor definitions are removed (making the types
  movable where possible).
* Iterators are moved where possible rather than copied.
* Unnecessary MOZ_IMPLICIT on a constructor with two arguments is removed.

Differential Revision: https://phabricator.services.mozilla.com/D80015
2020-06-17 15:20:25 +00:00
Simon Giesecke 9cf654a99f Bug 1645429 - Do not use ReverseIterator in nsTObserverArray::NonObservingRange. r=froydnj
Depends on D79957

Differential Revision: https://phabricator.services.mozilla.com/D79958
2020-06-17 13:29:02 +00:00
Simon Giesecke 901af53e36 Bug 1645429 - Add tests for ReverseIterator and fix implementation of ReverseIterator::operator-. r=froydnj
Depends on D79488

Differential Revision: https://phabricator.services.mozilla.com/D79957
2020-06-17 13:54:12 +00:00
David Major 0f1c6a1f28 Bug 1646171 - Fix vsnprintf complaint in Assertions.cpp r=froydnj
For some reason, our clang-plugin didn't notice this before clang 11.

Differential Revision: https://phabricator.services.mozilla.com/D79901
2020-06-16 21:26:16 +00:00
Sylvestre Ledru 85c05f3a47 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D79795
2020-06-16 14:37:23 +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
Simon Giesecke 1a13e8aef8 Bug 1645328 - Add in-place constructor to Maybe. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D79448
2020-06-15 09:04:02 +00:00
Brindusan Cristian bff7221969 Backed out changeset 5200dd8a0de5 (bug 1645328) for cppunit assertion failures at Maybe.h. CLOSED TREE 2020-06-12 20:12:37 +03:00
Simon Giesecke af931b95e6 Bug 1645328 - Add in-place constructor to Maybe. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D79448
2020-06-12 14:42:26 +00:00
John Paul Adrian Glaubitz eac5e496ab Bug 1325771 - mfbt:tests: Define RETURN_INSTR for m68k in TestPoisonArea r=glandium
Define RETURN_INSTR for m68k in TestPoisonArea, i.e. the m68k assembly
opcodes for "rts ; rts".

Differential Revision: https://phabricator.services.mozilla.com/D77290
2020-06-06 06:45:53 +00:00
John Paul Adrian Glaubitz 44fad57771 Bug 1325771 - mfbt:tests: Handle targets with less strict alignment in TestCompactPair r=jesup
Previously, the tests assumed that the alignment of int and long equals
their size. This commit fixes the tests for targets like m68k that have
sizeof(int) == 4 and alignof(int) == 2. A static helper function sizemax
was introduced as the offset of the second element in Pair<int,long>
might be either determined by its alignment requirement or the size of
the preceding int element and we use the helper function to pick the
larger of the two values.

Differential Revision: https://phabricator.services.mozilla.com/D77289
2020-06-06 06:45:53 +00:00
John Paul Adrian Glaubitz 319d3205ce Bug 1325771 - mfbt: Reorder parameters for MOZ_ALIGNED_DECL r=jwalden
Currently, MOZ_ALIGNED_DECL uses the order (_type, _align) for its
parameters. However, this order makes the code less readable when
_type is a larger object like a struct because the value for _align
would be at the end of the struct definition. By swapping the order
of _type and _align, the alignment value will always be next to
the type name, regardless how far the definition of _type extends.

Differential Revision: https://phabricator.services.mozilla.com/D77288
2020-06-03 18:31:06 +00:00
Dorel Luca 0154691eae Backed out 5 changesets (bug 1325771) for Spidermonkey failures and build bustage in build/src/mfbt/tests/TestCompactPair.cpp. CLOSED TREE
Backed out changeset ace40545b46c (bug 1325771)
Backed out changeset b3e0fb410a1c (bug 1325771)
Backed out changeset d69ac62c063f (bug 1325771)
Backed out changeset 24e6299e112d (bug 1325771)
Backed out changeset 393a6ff847ce (bug 1325771)
2020-06-03 20:23:08 +03:00
John Paul Adrian Glaubitz 196d2e2764 Bug 1325771 - mfbt:tests: Define RETURN_INSTR for m68k in TestPoisonArea r=glandium
Define RETURN_INSTR for m68k in TestPoisonArea, i.e. the m68k assembly
opcodes for "rts ; rts".

Depends on D77289

Differential Revision: https://phabricator.services.mozilla.com/D77290
2020-06-02 07:01:56 +00:00
John Paul Adrian Glaubitz 5e52229a75 Bug 1325771 - mfbt:tests: Handle targets with less strict alignment in TestCompactPair r=jesup
Previously, the tests assumed that the alignment of int and long equals
their size. This commit fixes the tests for targets like m68k that have
sizeof(int) == 4 and alignof(int) == 2. A static helper function sizemax
was introduced as the offset of the second element in Pair<int,long>
might be either determined by its alignment requirement or the size of
the preceding int element and we use the helper function to pick the
larger of the two values.

Depends on D77288

Differential Revision: https://phabricator.services.mozilla.com/D77289
2020-06-01 22:48:50 +00:00
John Paul Adrian Glaubitz ea002ac55c Bug 1325771 - mfbt: Reorder parameters for MOZ_ALIGNED_DECL r=jwalden
Currently, MOZ_ALIGNED_DECL uses the order (_type, _align) for its
parameters. However, this order makes the code less readable when
_type is a larger object like a struct because the value for _align
would be at the end of the struct definition. By swapping the order
of _type and _align, the alignment value will always be next to
the type name, regardless how far the definition of _type extends.

Depends on D77287

Differential Revision: https://phabricator.services.mozilla.com/D77288
2020-06-03 16:51:08 +00:00
Sylvestre Ledru 63be8d152d Bug 1519636 - Reformat recent changes to the Google coding style r=necko-reviewers,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D77580
2020-05-30 09:55:27 +00:00
Nathan Froyd 5416a2fae6 Bug 1635359 - remove bounds checks on trivial `span_iterator` construction; r=sg
There's no need to provide the compiler a bunch of stuff that it's
trivially going to optimize away anyway, and we'd rather the release
assert not mess with the optimizer's view of the code.

Differential Revision: https://phabricator.services.mozilla.com/D77124
2020-05-28 11:17:42 +00:00
Nathan Froyd 9dcf479947 Bug 1635359 - provide a private constructor for `span_iterator` to bypass bounds checks; r=sg
The compiler is not always able to remove these (always-successful)
checks, so we might as well help it along.

Depends on D77122

Differential Revision: https://phabricator.services.mozilla.com/D77123
2020-05-28 10:05:38 +00:00
Nathan Froyd 1dc3de3520 Bug 1635359 - rename Span type parameter for `span_iterator`; r=sg
We're going to introduce some friend declarations in the next patch, and
this change makes doing so easier.  It's also slightly less confusing.

Depends on D77121

Differential Revision: https://phabricator.services.mozilla.com/D77122
2020-05-28 10:03:06 +00:00
Nathan Froyd f747ca618f Bug 1635359 - remove release asserts for `span_iterator` {de,in}crement; r=sg
These are redundant with the checks that we already have for dereferencing.

Depends on D77120

Differential Revision: https://phabricator.services.mozilla.com/D77121
2020-05-28 09:56:06 +00:00
Nathan Froyd 9c05dc1217 Bug 1635359 - eliminate release assert in const `span_iterator` construction; r=sg
Differential Revision: https://phabricator.services.mozilla.com/D77120
2020-05-28 09:54:37 +00:00
Chris Fronk dfcd4afc6e Bug 1433142 - Add support for hashing enum values. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D70647
2020-05-27 23:44:51 +00:00
Jon Bauman c3c1e322ad Bug 1639637 - Add Maybe method to move out contents leaving Nothing() behind. r=froydnj
Add take() and extract() methods returning Maybe<T> and T respectively.

Differential Revision: https://phabricator.services.mozilla.com/D76526
2020-05-22 19:46:07 +00:00
Bob Owen 3dc49fb3d2 Bug 1639958 part 2: Add Buffer::AllocForOverwrite to fallibly create a default-initialized Buffer. r=froydnj
This also uses MakeUniqueForOverwrite* in two places where we immediately copy
over the Buffer from a Span.
Adds move assignment operator as well.

Differential Revision: https://phabricator.services.mozilla.com/D75510
2020-05-22 07:48:02 +00:00
Bob Owen c7b447903d Bug 1639958 part 1: Add MakeUniqueForOverwrite and MakeUniqueForOverwriteFallible helpers. r=froydnj
These are the equivalent of std::make_unique_for_overwrite and std::make_unique_for_overwrite with fallible allocation.

Differential Revision: https://phabricator.services.mozilla.com/D75509
2020-05-22 07:22:28 +00:00
Chris Fronk 2f903c4542 Bug 1624495 - Support move only arguments such as UniquePtr in FunctionRef. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D68707
2020-05-21 01:56:57 +00:00
Simon Giesecke 2547c1a621 Bug 1637605 - Make ToResultInvoke work with stdcall functions on Windows. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D75938
2020-05-19 13:15:58 +00:00
Simon Giesecke f5342d154a Bug 1637605 - Add support for polymorphic return values to ToResultInvoke. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D75294
2020-05-19 09:07:08 +00:00
Simon Giesecke 24e5290fb8 Bug 1637605 - Provide adapter from functions with R*/R& output parameter and nsresult return type to Result<R, nsresult> return type. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D75091
2020-05-19 08:25:54 +00:00
Simon Giesecke f29e73f1c3 Bug 1637599 - Rephrase documentation referring to copies of errors. r=froydnj
The phrase "copy the error" is misleading, as the error type might not be
copyable, and it is never copied but moved. "Propagate" the error seems to
be a good term to describe this.

Differential Revision: https://phabricator.services.mozilla.com/D75093
2020-05-13 15:44:31 +00:00
Simon Giesecke 4a309d690e Bug 1637599 - Simplify propagation of error results. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D75090
2020-05-13 15:44:31 +00:00
Simon Giesecke f07c441f41 Bug 1636114 - Add Span::AsConst method. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D74232
2020-05-11 09:27:40 +00:00
Chris Fronk af8a02cc9d Bug 1512991 - Add JsonWriteFunc::Write to take string length. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D72560
2020-05-08 16:24:31 +00:00
Greg V e65e9412b0 Bug 1634205 - Support Gecko Profiler and Base Profiler on FreeBSD r=mstange
- supports amd64 and arm64 (aarch64)
- uses LUL for stack walking

Differential Revision: https://phabricator.services.mozilla.com/D73162
2020-05-06 17:44:19 +00:00
Simon Giesecke 736ed67de5 Bug 1634003 - Add MovingNotNull class template. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D73032
2020-05-05 09:09:13 +00:00
Simon Giesecke ddfa9fe2d2 Bug 1633719 - Make NotNull move its member pointer where possible. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D72827
2020-05-05 09:09:01 +00:00
Shishir Jaiswal a285d5eb51 Bug 1629429 - Removing optional second argument in static_assert() r=sylvestre
The seconds argument for diagnostic message is optional from C++17

Differential Revision: https://phabricator.services.mozilla.com/D73556
2020-05-02 21:51:13 +00:00
Simon Giesecke 74b75d282b Bug 1634023 - Add deduction guides for Span. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D73040
2020-04-29 16:04:56 +00:00
Simon Giesecke 8f5212cd79 Bug 1634014 - Allow Span to be created from two Span iterators. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D73039
2020-04-29 15:20:50 +00:00
Simon Giesecke 2e99dc5200 Bug 1633809 - Suppress -Wpointer-bool-conversion in WrapNotNullUnchecked. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D73013
2020-04-29 14:04:09 +00:00
Andrew McCreight 1237ea289b Bug 1631274 - Make SegmentedVector::InfallibleAppend failures into OOM crashes. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D71581
2020-04-28 14:00:21 +00:00
Simon Giesecke 8f84ea1eaa Bug 1631709 - NotNull must not be movable. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D71721
2020-04-28 11:23:05 +00:00
Simon Giesecke 46314aa8d2 Bug 1633350 - Add SplitAt method to mozilla::Span. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D72605
2020-04-27 11:16:30 +00:00
Simon Giesecke e8a20bbe1c Bug 1633350 - Add deduction guide for constructing Span from a plain array. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D72604
2020-04-27 16:46:57 +00:00
Eric Rahm 01f450a03a Bug 1632613 - Part 1: Add a void** version of UniquePtr getter_Transfers. r=KrisWright
This adds a `void**` version fo `getter_Transfers` that is needed by the last remaining nsAutoPtr user in XSLT.

Differential Revision: https://phabricator.services.mozilla.com/D72431
2020-04-27 22:13:52 +00:00
André Bargull ccbf88b7b0 Bug 1626587 - Part 4: Remove mozilla::IsPod for HashMapEntry. r=jwalden
The `mozilla::IsPod<HashMapEntry` specialisation was only needed for the static
assertions in "js/src/frontend/NameCollections.h". Part 3 removed those, so we
can now also remove `mozilla::IsPod<HashMapEntry`.

Drive-by change:
- Remove no longer needed "mozilla/PodOperations.h" include in mfbt/HashTable.h.
- And then fix up previously transitively included files for RootingAPI.h,
  jsfriendapi.h, and Bench.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D69201
2020-04-27 12:00:48 +00:00
Simon Giesecke 2d8c4390b7 Bug 1628715 - Part 15: Replace MOZ_NONNULL_RETURN by returning NotNull<elem_type*>. r=xpcom-reviewers,necko-reviewers,dragana,nika
Differential Revision: https://phabricator.services.mozilla.com/D71300
2020-04-24 13:35:27 +00:00
Simon Giesecke 9a017967d6 Bug 1628715 - Part 14: Add MOZ_NONNULL_RETURN attribute on NotNull::operator->. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D71299
2020-04-24 13:33:55 +00:00
Simon Giesecke e6e6d49af2 Bug 1628715 - Part 13: Add specialization NotNull<T*> with MOZ_NONNULL_RETURN attributes. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D71298
2020-04-24 13:33:48 +00:00
Simon Giesecke 1961cd994a Bug 1628715 - Part 12: Add WrapNotNullUnchecked for NotNull<T*>. r=xpcom-reviewers,nika,jwalden
Differential Revision: https://phabricator.services.mozilla.com/D71296
2020-04-24 13:33:35 +00:00
Steve Fink 36169fa9e9 Bug 1626772 - Fixes for gcc 9 warnings r=botond
Differential Revision: https://phabricator.services.mozilla.com/D69275

--HG--
extra : moz-landing-system : lando
2020-04-10 20:40:03 +00:00
Mihai Alexandru Michis f2e4ef7d2a Backed out 3 changesets (bug 1626772) for causing bustages in DefineEnum.h
CLOSED TREE

Backed out changeset f42150bdee2b (bug 1626772)
Backed out changeset ab5b637f714a (bug 1626772)
Backed out changeset fd4026a9f380 (bug 1626772)
2020-04-10 03:49:33 +03:00
Steve Fink a0f2e976ce Bug 1626772 - Fixes for gcc 9 warnings r=botond
Differential Revision: https://phabricator.services.mozilla.com/D69275

--HG--
extra : moz-landing-system : lando
2020-04-02 17:59:46 +00:00
Chris Peterson a6d592bbe2 Bug 1620152 - Part 4: Replace MOZ_DIAGNOSTIC_ALWAYS_TRUE() with MOZ_ALWAYS_TRUE(). r=janv
MOZ_ALWAYS_TRUE() evaluates its expression in both debug and release builds. This bug will change MOZ_ALWAYS_TRUE() to use MOZ_DIAGNOSTIC_ASSERT() instead of MOZ_ASSERT(), so MOZ_DIAGNOSTIC_ALWAYS_TRUE() will be redundant.

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

--HG--
extra : moz-landing-system : lando
2020-04-09 02:08:10 +00:00
Chris Peterson ceb9bb69c5 Bug 1620152 - Part 3: Implement MOZ_ALWAYS_TRUE()/etc using MOZ_DIAGNOSTIC_ASSERT() instead of MOZ_ASSERT(). r=froydnj
MOZ_ALWAYS_TRUE() evaluates its expression in both debug and release builds. This bug will change MOZ_ALWAYS_TRUE() to use MOZ_DIAGNOSTIC_ASSERT() instead of MOZ_ASSERT() so it will also assert in Nightly and DevEdition release builds.

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

--HG--
extra : moz-landing-system : lando
2020-04-09 02:07:00 +00:00
Sebastian Hengst 88bbcf97df Backed out 4 changesets (bug 1620152) because it blocks the backout of bug 1626967. a=backout
Backed out changeset c6fe172dd237 (bug 1620152)
Backed out changeset a13507db74f7 (bug 1620152)
Backed out changeset 005a31ffa4bf (bug 1620152)
Backed out changeset 9c80be97934f (bug 1620152)
2020-04-08 10:06:27 +02:00
Chris Peterson 46bb24451b Bug 1620152 - Part 4: Replace MOZ_DIAGNOSTIC_ALWAYS_TRUE() with MOZ_ALWAYS_TRUE(). r=janv
MOZ_ALWAYS_TRUE() evaluates its expression in both debug and release builds. This bug will change MOZ_ALWAYS_TRUE() to use MOZ_DIAGNOSTIC_ASSERT() instead of MOZ_ASSERT(), so MOZ_DIAGNOSTIC_ALWAYS_TRUE() will be redundant.

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

--HG--
extra : moz-landing-system : lando
2020-04-08 04:35:01 +00:00
Chris Peterson fbe277226d Bug 1620152 - Part 3: Implement MOZ_ALWAYS_TRUE()/etc using MOZ_DIAGNOSTIC_ASSERT() instead of MOZ_ASSERT(). r=froydnj
MOZ_ALWAYS_TRUE() evaluates its expression in both debug and release builds. This bug will change MOZ_ALWAYS_TRUE() to use MOZ_DIAGNOSTIC_ASSERT() instead of MOZ_ASSERT() so it will also assert in Nightly and DevEdition release builds.

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

--HG--
extra : moz-landing-system : lando
2020-04-08 06:02:36 +00:00
Timothy Gu bfaebdfe1e Bug 1627285 - Check for NaN before std::min/max() in DOMQuad and DOMRect. r=emilio,jwalden
Tests were added as a part of bug 1626471. Expectations that the tests fail
have been removed.

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

--HG--
extra : moz-landing-system : lando
2020-04-07 22:27:36 +00:00
Simon Giesecke e3d1db10d9 Bug 1626884 - Make RC non-copyable and declare operator= only in debug builds. r=froydnj
RC should be non-copyable. It already is non-copyable in the atomic variant,
but not in the non-atomic variant. This ensures that RefCounted is also
non-copyable, which prevents that classes deriving from RefCounted get
accidentally copied.

Also, RC's operator= should be defined only in debug builds. As already
described in a code comment, it's only used in debug builds (to assign the
dead value), and otherwise no modifications other than incrementing &
decrementing should be possible.

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

--HG--
extra : moz-landing-system : lando
2020-04-06 09:17:34 +00:00
Sylvestre Ledru 0aa6f03cf3 Bug 1519636 - Reformat recent changes to the Google coding style r=jgilbert
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2020-04-05 13:34:58 +00:00
Narcis Beleuzu f6ebb84618 Backed out 2 changesets (bug 1626884, bug 1627198) for bustages on ElfLoader.h CLOSED TREE
Backed out changeset b545e60f385c (bug 1627198)
Backed out changeset 16ee5dd004d3 (bug 1626884)

--HG--
extra : histedit_source : 21258c723c796773307977dabbd50de5aba6bd34
2020-04-03 21:56:38 +03:00
Simon Giesecke d522d12fb3 Bug 1626884 - Make RC non-copyable and declare operator= only in debug builds. r=froydnj
RC should be non-copyable. It already is non-copyable in the atomic variant,
but not in the non-atomic variant. This ensures that RefCounted is also
non-copyable, which prevents that classes deriving from RefCounted get
accidentally copied.

Also, RC's operator= should be defined only in debug builds. As already
described in a code comment, it's only used in debug builds (to assign the
dead value), and otherwise no modifications other than incrementing &
decrementing should be possible.

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

--HG--
extra : moz-landing-system : lando
2020-04-03 14:27:17 +00:00
Gurzau Raul 76614a9f25 Bug 1626267 - fix build bustage r=bustage-fix on a CLOSED TREE 2020-04-01 19:29:19 +03:00
Simon Giesecke 94fa08db9c Bug 1626267 - Added transformation algorithms with error handling. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68994

--HG--
extra : moz-landing-system : lando
2020-04-01 15:53:58 +00:00
Simon Giesecke 84dd9a7ef6 Bug 1626197 - Remove custom copy/move operations on EnumeratedArray. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68972

--HG--
extra : moz-landing-system : lando
2020-03-31 13:17:21 +00:00
Chris Fronk 62d6d7db0e Bug 1345842 - Add Ignore to allow ignore elements in Tie. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68742

--HG--
extra : moz-landing-system : lando
2020-03-31 12:36:22 +00:00
Simon Giesecke 237efbb270 Bug 1625871 - InitializedOnce<const T> should be a literal type for literal types T. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68759

--HG--
extra : moz-landing-system : lando
2020-03-31 08:21:11 +00:00
Simon Giesecke 3eeb9d7e2d Bug 1625869 - Maybe<T> should be trivially destructible for move-only T. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68758

--HG--
extra : moz-landing-system : lando
2020-03-31 08:20:58 +00:00
Bogdan Tara d6d7d84fec Backed out 2 changesets (bug 1625871, bug 1625869) for gtest assertions on Maybe.h CLOSED TREE
Backed out changeset 8dee41ad98cf (bug 1625871)
Backed out changeset 39fbc765525b (bug 1625869)
2020-03-30 17:29:09 +03:00
Simon Giesecke df70dae59a Bug 1625871 - InitializedOnce<const T> should be a literal type for literal types T. r=froydnj
Depends on D68758

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

--HG--
extra : moz-landing-system : lando
2020-03-30 12:27:10 +00:00
Simon Giesecke b30450b50d Bug 1625869 - Maybe<T> should be trivially destructible for move-only T. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68758

--HG--
extra : moz-landing-system : lando
2020-03-30 12:26:58 +00:00
André Bargull cc2bfc7ab8 Bug 1625473: Use type traits for AbsReturnType. r=froydnj
Also removes the comment which allows adding more `AbsReturnType` specialisations,
because that shouldn't be necessary anymore.

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

--HG--
extra : moz-landing-system : lando
2020-03-28 16:07:06 +00:00
André Bargull 14ca007916 Bug 1625138 - Part 41: Remove no longer needed includes for mozilla/TypeTraits. r=froydnj
Also adds missing includes in some files, these were previously only transivitely
included through mozilla/TypeTraits.h.

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

--HG--
extra : moz-landing-system : lando
2020-03-28 16:00:09 +00:00
André Bargull 13bfe75b97 Bug 1625138 - Part 40: Replace remaining mozilla::IsSame with std::is_same. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68560

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:21 +00:00
André Bargull 5992327185 Bug 1625138 - Part 36: Replace mozilla::IsSame with std::is_same in mfbt/. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68555

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:20 +00:00
André Bargull 2712714d84 Bug 1625138 - Part 35: Replace mozilla::TrueType with std::true_type. r=froydnj,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D68554

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:20 +00:00
André Bargull f8eb4c162e Bug 1625138 - Part 34: Replace mozilla::FalseType with std::false_type. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68553

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:20 +00:00
André Bargull 9de017ffb8 Bug 1625138 - Part 33: Replace mozilla::IntegralConstant with std::integral_constant. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68552

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:19 +00:00
André Bargull 32cb16fc45 Bug 1625138 - Part 32: Replace mozilla::RemoveConst with std::remove_const. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68551

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:19 +00:00
André Bargull 8fae6ee9a8 Bug 1625138 - Part 31: Replace mozilla::RemoveVolatile with std::remove_volatile. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68549

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:19 +00:00
André Bargull 8d7aa62e32 Bug 1625138 - Part 29: Replace mozilla::IsVoid with std::is_void. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68548

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:19 +00:00
André Bargull cf0b1e89e9 Bug 1625138 - Part 30: Replace mozilla::RemoveCV with std::remove_cv. r=froydnj,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D68547

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:18 +00:00
André Bargull 95c76a6863 Bug 1625138 - Part 28: Replace mozilla::AddRvalueReference with std::add_rvalue_reference. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68546

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:18 +00:00
André Bargull 42d4ebbda9 Bug 1625138 - Part 27: Replace mozilla::DeclVal with std::declval. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68545

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:18 +00:00
André Bargull cae4e1fdbc Bug 1606962: Replace mozilla::EnableIf with std::enable_if. r=froydnj,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D68401

--HG--
extra : moz-landing-system : lando
2020-03-28 13:35:31 +00:00