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

85 Коммитов

Автор SHA1 Сообщение Дата
Fabrice Desré c50cb528fc Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 16:39:41 +00:00
Andreea Pavel 3ccd75af8d Backed out changeset b9d2965591b9 (bug 1761040) for landing with wrong author CLOSED TREE DONTBUILD 2022-08-03 18:55:00 +03:00
Andreea Pavel fdb7cb2ecd Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 15:27:43 +00:00
Andreea Pavel 89d63c91e6 Backed out changeset a907159a482f (bug 1761040) for causing build bustages on a CLOSED TREE 2022-08-02 04:59:08 +03:00
Fabrice Desré 0f4ac7ad97 Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-02 00:49:41 +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
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
Simon Giesecke f1f098cdaa Bug 1700336 - Use MaybeStorageBase in Maybe. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D109487
2021-03-24 13:21:31 +00:00
Simon Giesecke ae75c3faa8 Bug 1601556 - Make Result<V, E> a literal type if V and E are literal types and PackingStrategy is not Variant. r=emilio
Also make CompactPair<A, B> a literal type if A and B are literal types,
and add MaybeStorageBase that ought to be used as a basis of MaybeStorage
in a follow-up patch.

Differential Revision: https://phabricator.services.mozilla.com/D55930
2021-03-23 12:35:19 +00:00
Ting-Yu Lin fd531e4c1a Bug 1683227 - Add a note to Maybe::valueOr() about a suboptimal usage. r=sg DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D100071
2020-12-21 18:32:26 +00:00
Simon Giesecke 8c5c02b43d Bug 1680724 - Add a utility function that converts a T* to a Maybe<T&>. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D98783
2020-12-08 17:49:22 +00:00
Gerald Squelart 32c0d65819 Bug 1500811 - Maybe::operator*()&&, ref()&&, value()&& - r=sg,sfink
There are also equivalents for `const&&`, which should be rare.

The small change in `LiveSavedFrameCache::insert` was necessary because `*lookup.framePtr()` now returns an rvalue-ref (as it should).

Differential Revision: https://phabricator.services.mozilla.com/D98049
2020-12-02 00:14:41 +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
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 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
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
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 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 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 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 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 1be056677a Bug 1625138 - Part 26: Replace mozilla::Conditional with std::conditional. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68381

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:18 +00:00
André Bargull 3ee851a1a5 Bug 1625138 - Part 25: Replace mozilla::RemoveReference with std::remove_reference. r=froydnj,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D68380

--HG--
extra : moz-landing-system : lando
2020-03-28 14:16:19 +00:00
Simon Giesecke d3deabac64 Bug 1613363 - Maybe<T> should preserve trivial copy-constructability and destructability of T. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68173

--HG--
extra : moz-landing-system : lando
2020-03-27 14:22:51 +00:00
Simon Giesecke 0cc5c6e63f Bug 1052940 - Make Maybe<T> only declare copy/move operations if T is copyable/movable. r=froydnj,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D68172

--HG--
extra : moz-landing-system : lando
2020-03-27 14:10:45 +00:00
Simon Giesecke a22b36fb7a Bug 1620568 - Disable equality comparison operators for Maybe<T&>. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D67135

--HG--
extra : moz-landing-system : lando
2020-03-18 13:24:17 +00:00
Simon Giesecke 84fb884937 Bug 1620568 - Add support for Maybe<T&>. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D66068

--HG--
extra : moz-landing-system : lando
2020-03-12 14:54:28 +00:00
Simon Giesecke b5fae19786 Bug 1617546 - Provide operator== for mozilla::Nothing. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D63842

--HG--
extra : moz-landing-system : lando
2020-02-24 17:53:39 +00:00
Cosmin Sabou 7f1afff492 Backed out 5 changesets (bug 1617604, bug 1617542, bug 1617546) for causing build bustages on ipc/mscom/Interceptor.cpp.
CLOSED TREE

Backed out changeset 5faa54ad950e (bug 1617542)
Backed out changeset cb38779e1eb6 (bug 1617604)
Backed out changeset 3aea18e0396f (bug 1617542)
Backed out changeset bc3eeefdfb6c (bug 1617542)
Backed out changeset b76a3aa5ff6f (bug 1617546)
2020-02-24 19:50:13 +02:00
Simon Giesecke 24ebaad98d Bug 1617546 - Provide operator== for mozilla::Nothing. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D63842

--HG--
extra : moz-landing-system : lando
2020-02-24 16:15:20 +00:00
Emilio Cobos Álvarez 256c124f94 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
This was done by:

This was done by applying:

```
diff --git a/python/mozbuild/mozbuild/code-analysis/mach_commands.py b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
index 789affde7bbf..fe33c4c7d4d1 100644
--- a/python/mozbuild/mozbuild/code-analysis/mach_commands.py
+++ b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
@@ -2007,7 +2007,7 @@ class StaticAnalysis(MachCommandBase):
         from subprocess import Popen, PIPE, check_output, CalledProcessError

         diff_process = Popen(self._get_clang_format_diff_command(commit), stdout=PIPE)
-        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format]
+        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format, '-sort-includes']

         if not output_file:
             args.append("-i")
```

Then running `./mach clang-format -c <commit-hash>`

Then undoing that patch.

Then running check_spidermonkey_style.py --fixup

Then running `./mach clang-format`

I had to fix four things:

 * I needed to move <utility> back down in GuardObjects.h because I was hitting
   obscure problems with our system include wrappers like this:

