Commit Graph

2320 Commits

Author SHA1 Message Date
Sylvestre Ledru
42f6811d95 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,media-playback-reviewers,necko-reviewers,padenot,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D148375
2022-06-07 12:32:55 +00:00
Nika Layzell
0e6bc87c63 Bug 1743020 - Part 3: Export mozilla::MoveOnlyFunction based on function2, r=glandium
A custom defintion wrapping fu2::function_base is used to customize the
inline buffer's size and alignment to make it compatible with nsTArray.
Without the custom wrapper, `alignof(max_align_t)` is used, which is
larger than nsTArray's max alignment on some platforms.

Differential Revision: https://phabricator.services.mozilla.com/D145691
2022-06-02 13:24:10 +00:00
Jan de Mooij
69dd9e0ace Bug 1770158 part 1 - Add MFBT_API to StringToDouble. r=glandium
The update script successfully applies this diff to the upstream code.

Differential Revision: https://phabricator.services.mozilla.com/D146878
2022-05-31 07:48:15 +00:00
Steve Fink
952b6a3854 Bug 1769518 - Support Rooted<Result<V,E>> as long as V and E have GCPolicy<> defined for them. (Use IgnoreGCPolicy for whichever of them does not need tracing.) r=emilio,nbp,jonco
Differential Revision: https://phabricator.services.mozilla.com/D146468
2022-05-26 17:22:35 +00:00
Chris Peterson
af64df99e7 Bug 1769778 - Replace deprecated std::result_of_t with std::invoke_result_t. r=janv
std::result_of_t was deprecated in C++17 and removed in C++20.

https://en.cppreference.com/w/cpp/types/result_of

The pattern to replace std::result_of_t with std::invoke_result_t is:

-std::result_of_t<Func(ArgTypes)>
+std::invoke_result_t<Func, ArgTypes>

Differential Revision: https://phabricator.services.mozilla.com/D146593
2022-05-25 06:07:32 +00:00
Chris Peterson
cc0d5b9c63 Bug 1769484 - Replace std::memory_order::memory_order_XYZ with std::memory_order_XYZ. r=padenot
C++20 renamed the `std::memory_order` enum's enumerators from `std::memory_order::memory_order_XYZ` to `std::memory_order::XYZ`. To maintain source compatibility with both C++17 and C++20, use `std::memory_order_XYZ`.

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0439r0.html

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

Differential Revision: https://phabricator.services.mozilla.com/D146395
2022-05-17 03:24:09 +00:00
Nika Layzell
ae118208e9 Bug 1767517 - Part 1: Fix incorrect annotation for GUARDED_VAR and PT_GUARDED_VAR, r=jesup
Differential Revision: https://phabricator.services.mozilla.com/D145393
2022-05-16 20:40:49 +00:00
Molnar Sandor
74e42d0f2f Backed out 5 changesets (bug 1743020) for causing linux build bustages in function2.hpp CLOSED TREE
Backed out changeset cf237471cf75 (bug 1743020)
Backed out changeset 78eb51447ce5 (bug 1743020)
Backed out changeset c486f95d55ec (bug 1743020)
Backed out changeset c0abfda55404 (bug 1743020)
Backed out changeset 16be18ca73fb (bug 1743020)
2022-05-14 10:31:12 +03:00
Nika Layzell
85884b7fca Bug 1743020 - Part 3: Export mozilla::MoveOnlyFunction based on function2, r=glandium
A custom defintion wrapping fu2::function_base is used to customize the
inline buffer's size and alignment to make it compatible with nsTArray.
Without the custom wrapper, `alignof(max_align_t)` is used, which is
larger than nsTArray's max alignment on some platforms.

Differential Revision: https://phabricator.services.mozilla.com/D145691
2022-05-13 23:43:52 +00:00
Paul Adenot
4815882f91 Bug 1768616 - TSAN suppression list update for Ubuntu 22.04 LTS. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D145953
2022-05-10 11:54:55 +00:00
Jesse Schwartzentruber
57e1160210 Bug 1765543 - Add snapshot fuzzing build using Nyx r=decoder,taskgraph-reviewers,ahal
Depends on D144208

