Bug 1613440 added a checker to prevent a profusion of new threads.
Unfortunately, it operates directly on C++ source code, and there is no
equivalent for Rust code.
It _is_ possible to construct such an equivalent (see bug 1810242), but
it's nontrivial. For now, let's just prevent the use of dynamic thread
names, to minimize the profusion of uninterestingly-distinct thread
names in our `XPCOMSpinEventLoopStack` crash-report field.
Differential Revision: https://phabricator.services.mozilla.com/D166842
This code was previously incorrectly targeting the timer at the dispatching
thread. This is fortunately not an issue, as idle runnables with timeouts are
always dispatched from the main thread, however it could be an issue for future
idle runnables with timeouts dispatched from off-main-thread.
Differential Revision: https://phabricator.services.mozilla.com/D166610
This code was previously incorrectly targeting the timer at the dispatching
thread. This is fortunately not an issue, as idle runnables with timeouts are
always dispatched from the main thread, however it could be an issue for future
idle runnables with timeouts dispatched from off-main-thread.
Differential Revision: https://phabricator.services.mozilla.com/D166610
There are many Linux systems where $HOME is preferred as the "default"
directory to $HOME/Desktop.
This prevents the creation of $HOME/Desktop every time about:preferences
is opened.
Differential Revision: https://phabricator.services.mozilla.com/D165979
The only consumer of this feature has been removed, so we don't need it
anymore. It acts very differently than other runnables run on the main thread,
so removing it will simplify things.
Differential Revision: https://phabricator.services.mozilla.com/D164841
The only consumer of this feature has been removed, so we don't need it
anymore. It acts very differently than other runnables run on the main thread,
so removing it will simplify things.
Differential Revision: https://phabricator.services.mozilla.com/D164841
This will mean that we drain direct tasks immediately after executing
things like native OS messages through OnProcessNextEvent, and also that
we drain direct messages immediately when entering a nested event loop,
rather than after processing the first runnable in that nested event
loop. This should make the behaviour a bit more consistent.
Differential Revision: https://phabricator.services.mozilla.com/D164839
As of the prior patch, these are no longer needed. I removed
these with a script, then ran clang-format on the files, then
manually reverted a few unrelated changed from the formatter.
Differential Revision: https://phabricator.services.mozilla.com/D164829
Bug 181137 made ContentIteratorBase no longer refcounted, but
it did not remove this bit of CC boilerplate. With the inline
root, using this macro in a non-refcounted class is an error.
ObjectModel.h and ClientWebGLContext.cpp used macros to define
root and unroot, but that is no longer needed.
Differential Revision: https://phabricator.services.mozilla.com/D164828
Actually, we can get Android release version from JNI generator, so it is
unnecessary to use `AndroidBridge` to get it.
Also, this cleans up unused AndroidBridge functions.
Differential Revision: https://phabricator.services.mozilla.com/D164431
Some debug infrastructure like MOZ_WEAKPTR_INIT_THREAD_SAFETY_CHECK that can apparently be triggered by nsComponentManagerImpl::gComponentManager->FreeService() seem to rely on the existence of a serial event target even if they do not post any events. So it seems sound to keep a representation of the main thread as nsThread object until after final XPCOM shutdown.
But nsThreadManager::ShutdownMainThread() does more, it processes the last round of events, removes the thread's observer and closes down the background event target. We do not want to move these operations to happen later than before, such that we split the nsThread release into a separate function and move that together with AbstractThread::ShutdownMainThread() behind FreeService().
Depends on D160628
Differential Revision: https://phabricator.services.mozilla.com/D162497
This change will effectively anticipate the fast shutdown by half a phase, making it more coherent with the phase it is defined to happen.
Depends on D160250
Differential Revision: https://phabricator.services.mozilla.com/D160628