0:03.94 /usr/include/stdlib.h:550:14: error: exception specification in declaration does not match previous declaration
0:03.94 extern void *realloc (void *__ptr, size_t __size)
0:03.94              ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/malloc_decls.h:53:1: note: previous declaration is here
0:03.94 MALLOC_DECL(realloc, void*, void*, size_t)
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozilla/mozalloc.h:22:32: note: expanded from macro 'MALLOC_DECL'
0:03.94     MOZ_MEMORY_API return_type name##_impl(__VA_ARGS__);
0:03.94                                ^
0:03.94 <scratch space>:178:1: note: expanded from here
0:03.94 realloc_impl
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozmemory_wrap.h:142:41: note: expanded from macro 'realloc_impl'
0:03.94 #define realloc_impl mozmem_malloc_impl(realloc)

   Which I really didn't feel like digging into.

 * I had to restore the order of TrustOverrideUtils.h and related files in nss
   because the .inc files depend on TrustOverrideUtils.h being included earlier.

 * I had to add a missing include to RollingNumber.h

 * Also had to partially restore include order in JsepSessionImpl.cpp to avoid
   some -WError issues due to some static inline functions being defined in a
   header but not used in the rest of the compilation unit.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:19:48 +00:00
Emilio Cobos Álvarez aa3a695712 Bug 1609996 - Remove mozilla/Move.h. r=froydnj
rg -l 'mozilla/Move.h' | xargs sed -i 's/#include "mozilla\/Move.h"/#include <utility>/g'

Further manual fixups and cleanups to the include order incoming.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:18:20 +00:00
David Major 824b73f655 Bug 1572205 - Use a single-member union as the storage for Maybe r=jwalden
My personal motivation for doing this is to stop the compiler from inserting stack protectors into tons of functions that wouldn't otherwise have them (arrays on the stack are one of the triggers for stack protection). But others see different benefits, such as being able to remove the `MOZ_NON_PARAM` annotation. Also this is the approach recommended by https://github.com/CppCon/CppCon2019/tree/master/Presentations/how_to_hold_a_t.

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

--HG--
extra : moz-landing-system : lando
2020-01-07 23:50:31 +00:00
David Major fd241bcb5a Bug 1594267 - Make OutOfLinePoisoner::poison be MOZ_NEVER_INLINE r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D51960

--HG--
extra : moz-landing-system : lando
2019-11-06 14:10:15 +00:00
Andrew McCreight 9e451b1da0 Bug 1517611 - Cycle collect WebAuthnManager and U2F more. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D17026

--HG--
extra : moz-landing-system : lando
2019-01-18 23:21:46 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Gerald Squelart 964e9708ac Bug 1054115 - Maybe::map and apply now take the function through a forwarding reference - r=froydnj
No need to specify the return type in C++14, this save some less-readable
decltype&declval work.

And we make sure to std::forward the function object before invoking it, to
preserve its const and l/rvalue qualifiers.

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

--HG--
extra : moz-landing-system : lando
2018-10-25 17:20:02 +00:00
Mike Hommey b487ebbc58 Bug 1493093 - Allow to relax MOZ_NON_TEMPORARY_CLASS for some specific constructors r=andi
Differential Revision: https://phabricator.services.mozilla.com/D6566

--HG--
extra : moz-landing-system : lando
2018-09-24 22:47:12 +00:00
Dylan Roeh b18b70dfcf Bug 1489257 - Backed out 3 changesets (bug 1441059, bug 1478171) for causing bug 1489257. r=me
Backed out changeset f7bd4f224f9a (bug 1441059)
Backed out changeset e66e6bd82e3f (bug 1441059)
Backed out changeset 94cfd6113ca7 (bug 1478171)
2018-09-13 12:27:23 -05:00
arthur.iakab 9b05873885 Backed out changeset 16d2d6dc3cdf (bug 1489257)on request by droeh for causing geckowiev failures
--HG--
extra : rebase_source : 6a1e51a55ff18795c981518845735fe73bd78b6c
extra : amend_source : 3c5f4c8f15db8f361b41f29e632ff42563753639
2018-09-11 18:47:58 +03:00
Dylan Roeh 2cf215fea4 Bug 1489257 - Backed out 3 changesets (bug 1441059, bug 1478171) for causing bug 1489257. r=me
Backed out changeset f7bd4f224f9a (bug 1441059)
Backed out changeset e66e6bd82e3f (bug 1441059)
Backed out changeset 94cfd6113ca7 (bug 1478171)
2018-09-10 16:15:31 -05:00
Dylan Roeh 5fa70ba038 Bug 1441059 - Add cycle collection implementations for Maybe. r=bz 2018-07-17 10:34:58 -05:00
Emilio Cobos Álvarez 1e9c395548 Bug 1466168: Remove mozilla::Forward in favor of std::forward. r=froydnj
Same approach as the other bug, mostly replacing automatically by removing
'using mozilla::Forward;' and then:

  s/mozilla::Forward/std::forward/
  s/Forward</std::forward</

The only file that required manual fixup was TestTreeTraversal.cpp, which had
a class called TestNodeForward with template parameters :)

MozReview-Commit-ID: A88qFG5AccP
2018-06-02 09:33:26 +02:00
Emilio Cobos Álvarez fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

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

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

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

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Nathan Froyd b29b040b36 Bug 1410186 - turn Maybe assertions into diagnostic assertions; r=bkelly
We out-of-line the relevant functions because assertions can generate
quite a bit of code, and we'd rather let the compiler determine if these
functions should be inlined now.
2018-05-21 10:03:59 -04:00