Commit Graph

2563 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
57ebb944de Bug 1897752 - Make EnumeratedArray constructor constexpr.
MANUAL PUSH: Trivial base toolchains fix CLOSED TREE.
2024-05-20 19:08:32 +02:00
serge-sans-paille
ae07881baa Bug 1883940 - Replace MOZ_CXX11 autoconf macro by a moz.configure check r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D203781
2024-05-18 07:10:57 +00:00
Emilio Cobos Álvarez
d55796be17 Bug 1892257 - Move nsStringBuffer to mfbt. r=nika,xpcom-reviewers,glandium
Inline Create() and Realloc() so that we don't get negative leaks, since
were that code end up in mozglue, it wouldn't have access to the logging
machinery.

Differential Revision: https://phabricator.services.mozilla.com/D209663
2024-05-14 14:24:26 +00:00
Andreas Pehrson
5ec78bee07 Bug 1404972 - To Result add operator==. r=glandium
This is needed for using Result with gtest matchers.

Differential Revision: https://phabricator.services.mozilla.com/D205958
2024-05-06 19:54:00 +00:00
Stanca Serban
614498681a Backed out 35 changesets (bug 1404972) for causing cppunit assertion failures in mozilla/Result.h. CLOSED TREE
Backed out changeset 703bcdb5aed1 (bug 1404972)
Backed out changeset 43134f8cd283 (bug 1404972)
Backed out changeset abcec791bf5f (bug 1404972)
Backed out changeset 02b7f8ee802c (bug 1404972)
Backed out changeset dacf1411a3d9 (bug 1404972)
Backed out changeset 15136efd0662 (bug 1404972)
Backed out changeset f1cd90f5d1b6 (bug 1404972)
Backed out changeset 3143c92d0e2e (bug 1404972)
Backed out changeset 257f310d5c8e (bug 1404972)
Backed out changeset ab73b50399ef (bug 1404972)
Backed out changeset a63110e6bf55 (bug 1404972)
Backed out changeset 346a34408207 (bug 1404972)
Backed out changeset bc211f44281f (bug 1404972)
Backed out changeset 9be7b1767e46 (bug 1404972)
Backed out changeset 48832f645357 (bug 1404972)
Backed out changeset 57e38c2622bf (bug 1404972)
Backed out changeset 20a15e46829b (bug 1404972)
Backed out changeset 4a148ddfc1cd (bug 1404972)
Backed out changeset 9de637c307ad (bug 1404972)
Backed out changeset 6f3aebf42327 (bug 1404972)
Backed out changeset de46ffac7541 (bug 1404972)
Backed out changeset 2e038afae950 (bug 1404972)
Backed out changeset 63765ab9e647 (bug 1404972)
Backed out changeset 152a456a7af1 (bug 1404972)
Backed out changeset 0824e75bd26c (bug 1404972)
Backed out changeset c6462cae6c8b (bug 1404972)
Backed out changeset bd41873e1f03 (bug 1404972)
Backed out changeset 9595c4451fc1 (bug 1404972)
Backed out changeset 23d0f7682a5f (bug 1404972)
Backed out changeset 08c9467086bf (bug 1404972)
Backed out changeset ea7779289030 (bug 1404972)
Backed out changeset 8cf8b6f1a41e (bug 1404972)
Backed out changeset c3538c05fb0c (bug 1404972)
Backed out changeset 0128d95e64ef (bug 1404972)
Backed out changeset ed2fdc7b602d (bug 1404972)
2024-05-06 19:21:08 +03:00
Andreas Pehrson
bf1f2dc239 Bug 1404972 - To Result add operator==. r=glandium
This is needed for using Result with gtest matchers.

Differential Revision: https://phabricator.services.mozilla.com/D205958
2024-05-06 13:50:19 +00:00
Chris Peterson
2d846b7c8c Bug 1894147 - Fix C++20 std::memory_order build errors in MPSCQueue.h. r=xpcom-reviewers,emilio
C++20 renamed the `std::memory_order::memory_order_*` enum constants to `std::memory_order::*`.

https://en.cppreference.com/w/cpp/atomic/memory_order

C++17 supports:

`std::memory_order_relaxed`
`std::memory_order::memory_order_relaxed`

But C++20 supports:

`std::memory_order_relaxed`
`std::memory_order::memory_order::relaxed`

Thus, `std::memory_order_relaxed` is the only shared name if we want to support compiling Firefox with -std=c++17 and -std=c++20 as we transition mozilla-central from C++17 to C++20.

