If the implementation of an XPCOM service constructor involves dispatching an
event to another thread and blocking the current thread on that event, a
deadlock can occur if the target thread is also attempting to obtain that
service at the same time.
For instance, say nsIExampleService needs to be constructed on the main thread,
but some code in thread T is attempting to get a handle on it. Suppose the
implementation checks which thread it's running on and dispatches a synchronous
event to the main thread to do the actual construction work in the case that it
is not on the main thread. Further suppose that before that event is run, other
code on the main thread also attempts to get a handle on nsIExampleService. The
XPCOM service machinery sees that another thread is in the process of
constructing nsIExampleService, so it must wait for that to complete. However,
the thread that is attempting to do this construction is waiting for an event
to be run on the main thread. Thus, these two threads are deadlocked.
Before this patch, the XPCOM service machinery worked around this problem by
processing events on the second thread until it could proceed. However, this
caused a nested event loop, which is bad for stability because all guarantees
relating to when events will run are violated. In particular, this could cause
reentrency into the TLS implementation, which is not expected and has caused
intermittent crashes.
This patch removes the nested event loop in
nsComponentManagerImpl::GetServiceLocked in favor of not synchronously
dispatching events in XPCOM service constructors. One way to fix such
constructors is to move the event dispatch and blocking outside of the XPCOM
service machinery. See the other patch in this bug for an example.
Differential Revision: https://phabricator.services.mozilla.com/D92800
Since it's already possible to use the type if its declaration is auto, this
change just allows us to return it from functions.
Differential Revision: https://phabricator.services.mozilla.com/D96936
Like Chromium, use the undocumented rosetta_translate_binaries function from
libRosetta.dylib to pre-translate XUL and the plugin file at browser startup
to reduce translation delays incurred when starting an x64 plugin process.
All changes #ifdef'd to Mac ARM64.
Differential Revision: https://phabricator.services.mozilla.com/D97105
VoiceOver pre-caches live region data and does its own deltas to
know what to parts of a subtree changed, and what to announce
based on AXARIAAtomic and AXARIARelevant.
I added a removed event as well. This will help us cache a "live region"
flag in the main process and avoid sync round trips for attributes when not needed.
Differential Revision: https://phabricator.services.mozilla.com/D96291
This also introduces a thread_sanitizer feature to gkrust for any other
crates that need similar special handling. (`cfg(sanitizer="thread")` is
unfortunately an unstable feature, so it isn't useful here.)
Differential Revision: https://phabricator.services.mozilla.com/D95950
VoiceOver pre-caches live region data and does its own deltas to
know what to parts of a subtree changed, and what to announce
based on AXARIAAtomic and AXARIARelevant.
I added a removed event as well. This will help us cache a "live region"
flag in the main process and avoid sync round trips for attributes when not needed.
Differential Revision: https://phabricator.services.mozilla.com/D96291
VoiceOver pre-caches live region data and does its own deltas to
know what to parts of a subtree changed, and what to announce
based on AXARIAAtomic and AXARIARelevant.
I added a removed event as well. This will help us cache a "live region"
flag in the main process and avoid sync round trips for attributes when not needed.
Differential Revision: https://phabricator.services.mozilla.com/D96291
When running as a "universal" build, use an x64 GMP child process if the CDM library is an x64 binary.
Use ifdefs extensively to reduce risk to Intel builds if the fix needs to be uplifted.
Requires a server-side balrog change to serve an Intel Widevine binary to ARM browser versions.
Differential Revision: https://phabricator.services.mozilla.com/D96288
VoiceOver pre-caches live region data and does its own deltas to
know what to parts of a subtree changed, and what to announce
based on AXARIAAtomic and AXARIARelevant.
I added a removed event as well. This will help us cache a "live region"
flag in the main process and avoid sync round trips for attributes when not needed.
Differential Revision: https://phabricator.services.mozilla.com/D96291
This also introduces a thread_sanitizer feature to gkrust for any other
crates that need similar special handling. (`cfg(sanitizer="thread")` is
unfortunately an unstable feature, so it isn't useful here.)
Differential Revision: https://phabricator.services.mozilla.com/D95950
This patch is part of an ongoing work to help our test suite show developer errors that are currently being swallowed by `try { ... } catch (e) { ... }`.
Previous patches in the work used the heuristic that all instances of `TypeError`, `SyntaxError` and `ReferenceError` are developer errors unless specified otherwise. As it turns out, we are throwing `TypeError` in many cases that are not type errors. Since we have no manner of distinguishing which of these cases are actual (developer) errors and which are runtime exceptions, this patch removes `TypeError` from the list of developer errors.
Ideally, a followup patch would carefully reactivate `TypeError`, with a mechanism to annotate which actually represent type errors (typically, those thrown by SpiderMonkey or `throw new TypeError`) and which do not (typically, most of the instances of `TypeError` thrown by DOM operations).
Differential Revision: https://phabricator.services.mozilla.com/D95276
This adds some coverage for nsTSubString::AppendPrintf. These tests will be
expanded in future patches, but this gives some baseline coverage. Importantly
for the bug at hand, this provides a test case that shows the unexpected
overload resolution on Windows.
Differential Revision: https://phabricator.services.mozilla.com/D95051
Poison was setup at the start of xpcom init when that was assumed to be early enough.
Since then, Poison was added to Maybe, and Maybe has been used everywhere, including in
our channel implementation. As a result, poison was being used before it was initialized.
This basically meant our poison pointers were being replaced with null instead, which
dances into some more UB than accessing a page we have actually allocated. Also, tsan
noticed that accesses to the value were racing with the initializer actually being
called!
A (dynamic) static initializer forces the poison initialization as we can reasonably
hope without getting CallOnce or singleton patterns involved.
Other changes:
* Cleaned up the outdated documentation for mozWritePoison (the alignment
restriction was removed in Bug 1414901)
* Removed the poison supression from TSan
Differential Revision: https://phabricator.services.mozilla.com/D94251
These files were omitted from the original patch because reformatting them required some manual intervention in order to avoid breaking unit tests. Generally the `noqa` lines were already there and just needed to be moved from one line to another (due to the reformatting by `black`), but sometimes `black` saw fit to move a bunch of stuff all onto one line, requiring me to introduce new `noqa` lines.
Besides the autoformat by `black` and some manual fixups, this patch contains no other changes.
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94052
Depends on D94045
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
This renames the thread and identifiers derived from the thread's name. This is
to avoid ambiguity over if the thread relates to the MediaController class,
which it does not.
Differential Revision: https://phabricator.services.mozilla.com/D93806
These files were omitted from the original patch because reformatting them required some manual intervention in order to avoid breaking unit tests. Generally the `noqa` lines were already there and just needed to be moved from one line to another (due to the reformatting by `black`), but sometimes `black` saw fit to move a bunch of stuff all onto one line, requiring me to introduce new `noqa` lines.
Besides the autoformat by `black` and some manual fixups, this patch contains no other changes.
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94052
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
My original patch handled the grow case but not the shrink case. When the
current and new allocation sizes are in different size classes jemalloc's
realloc will move the allocation when shrinking, not just truncate the existing
one.
Differential Revision: https://phabricator.services.mozilla.com/D93654
These files were omitted from the original patch because reformatting them required some manual intervention in order to avoid breaking unit tests. Generally the `noqa` lines were already there and just needed to be moved from one line to another (due to the reformatting by `black`), but sometimes `black` saw fit to move a bunch of stuff all onto one line, requiring me to introduce new `noqa` lines.
Besides the autoformat by `black` and some manual fixups, this patch contains no other changes.
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94052
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Allow Rust Futures to be polled to completion on the current thread's
`nsIEventTarget`.
Futures don't need to be `Send` since they are polled on the thread spawning the
task responsible to completing the Future.
Differential Revision: https://phabricator.services.mozilla.com/D89694
The `clobber` targets are superseded by `mach clobber`, so we don't need them for any reason. The `clean` target is meant to get you to a post-`configure` state, but it doesn't really work, and if it's necessary for you to be in that state for some reason you can just clobber and re-`configure`, so it doesn't seem worth it to get it working again. Instead, delete all of them. Also delete `everything` which is not useful when `clobber` doesn't exist.
Differential Revision: https://phabricator.services.mozilla.com/D93514
This API is only used in one place, with a callback that calls into a tracer,
so we can make this take a tracer in the first place and cut out one level of
indirection.
Depends on D93152
Differential Revision: https://phabricator.services.mozilla.com/D93153
ExternMozLog treated aMsg as a format, instead of the string being printed.
If it happened to contain any escape sequences, it led to a crash as the parameters weren't there.
Differential Revision: https://phabricator.services.mozilla.com/D92886
- Increase maximum message length
- Ensure that file/line output is using the file:line style such that IDEs and
other tools can easily link it to the source code locations
Differential Revision: https://phabricator.services.mozilla.com/D91239
I gave TraceOptions some implicit consturctors to make it easier to set a
single option by passing an enum value.
Depends on D92595
Differential Revision: https://phabricator.services.mozilla.com/D92596
- onSVGZoom is gone and we no longer dispatch it.
- we've never dispatched SVGUnload or SVGResize events and if we did implement these they would be unload and resize events now.
Differential Revision: https://phabricator.services.mozilla.com/D92381
Currently we have two different enums that determine the tracer kind. Combine
this into a single enum and move it to the JS namespace.
Differential Revision: https://phabricator.services.mozilla.com/D92253
The instances of this are called 'actions' everywhere and I think it makes
sense that the type should be called that. Also make it an enum class and move
it into the JS namespace.
Differential Revision: https://phabricator.services.mozilla.com/D92252
The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.
Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.
As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`
Differential Revision: https://phabricator.services.mozilla.com/D91680
The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.
Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.
As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`
Differential Revision: https://phabricator.services.mozilla.com/D91680
No longer reset a moved-from Result to an error state, which required
UnusedZero<E>::GetDefaultValue, which was somewhat confusing, and might
also be inefficient. Leaving Result in a valid state, which might be a
success or error state is sufficient.
Differential Revision: https://phabricator.services.mozilla.com/D91250
In the initial patches for bug 1656526, mhowell noticed that for startups which
take a very long time, if the user interacts with the skeleton UI window, the OS
will flag us as not responsive, which could be a poorer user experience than
seeing nothing. Since our UI is designed to look non-interactive anyway, we
assume that a better experience would be to simply squash the not responsive
response from the OS by trivially processing native events. It's not perfect in,
say, the event that startup is hung for some reason, but it's arguably preferable
to our old model of startup being hung, which was just nothing being displayed at
all.
Differential Revision: https://phabricator.services.mozilla.com/D91005
Virtual keyboard on Android (and API level of GTK) supports autocapitalization
that is automatically capitalize words and etc.
atucapitalize attribute inherits from form element if the element is button,
fieldset, input, output, select and textarea. Its tests are included in wpt.
WebKit on iOS and Blink on Android already support this HTML attribute, so I
would like to support this on Firefox/GeckoView Nightly.
Differential Revision: https://phabricator.services.mozilla.com/D86674
We want to collect information on late writes via telemetry. We have been
doing this in Nightly for a while now, but want to do so in beta/release. I
was actually initially unaware of this limitation of the IOInterposer, but
we need the IOInterposer to collect information on late writes, so I would
like to enable it for just early beta, in the hopes that we can catch any
late writes that may be happening, without adding a performance tax onto
release.
Accordingly, is perf the only reason that this was restricted to Nightly?
And if so, did we measure a perf difference, or was this just general
caution regarding the performance impact? Is there anything else to look
out for?
Differential Revision: https://phabricator.services.mozilla.com/D90894