Differential Revision: https://phabricator.services.mozilla.com/D144209
2022-05-04 19:24:58 +00:00
Mike Hommey
d067ffd623 Bug 1766561 - Enable MOZ_FORMAT_PRINTF on all clang builds. r=nika
clang-cl doesn't define __GNUC__. Also for some reason, clang-cl doesn't
like the use of MOZ_FORMAT_PRINTF on a function definition (while clang
is apparently happy with it).

Differential Revision: https://phabricator.services.mozilla.com/D144922
2022-05-03 20:49:10 +00:00
Nika Layzell
18f7866fc2 Bug 1738106 - Part 2: Allow XPCOM classes to use SupportsThreadSafeWeakPtr, r=glandium,xpcom-reviewers
Due to how this type of threadsafe refcounting is implemented, it needs to be
implemented using a MFBT-style refcounting base class, somewhat similar to
`SupportsWeakPtr`.

This patch makes NS_IMPL_{ADDREF,RELEASE}_INHERITED intelligently not add
refcount logging for types inheriting from SupportsThreadSafeWeakPtr, as the
default behaviour would break due to weak pointer upgrades not calling through
`AddRef` or `Release`.

In MFBT, the return value of `AddRef` and `Release` on
SupportsThreadSafeWeakPtr is changed to be compatible with nsISupports, so that
this type can be used to implement nsISupports refcounting.

Differential Revision: https://phabricator.services.mozilla.com/D142603
2022-05-02 20:37:34 +00:00
Mike Hommey
c5fea3fa51 Bug 1766549 - Remove some char16ptr_t operators that allow implicit const-casting. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D144777
2022-04-27 22:28:24 +00:00
Lee Salzman
ca716f7083 Bug 1765911 - Support cloning Patterns with internal weak references. r=aosmond
Currently calling Pattern::Clone() produces a heap-allocated Pattern with RefPtrs
to any internal resources such as SourceSurfaces or GradientStops. While this is
okay if the Pattern is transient, this causes problems if the clone is long-lived
and causes via the RefPtr the stored resource to stay alive, even when there are
no other external references to the resource.

In the case of DrawTargetWebgl's PathCache, we need to be able to create Pattern
clones that have internal weak references, while also still supporting the original
use-case of strong references. To this end we template-ize some of the Pattern
derivatives so that we can make either strong or weak versions according to use-case.
This case way we store a weak clone of a Pattern in the PathCache key, the reference
will automatically invalidate itself when all other external strong references to it
go away, without having to do external crawling of the PathCache to constantly prune
the last reference manually.

Differential Revision: https://phabricator.services.mozilla.com/D144381
2022-04-27 18:48:59 +00:00
Jon Coppeard
1aeb55dd59 Bug 1766276 - Give MaybeOneOf a map method r=jandem
There are a few places where we call one of two overloads of a fuction based on
the contents of a MaybeOneOf. We can simplify this code by giving the class a
map method.

Differential Revision: https://phabricator.services.mozilla.com/D144595
2022-04-26 12:29:24 +00:00
Steve Fink
4531b772d7 Bug 1440727 - Disallow extra data at the end of serialized data buffer r=decoder,jonco
Differential Revision: https://phabricator.services.mozilla.com/D141391
2022-04-22 03:08:47 +00:00
Chun-Min Chang
61d788c585 Bug 1238038 - Create an input-only audio source r=padenot
This patch creates an class managing an input-only audio stream within a
task thread. This class will be used as a source generating the audio
data to a NonNativeInputTrack in the following patch.

Depends on D116535

Differential Revision: https://phabricator.services.mozilla.com/D137911
2022-04-18 18:45:35 +00:00
Steve Fink
e4b6669027 Bug 1762537 - Omit some annotations when compiling under sixgill to avoid incompatibilities between what clang and gcc allow for lambda annotations r=firefox-static-analysis-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D142714
2022-04-15 15:43:10 +00:00
Christian Holler
8e5b003502 Bug 1764259 - [Fuzzing] Nyx replay mode. r=truber
Differential Revision: https://phabricator.services.mozilla.com/D143458
2022-04-14 12:10:14 +00:00
Christian Holler
cde0054620 Bug 1764258 - [Fuzzing] Nyx API enhancements. r=truber
Differential Revision: https://phabricator.services.mozilla.com/D143457
2022-04-14 12:10:13 +00:00
Mike Hommey
c8251f91f4 Bug 1758780 - Fallthrough to <atomic> for wasi when using clang >= 14. r=nika
Clang 14 added a dummy backoff policy for atomic polling that doesn't
know about threads, which presumably WASI can use.
See https://reviews.llvm.org/D114109.