Differential Revision: https://phabricator.services.mozilla.com/D208963
2024-04-30 15:37:35 +00:00
Jeff Muizelaar
26ccb2231c Bug 1893567 - Add MOZ_NOMERGE to Window MOZ_REALLY_CRASH implementation. r=gsvelto
This makes it so the work from bug 1814600 also applies to Windows.

Differential Revision: https://phabricator.services.mozilla.com/D208696
2024-04-26 12:40:46 +00:00
Alexandre Lissy
6b04b6b558 Bug 1893432 - Introduce mfbt/MPSCQueue r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D207730
2024-04-25 13:33:32 +00:00
Sylvestre Ledru
21f973ed5c Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,media-playback-reviewers,padenot
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D207867
2024-04-22 16:00:09 +00:00
Chris Peterson
d55c7573ed Bug 1891332 - Replace debug MOZ_ASSERT with MOZ_RELEASE_ASSERT in MFBT tests. r=xpcom-reviewers,emilio
MOZ_ASSERT is only checked in debug builds, so release builds' tests are not checking these assertions.

Depends on D207373

Differential Revision: https://phabricator.services.mozilla.com/D207374
2024-04-17 03:26:29 +00:00
Emilio Cobos Álvarez
6d4e823315 Bug 1891497 - Add mozilla::Span constructor for EnumeratedArray. r=glandium
Just like the mozilla::Array/std::array ones.

Differential Revision: https://phabricator.services.mozilla.com/D207389
2024-04-15 21:17:51 +00:00
Greg Stoll
fd333e0175 Bug 1875481 - Part 1: move MOZ_CAN_RUN_SCRIPT_BOUNDARY_LAMBDA into a shared header r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D200977
2024-04-10 00:15:46 +00:00
Stanca Serban
9879879814 Backed out 3 changesets (bug 1875481) for basicWindowDotPrintTest related junit failures.
Backed out changeset cd024cb2768e (bug 1875481)
Backed out changeset 6b7be15cd017 (bug 1875481)
Backed out changeset d1da53c0673b (bug 1875481)
2024-04-09 05:56:47 +03:00
Greg Stoll
af5a5d87e5 Bug 1875481 - Part 1: move MOZ_CAN_RUN_SCRIPT_BOUNDARY_LAMBDA into a shared header r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D200977
2024-04-08 23:53:58 +00:00
Chris Peterson
ece3226100 Bug 1880917 - Remove pragmas disabling -Wc++2a-compat warnings in mfbt and xpcom. r=xpcom-reviewers,glandium
Now that -Wc++2a-compat is no longer enabled (bug 1887580), we don't need these pragmas disabling -Wc++2a-compat warnings about u8"" string literals' type changing from const char[] in C++17 to const char8_t[] in C++20.

Differential Revision: https://phabricator.services.mozilla.com/D206742
2024-04-08 20:03:24 +00:00
Paul Adenot
291d65e213 Bug 1882518 - Print the PID when an assertion fails or MOZ_CRASH is reached in debug. r=gsvelto,glandium
Differential Revision: https://phabricator.services.mozilla.com/D202937
2024-03-26 09:42:11 +00:00
Andreas Pehrson
522fd9ad0a Bug 1601251 - Prohibit copies and moves on Maybe<T> where such operations are prohibited on T. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D205077
2024-03-26 08:00:56 +00:00
Stanca Serban
67ed3b15f0 Backed out changeset dda9d04389e1 (bug 1882518) for causing build bustages in Assertions.h. CLOSED TREE 2024-03-22 17:28:29 +02:00
Paul Adenot
30c2d20f64 Bug 1882518 - Print the PID when an assertion fails or MOZ_CRASH is reached in debug. r=gsvelto,glandium
Differential Revision: https://phabricator.services.mozilla.com/D202937
2024-03-22 12:19:50 +00:00
Andreas Pehrson
3deec9db93 Bug 1885840 - Add support for Maybe::orElse. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D204998
2024-03-22 08:17:06 +00:00
Andreas Pehrson
4ceb8a3f25 Bug 1885840 - Add support for Maybe::andThen. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D204997
2024-03-22 08:17:05 +00:00
Andreas Pehrson
fdd885886a Bug 1885840 - Remove non-const overloads of apply and map for Maybe<T&>. r=glandium
They don't add any functionality since there is no non-const variant of ref().

