This has several implications:
* A race-condition that could manifest itself both on macOS and Linux is
removed. The race could happen if we took the lock to the thread name
mapping while another suspended thread was in the memory allocator. Taking
the lock required an allocation thus the thread acting within the exception
handler would get stuck.
* We save a few KiBs of memory per process since we don't have to keep the
thread name mapping around.
* Thread startup will be slightly faster since the first thing each new thread
did was to fill its own mapping.
Differential Revision: https://phabricator.services.mozilla.com/D139319
This splits the API into two, one that does a bunch of checks and calls into
the JS engine, and one for use by the CC where all preconditions are assumed to
be satisfied and can be inlined entirely.
Depends on D140865
Differential Revision: https://phabricator.services.mozilla.com/D140866
And in one case, #include "mozilla/ProfilerThreadState.h" where only `AUTO_PROFILER_THREAD_WAKE` is used.
Depends on D140172
Differential Revision: https://phabricator.services.mozilla.com/D140173
This will allow the types to be more easily automatically substituted in place
of `IPC::Message`, as the type will already be declared in places it is used.
Differential Revision: https://phabricator.services.mozilla.com/D140000
This has several implications:
* A race-condition that could manifest itself both on macOS and Linux is
removed. The race could happen if we took the lock to the thread name
mapping while another suspended thread was in the memory allocator. Taking
the lock required an allocation thus the thread acting within the exception
handler would get stuck.
* We save a few KiBs of memory per process since we don't have to keep the
thread name mapping around.
* Thread startup will be slightly faster since the first thing each new thread
did was to fill its own mapping.
Differential Revision: https://phabricator.services.mozilla.com/D139319
This profiler-controlling functions are used in very few places, so it's good to have them in a separate header to reduce dependencies.
On top of making GeckoProfiler.h lighter, this is actually needed for this bug, because a later patch adds MozPromise to profiler_start and others, which would have created a header loop (GeckoProfiler -> MozPromise -> Monitor -> CondVar -> GeckoProfiler) that makes the build fail.
Differential Revision: https://phabricator.services.mozilla.com/D139331
This patch introduces a new system for building IPDL unit tests, which is
roughly inspired by the old cxx unit test design, however designed to work with
gtest. It re-uses the existing IPDLUnitTest process type, using static
constructors only present in xul-gtest to register child actor constructors and
ProcessChild implementations to avoid bloating xul.
The IPDLUnitTest actor is used as a backchannel to communicate test failures
from the child process back to the parent process, and manage the test's async
lifecycle more reliably.
The IPDLUnitTest process also needed to have various properties about how it was
initialized adjusted:
* The IPDLUnitTest process should now always load xul-gtest when running
gtests, by using the "Self" process type and adding a DYLD_LIBRARY_PATH override
on macOS where the "Self" process type cannot be used.
* The IPDLUnitTest process now initializes minimal XPCOM, and runs a
frankeneventloop to allow it to use XPCOM event loop structures such as
SpinEventLoopUntil in tests.
* Support for creating IPDLUnitTest processes on Android was added, as these
tests had never run on android before.
Differential Revision: https://phabricator.services.mozilla.com/D137170
This is consistent with how xpcom's Mutex has its platform-dependent code in mozglue, and will allow readers-writer locks in mozglue without duplication.
Differential Revision: https://phabricator.services.mozilla.com/D139669
In bug 1436263, I added a cpp-virtual-final.yml linter to warn about virtual function declarations that included more than one virtual function specifier `virtual`, `final`, or `override`.
I think we should remove this linter now because:
* It's just a style check and doesn't diagnose a real bug. Including more than one virtual function specifier (`virtual`, `final`, or `override`) is harmless and unambiguous, just unnecessary extra code.
* It has caused some engineer frustration because this style check caused their changeset to be backed out of autoland. Backing out and fixing these style issues are not a good use of sheriffs' or engineers' time.
* It doesn't catch all virtual/final/override style issues because:
* It can't analyze virtual function definitions that span multiple lines.
* It doesn't check for `virtual void Foo() override` because there are over 6000 cases already, so our code will never follow this style check consistently.
Differential Revision: https://phabricator.services.mozilla.com/D139454
Use the http-equiv meta code-path to handle it. No tests yet,
because for now we're not using any key so verification
would always fail.
Differential Revision: https://phabricator.services.mozilla.com/D139314
The core of the problem here is that Maybe::reset invokes the d'tor first, and
then clears the value, whereas unique_ptr::reset does the opposite.
Differential Revision: https://phabricator.services.mozilla.com/D138564
This patch introduces a new system for building IPDL unit tests, which is
roughly inspired by the old cxx unit test design, however designed to work with
gtest. It re-uses the existing IPDLUnitTest process type, using static
constructors only present in xul-gtest to register child actor constructors and
ProcessChild implementations to avoid bloating xul.
The IPDLUnitTest actor is used as a backchannel to communicate test failures
from the child process back to the parent process, and manage the test's async
lifecycle more reliably.
The IPDLUnitTest process also needed to have various properties about how it was
initialized adjusted:
* The IPDLUnitTest process should now always load xul-gtest when running
gtests, by using the "Self" process type and adding a DYLD_LIBRARY_PATH override
on macOS where the "Self" process type cannot be used.
* The IPDLUnitTest process now initializes minimal XPCOM, and runs a
frankeneventloop to allow it to use XPCOM event loop structures such as
SpinEventLoopUntil in tests.
* Support for creating IPDLUnitTest processes on Android was added, as these
tests had never run on android before.
Differential Revision: https://phabricator.services.mozilla.com/D137170