Differential Revision: https://phabricator.services.mozilla.com/D143173
2022-04-13 03:02:24 +00:00
Emilio Cobos Álvarez
a9a85f3eca Bug 1763741 - Make gfx types take the right amount of space in MSVC. r=jrmuizel,glandium
This is an attribute that could be useful elsewhere so seems worth
putting in mfbt.

Differential Revision: https://phabricator.services.mozilla.com/D143249
2022-04-08 13:27:28 +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
Randell Jesup
da67253143 Bug 1207753 - minor cleanup of a comment r=nika
Differential Revision: https://phabricator.services.mozilla.com/D142084
2022-03-25 19:44:26 +00:00
Nika Layzell
c5e36e29ae Bug 1760357 - Part 6: Don't generate thread safety annotations on clang < 8.0, r=jesup
Depends on D141536

Differential Revision: https://phabricator.services.mozilla.com/D141701
2022-03-22 14:59:42 +00:00
Emilio Cobos Álvarez
b055f536ea Bug 1758702 - Allow ThreadSafeWeakPtr<IncompleteType> to work. r=glandium
This will be used to avoid problematic includes from WorkerPrivate.h,
and it matches the behavior of RefPtr<> and WeakPtr<>.

Differential Revision: https://phabricator.services.mozilla.com/D140658
2022-03-17 15:24:40 +00:00
criss
9302fa739c Backed out 2 changesets (bug 1758702) for causing build bustages. CLOSED TREE
Backed out changeset 3e00d9203851 (bug 1758702)
Backed out changeset 66625baf0875 (bug 1758702)
2022-03-17 15:21:31 +02:00
Emilio Cobos Álvarez
370bce32dc Bug 1758702 - Allow ThreadSafeWeakPtr<IncompleteType> to work. r=glandium
This will be used to avoid problematic includes from WorkerPrivate.h,
and it matches the behavior of RefPtr<> and WeakPtr<>.