Differential Revision: https://phabricator.services.mozilla.com/D204993
2024-03-22 08:17:05 +00:00
Andreas Pehrson
2fdcd7ef76 Bug 1885840 - To Maybe<T>, add rvalue variants of apply and map. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D204992
2024-03-22 08:17:04 +00:00
Andreas Pehrson
3a4d791e34 Bug 1885840 - Clarify comment in TestMaybe on why move operations unexpectedly work with a non-movable type. r=glandium
As Bug 1601251 states, those operations need to be explicitly deleted for the
asserts to hold.

Differential Revision: https://phabricator.services.mozilla.com/D204990
2024-03-22 08:17:04 +00:00
Norisz Fay
7334131da2 Backed out changeset 02d8b0bd7883 (bug 1882518) for causing build bustage on Assertions.h CLOSED TREE 2024-03-15 14:01:53 +02:00
Paul Adenot
e2290e469b Bug 1882518 - Print the PID when an assertion fails or MOZ_CRASH is reached in debug. r=gsvelto,glandium
Differential Revision: https://phabricator.services.mozilla.com/D202937
2024-03-15 09:36:51 +00:00
Ray Kraesig
5cf89251a2 Bug 1880192 - [1/5] MozPromise.h: some C++17 modernizations r=xpcom-reviewers,emilio
Remove some type-level indirections from template-metaprogramming
helpers.

Additionally, replace some nearby uses of `typedef` with `using`, as
suggested by clang-tidy.

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D201784
2024-03-05 17:22:21 +00:00
Peter Van der Beken
2b747df80a Bug 1640839 - Add some helpers for enums to calculate the size and use it in EnumeratedArray. r=glandium,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201334
2024-03-02 07:50:19 +00:00
Peter Van der Beken
9c8d00b7fb Bug 1640839 - Move size template parameter for EnumeratedArray to the end. r=glandium,jgilbert,media-playback-reviewers,credential-management-reviewers,padenot,dimi
This will allow us to provide a default value for the size when some enum
helper traits are defined.

Differential Revision: https://phabricator.services.mozilla.com/D201333
2024-03-02 07:50:19 +00:00
Natalia Csoregi
8c2521e9d5 Backed out 13 changesets (bug 1640839) for causing bustage on Element.cpp CLOSED TREE
Backed out changeset 179ceb82c9e5 (bug 1640839)
Backed out changeset 73f498a821f0 (bug 1640839)
Backed out changeset dc2d3d0e0365 (bug 1640839)
Backed out changeset ddc989ac0509 (bug 1640839)
Backed out changeset e595bb3feea8 (bug 1640839)
Backed out changeset c85aca04e27f (bug 1640839)
Backed out changeset 98e8e3a4047a (bug 1640839)
Backed out changeset 59ef180517db (bug 1640839)
Backed out changeset af2f5e293662 (bug 1640839)
Backed out changeset 89aa6d9dc598 (bug 1640839)
Backed out changeset 67b722a722f9 (bug 1640839)
Backed out changeset 24a9665c6ced (bug 1640839)
Backed out changeset d93f199385e9 (bug 1640839)
2024-03-01 18:23:08 +02:00
Peter Van der Beken
f295b0c979 Bug 1640839 - Add some helpers for enums to calculate the size and use it in EnumeratedArray. r=glandium,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201334
2024-03-01 14:31:09 +00:00
Peter Van der Beken
8d1c9ad39c Bug 1640839 - Move size template parameter for EnumeratedArray to the end. r=glandium,jgilbert,media-playback-reviewers,credential-management-reviewers,padenot,dimi
This will allow us to provide a default value for the size when some enum
helper traits are defined.

Differential Revision: https://phabricator.services.mozilla.com/D201333
2024-03-01 14:31:09 +00:00
serge-sans-paille
f3cfc8bfd7 Bug 1880420 - Move __thread detection to moz.configure r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D201937
2024-02-28 11:11:17 +00:00
Kelsey Gilbert
b04996924d Bug 1037100 - Scoped.h removed because no outstanding uses. r=glandium,dom-storage-reviewers,jesup,janv
Differential Revision: https://phabricator.services.mozilla.com/D201763
2024-02-14 06:41:58 +00:00
Chris Peterson
515689e933 Bug 1880008 - Add char8_t string overloads to MFBT string functions when compiling with -std=c++20. r=xpcom-reviewers,emilio
When compiled with -std=c++17, u8"" string literals have type `const char[]`. When compiled with -std=c++20, u8"" string literals have type `const char8_t[]`. This patch adds the minimum char8_t overloads needed to compile Firefox with -std=c++20. If we want to use char8_t in more code or replace `Utf8Unit` with char8_t, that will require an extensive redesign of MFBT's and xpcom's string classes after we update from -std=c++17 to c++20.

