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
Among other things, there were some misuses of std::forward, and
GenericErrorResult was (presumably accidentally) instatiated with
references as the template argument type, e.g. const nsresult&,
which circumvented the check for not calling it with NS_OK in
ResultExtensions.h
Differential Revision: https://phabricator.services.mozilla.com/D90561
Among other things, there were some misuses of std::forward, and
GenericErrorResult was (presumably accidentally) instatiated with
references as the template argument type, e.g. const nsresult&,
which circumvented the check for not calling it with NS_OK in
ResultExtensions.h
Differential Revision: https://phabricator.services.mozilla.com/D90561
The RDD process gets shutdown following a NS_XPCOM_SHUTDOWN_OBSERVER_ID notification.
Notifications are processed in LIFO order, since the RDD process is started on demand it would have typically be registered after a content process.
We must ensure that the RDD get shutdown after all content processes so that it can receive notifications that the RemoteDecoderManagerChilds are shutting down.
Differential Revision: https://phabricator.services.mozilla.com/D90485
The RDD process gets shutdown following a NS_XPCOM_SHUTDOWN_OBSERVER_ID notification.
Notifications are processed in LIFO order, since the RDD process is started on demand it would have typically be registered after a content process.
We must ensure that the RDD get shutdown after all content processes so that it can receive notifications that the RemoteDecoderManagerChilds are shutting down.
Differential Revision: https://phabricator.services.mozilla.com/D90485
I've wanted to use this recently for a couple things. This uses the
same scheme and even templates we use for attributes, so it's mostly
moving code around...
Inverting the code generation so that the implementation is infallible,
and we actually generate the NS_IMETHOD goop inline somehow could be
potentially desirable, though that causes an extra virtual call for
non-C++ callers I guess, so maybe it's not such a great trade-off. Plus
it seems more complicated...
Explicitly forbid mixing infallible with notxpcom (as it doesn't make
sense), and similarly forbid infallible + returning void (as C++ doesn't
allow us to overload a function that differs only on its return type).
Differential Revision: https://phabricator.services.mozilla.com/D90044
This will allow resolving DOM promises with non-wrappercached XPIDL interfaces
in a more convenient manner, as the wrapped JS object will have more concrete
interface information without needing to invoke QueryInterface.
Differential Revision: https://phabricator.services.mozilla.com/D87002
When I originally wrote rust-xpcom support, it wasn't possible to implement
generic vtables in Rust. With updates and improvements to the language since
then, it is now possible to do, so this patch adds support for implementing
xpcom interfaces on generic structs.
All generic parameters to these structs are required to have a `'static`
lifetime bound, as it is not possible to safely represent xpcom interface
objects which contain internal non-'static references.
Differential Revision: https://phabricator.services.mozilla.com/D89950
This backs out all work from bug 1627075 as well as all of its
descendents. There were a few conflicts when backing this out but
overall it was pretty clean, so I would say it's a fairly mild
level of risk. Historically Nathan Froyd has reviewed these patches,
but he is no longer at Mozilla, and no one else is particularly
familiar with the code, so I am passing this off to RyanVM who has
at least been familiar with the history of the bug.
Differential Revision: https://phabricator.services.mozilla.com/D90096
In most situations, JSONWriter users already know string lengths (either directly, or through `nsCString` and friends), so we should keep this information through JSONWriter and not recompute it again.
This also allows using JSONWriter with sub-strings (e.g., from a bigger buffer), without having to create null-terminated strings.
Public JSONWriter functions have overloads that accept literal strings.
Differential Revision: https://phabricator.services.mozilla.com/D86192
Previously, this code used a &'static T in order to get the null pointer
optimization. Since the code was written, `NonNull` has been stabilized, and now
should be used instead.
Differential Revision: https://phabricator.services.mozilla.com/D89947
The name `AUTO_PROFILER_MARKER_TEXT` is more consistent with the equivalent non-`AUTO` macro, and similarly arguments have been re-ordered to be the same, i.e.: Name, category&options, text.
The different macros with different argument sets can now be collapsed into one macro, and the optional arguments (timing, inner window id, backtrace) can easily be added to the `MarkerOptions` where needed.
As a bonus, a specific start time can optionally be provided at construction time.
Differential Revision: https://phabricator.services.mozilla.com/D89588
Mostly mechanical change, with some extra work where non-literal names are provided.
Also, when this is the only profiler call in a file, `#include "GeckoProfiler.h"` can be changed to `#include "mozilla/ProfilerMarkers.h"`.
Differential Revision: https://phabricator.services.mozilla.com/D89415
Currently used mostly by Twitter and Facebook to allow them to specify which virtual quick navigation keys assistive technologies should not use when in those web applications, but instead pass them through to the browser. JAWS is currently the only known assistive technology making use of this feature.
This works in Chrome and the new Edge, but not in Firefox, because JAWS stopped using ISimpleDOM in Firefox, which no longer gave them access to this attribute.
This bug is to allow exposure of the non-standardized data-at-shortcutkeys attribute value via a same-named IAccessible2 and ATK Object Attribute.
Differential Revision: https://phabricator.services.mozilla.com/D86181
The MOZ_MUST_USE macro is defined as clang's and gcc's nonstandard __attribute__((warn_unused_result)). Now that we compile as C++17 by default (bug 1560664), we can replace MOZ_MUST_USE with C++17's standard [[nodiscard]] attribute.
The [[nodiscard]] attribute must precede a function declaration's declaration specifiers (like static, extern, inline, or virtual). The __attribute__((warn_unused_result)) attribute does not have this order restriction.
Differential Revision: https://phabricator.services.mozilla.com/D89092
This patch was generated by running:
```
perl -p -i \
-e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF8toUTF16\((.*)\);/\1CopyUTF8toUTF16(\3, \2);/;' \
-e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF16toUTF8\((.*)\);/\1CopyUTF16toUTF8(\3, \2);/;' \
$FILE
```
against every .cpp and .h in mozilla-central, and then fixing up the
inevitable errors that happen as a result of matching C++ expressions with
regexes. The errors fell into three categories:
1. Calling the convert functions with `std::string::c_str()`; these were
changed to simply pass the string instead, relying on implicit conversion
to `mozilla::Span`.
2. Calling the convert functions with raw pointers, which is not permitted
with the copy functions; these were changed to invoke `MakeStringSpan` first.
3. Other miscellaneous errors resulting from over-eager regexes and/or the
replacement not being type-aware. These changes were reverted.
Differential Revision: https://phabricator.services.mozilla.com/D88903
As long as we're following the STL guidelines on how to do iterators, we
should be annotating things with the bits that the STL iterator support
wants to see.
Differential Revision: https://phabricator.services.mozilla.com/D89042
We fixed what I think is the lone instance of writing into the (empty)
header in `SetLength` because it was causing TSan violations, so we should
be clear to make this `const`. This change is not terribly effective on its
own (cf. the `const_cast` required to make this work at all), but in the
next patch, we can rig up `sEmptyTArrayHeader` to be surrounded with "guard
pages" and make rogue accesses off the array header a little more protected.
Differential Revision: https://phabricator.services.mozilla.com/D88657
Now that we've concluded no immediate action is needed for slow
ShellExecuteByExplorer, `SHELLEXECUTEBYEXPLORER_DURATION_MS` is
no longer needed.
Differential Revision: https://phabricator.services.mozilla.com/D86143
This change updates the unix implementation of nsLocalFile
Set/GetLastModifiedTime methods to improve the precision of file modification
times from a 1 second resolution to a 1 millisecond resolution.
Differential Revision: https://phabricator.services.mozilla.com/D86238
This change updates the unix implementation of nsLocalFile
Set/GetLastModifiedTime methods to improve the precision of file modification
times from a 1 second resolution to a 1 millisecond resolution.
Differential Revision: https://phabricator.services.mozilla.com/D86238
This functionality already exists, so it is just a matter of threading
an extra bool around. This patch should not actually change the behavior
anywhere.
The goal of this is to consider using it for AWSY. Currently AWSY
asks every process to minimize memory usage at once, but with
this option the minimization will be batched along with the memory
reports, which should make it less likely to overwhelm the system
when there are a lot of content processes.
Differential Revision: https://phabricator.services.mozilla.com/D87475
To be honest, it's still a mystery why we observed a regression in
sessionrestore_no_auto_restore in bug 1658732. The regression won't reproduce
on profiled runs, and the bad recordings happen before the supposedly offending
code ever actually runs. It feels most likely that it is a more or less random
confluence of factors causing a regression; however, 33% is too large of a
number to ignore.
The changes in this patch do not seem to yield the same regression, and they
are arguably more correct anyway. Instead of simply turning off the cache after
startup is finished, we simply avoid blocking waiting for the write from inside
GetBuffer. This way, if the write is not getting in the way of GetBuffer, we
can still benefit from a cached version of whatever it is we're looking for.
Differential Revision: https://phabricator.services.mozilla.com/D87221
ARM has a common calling standard for all operating systems running on
ARM64, and Apple platforms almost follow it, except for a few rules which
aren't relative to xptcall, plus one significant exception: arguments
spilled to the stack only occupy the space they need to. So in the common
calling standard, a `uint16_t` would occupy eight bytes when it is passed on
the stack, whereas on Apple platforms, it only occupies two bytes.
Original patch by @froydnj.
Differential Revision: https://phabricator.services.mozilla.com/D87007
Through some sleight-of-hand, we can treat argument allocation in aarch64's
xptcinvoke exactly the same for integer and floating-point arguments. This
change isn't so important now, but it centralizes the allocation of stack
slots, which is important for making this code handle Apple's calling
conventions.
Depends on D87005
Differential Revision: https://phabricator.services.mozilla.com/D87006
These files will all compile, but things will break at runtime because the
convention for stack arguments is slightly different on Darwin. We'll fix
that in the next patch or two.
Depends on D87004
Differential Revision: https://phabricator.services.mozilla.com/D87005
We avoid going through Substring which imposes a limit on the string length of
INT32_MAX and failing a MOZ_RELEASE_ASSERT otherwise.
This adds a new `Base64EncodeAppend` function that takes 8-bit char input and
produces 16-bit char output, and appends to an existing string, which is what
we need here to avoid doing a large copy. Base64EncodeHelper is generalized
to accomodate for that.
So in addition to fixing the defect, this also optimizes performance and
memory usage.
Differential Revision: https://phabricator.services.mozilla.com/D87413