Differential Revision: https://phabricator.services.mozilla.com/D140658
2022-03-17 12:15:20 +00:00
Randell Jesup
addf814b52 Bug 1207753 - Base thread-safety attribution support r=nika
Differential Revision: https://phabricator.services.mozilla.com/D130606
2022-03-16 23:01:41 +00:00
Cristian Tuns
43db1804cf Backed out changeset 3b8c7fa73e82 (bug 1207753) for causing build bustages on Monitor.h CLOSED TREE 2022-03-16 16:45:54 -04:00
Randell Jesup
e72ce3cd6c Bug 1207753 - Base thread-safety attribution support r=nika
With additions of MOZ_UNANNOTATED for *Mutex/*Monitor/RWLock classes

Differential Revision: https://phabricator.services.mozilla.com/D130606
2022-03-16 20:10:04 +00:00
Randell Jesup
fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli
2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup
4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Butkovits Atila
927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup
7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
Zhao Jiazhong
62341514c5 Bug 1756570 - [loong64] Add basic build support for LoongArch64 port. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D139567
2022-02-25 03:42:34 +00:00
Toshihito Kikuchi
076c992786 Bug 1750791 - Part 1: Add LinkedList::mergeBack and LinkedList::splice. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D137244
2022-02-24 15:00:27 +00:00
Kelsey Gilbert
aeeb1e199d Bug 1750310 - Centralize and reuse pixelstorei pack/unpack handling. r=lsalzman
* Accept that finding an explicit unpack for a given stride might fail.
* Directly use the logic from the GLES spec for unpacking stride calculations.
* Use structuredSrcSize member.
* Calc explicit unpack based on dstStride, not srcStride.

Differential Revision: https://phabricator.services.mozilla.com/D136052
2022-02-12 02:20:42 +00:00
Nika Layzell
fa19de50d5 Bug 1754305 - Make assertions in Maybe MOZ_RELEASE_ASSERT, r=glandium
These assertions are already diagnostic asserts, and this will make
failures to check Maybe into safe crashes rather than security bugs on
all branches.

A failure to check Maybe is more dangerous than a null pointer
dereference, as the generated code will produce a valid reference to
uninitialized data rather than a null reference which should safely
segfault.

Differential Revision: https://phabricator.services.mozilla.com/D138208
2022-02-11 16:28:01 +00:00
Paul Adenot
f0f4d715ec Bug 1752345 - Allow calling AvailableWrite or AvailableRead on any thread. r=alwu
This is safe in fact safe. The data might be a bit late, but it's going to be
correct.

Differential Revision: https://phabricator.services.mozilla.com/D137302
2022-02-03 15:18:13 +00:00
Kagami Sascha Rosylight
901a35ec10 Bug 1748874 - Part 5: Require CAN_RUN_SCRIPT to be at the first declaration r=andi
Depends on D135404

Differential Revision: https://phabricator.services.mozilla.com/D135405
2022-01-11 11:52:27 +00:00
Mike Hommey
b89cb6ae18 Bug 1748969 - Move definition of MOZ_DIAGNOSTIC_ASSERT_ENABLED to configure. r=emilio
Original patch by emilio.

Differential Revision: https://phabricator.services.mozilla.com/D135321
2022-01-07 21:24:44 +00:00
Mike Hommey
fa1a339437 Bug 1748969 - Enable diagnostic asserts on early beta instead of dev edition. r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D135320
2022-01-07 21:24:44 +00:00
Chris Peterson
f0c33cdf01 Bug 1745118 - double-conversion: add MOZ_CRASH reasons to use-mozilla-assertions.patch. r=glandium
Adding MOZ_CRASH reasons will help disambiguate any of these crashes in crash ping telemetry (which doesn't have symbolicated crash signatures or stack traces like crash reports).

Differential Revision: https://phabricator.services.mozilla.com/D133582
2021-12-22 04:34:13 +00:00
Chris Peterson
e1a50b756e Bug 1745118 - double-conversion: update double-conversion to version 3.1.6 (upstream revision 60e08d0). r=glandium
* Fix update.sh to use macOS-compatible mktemp -d flag.
* Rebase use-mozilla-assertions.patch to fix merge conflict.
* Rebase debug-only-functions.patch to fix merge conflict.
* Rebase to-fixed-dbl-max.patch to fix merge conflict.
* Remove to-fixed-digits-after-point.patch because upstream has this fix now.

https://github.com/google/double-conversion/releases/tag/v3.1.6

Cleanups and new architectures:

* Features some code cleanups.
* Adds the following new architectures: loongarch, xtensa, nios2, e2k.

Differential Revision: https://phabricator.services.mozilla.com/D133581
2021-12-22 04:34:12 +00:00
Mike Hommey
b6a4e7c184 Bug 1746540 - Move --enable-logrefcnt to python configure. r=nika,firefox-build-system-reviewers,mhentges
And simplify the defines it sets.

Differential Revision: https://phabricator.services.mozilla.com/D134099
2021-12-18 00:32:35 +00:00
Sandor Molnar
eac95b4a93 Backed out 6 changesets (bug 1746539, bug 1746541, bug 1746544, bug 1746540, bug 1746542, bug 1746299) for causing android build bustages in cutils/properties. CLOSED TREE
Backed out changeset 9352292fa327 (bug 1746544)
Backed out changeset 3cc761d90071 (bug 1746542)
Backed out changeset 8d8fc11e8012 (bug 1746541)
Backed out changeset 5f53612aad1b (bug 1746540)
Backed out changeset afb601202b24 (bug 1746539)
Backed out changeset 90027c44c9af (bug 1746299)
2021-12-18 01:28:06 +02:00
Mike Hommey
86100100a6 Bug 1746540 - Move --enable-logrefcnt to python configure. r=nika,firefox-build-system-reviewers,mhentges
And simplify the defines it sets.

Differential Revision: https://phabricator.services.mozilla.com/D134099
2021-12-17 22:52:09 +00:00