Differential Revision: https://phabricator.services.mozilla.com/D201672
2024-02-14 01:33:31 +00:00
Christian Holler (:decoder)
700e5b34bc Bug 1875252 - Add MOZ_ASSERT_DEBUG_OR_FUZZING and use for Range/RangedPtr. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D198940
2024-02-06 21:31:19 +00:00
Emilio Cobos Álvarez
4c3cd32102 Bug 1878108 - Annotate FunctionRef constructor with MOZ_LIFETIME_BOUND. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D200433
2024-02-06 13:00:40 +00:00
Emilio Cobos Álvarez
e445a2bc43 Bug 1878108 - Replace custom MOZ_LIFETIME_BOUND with built-in. r=nika,glandium
The built-in version is better as it also allows annotating particular
parameters (it not only applies to method declarations).

Differential Revision: https://phabricator.services.mozilla.com/D200432
2024-02-06 13:00:39 +00:00
pstanciu
1200f7991d Backed out 2 changesets (bug 1878108) for causing sm bustages in Attributes.h. CLOSED TREE
Backed out changeset 05e2d2bc1260 (bug 1878108)
Backed out changeset bb356c39c0e2 (bug 1878108)
2024-02-06 13:11:26 +02:00
Emilio Cobos Álvarez
b5234811b5 Bug 1878108 - Annotate FunctionRef constructor with MOZ_LIFETIME_BOUND. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D200433
2024-02-06 08:51:51 +00:00
Emilio Cobos Álvarez
02f7ec8f63 Bug 1878108 - Replace custom MOZ_LIFETIME_BOUND with built-in. r=nika,glandium
The built-in version is better as it also allows annotating particular
parameters (it not only applies to method declarations).

Differential Revision: https://phabricator.services.mozilla.com/D200432
2024-02-06 08:51:50 +00:00
Emilio Cobos Álvarez
f67e589a85 Bug 1877672 - Make FunctionRef a MOZ_TEMPORARY_CLASS. r=nika
This prevents it from being used in the foot-gunny way described in
comment 0.

This in turn allows us to add a constructor for temporary callables.

Turns out we only had test usages of non-temporary FunctionRefs, so this
is much simpler than the initial approach I considered.

Fix the tests to keep compiling, and add a test for the new constructor.

Differential Revision: https://phabricator.services.mozilla.com/D200157
2024-02-02 19:21:20 +00:00
Jan Varga
9cb0b76439 Bug 1873140 - Avoid using invalid enum values during EnumSet iteration; r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D197824
2024-02-02 09:43:10 +00:00
Jan Varga
ee30d0fa58 Bug 1873140 - Align internal methods to use UpperCamelCase in EnumSet implementation; r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D197781
2024-02-02 09:43:10 +00:00
Jan Varga
8518e80c4a Bug 1873140 - Align index data types in EnumSet implementation; r=glandium
size_t is already correctly used in many places, only ConstIterator uses
uint32_t for position tracking. It would be better to align these data types
and use size_t everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D197774
2024-02-02 09:43:10 +00:00
maazis
e59c20c0ea Bug 1860247 - Poison.cpp: do not use 'else' after 'return'. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D198695
2024-01-31 12:19:32 +00:00
Kelsey Gilbert
2bc302ee20 Bug 1873769 - Add TempPtrToSetter(UniquePtr<T>*) -> T**-ish for safe out-ptr RAII. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D198087
2024-01-26 21:05:30 +00:00
Mathew Hodson
1a67b423e3 Bug 1874533 - Fix build warning for noreturn function on Windows r=glandium
warning: function declared 'noreturn' should not return
[-Winvalid-noreturn]

Differential Revision: https://phabricator.services.mozilla.com/D198485
2024-01-18 11:48:49 +00:00
Mike Hommey
6e1293b5f7 Bug 1718516 - Fix AddToHash of 64-bits numbers on 32-bits platforms. r=nika,anba
Differential Revision: https://phabricator.services.mozilla.com/D197302
2024-01-09 01:48:31 +00:00