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

22177 Коммитов

Автор SHA1 Сообщение Дата
Paul Bone 2f5df3fc3c Bug 1779138 - Don't query resident unique memory on MacOS r=mccr8
This patch disables calculating resident unique memory for telemetry, but
retains it for about:memory.  Telemetry has other memory measurements including a different fast-path.

Differential Revision: https://phabricator.services.mozilla.com/D155455
2022-08-27 00:56:33 +00:00
Nika Layzell 4011409c5d Bug 1783282 - Use a custom attribute instead of derive for implementing xpcom interfaces in rust, r=xpcom-reviewers,necko-reviewers,dragana,barret
Differential Revision: https://phabricator.services.mozilla.com/D153801
2022-08-18 13:57:35 +00:00
Greg Tatum 905a369a06 Bug 1782981 - Only show the macOS context menu if it is supported; r=nordzilla
This code path gets executed by existing tests, and I don't believe
there is a way to execute this behavior using our CI, since it's a macOS
version check.

Differential Revision: https://phabricator.services.mozilla.com/D154172
2022-08-17 15:41:12 +00:00
Gerald Squelart 42904cee2c Bug 1784812 - Make all JSONWriteFunc-derived classes and their overriden methods final - r=canaltinova
All JSONWriteFuncs are effectively final, this patch enforces that, hopefully
helping the compiler to de-virtualize some calls.

Differential Revision: https://phabricator.services.mozilla.com/D154619
2022-08-17 07:07:54 +00:00
Gerald Squelart 4326b92ea7 Bug 1784812 - Use common JSONWriteFuncs when writing to a string - r=canaltinova,media-playback-reviewers,alwu
Most users of JSONWriter want to fill a string, so instead of having all these
similar implementations, we now have central reusable implementations:
- JSONStringWriteFunc contains a string and writes to it.
- JSONStringRefWriteFunc references a string and writes to it. This is most
  useful when the string already exists somewhere, or needs to be returned from
  a function (so we avoid another conversion when returning).

Differential Revision: https://phabricator.services.mozilla.com/D154618
2022-08-17 07:07:54 +00:00
Gerald Squelart 24798f281f Bug 1784812 - JSONWriter::WriteFunc() returns a reference - r=canaltinova
mWriter is never null (and lots of calls just dereference it without checking),
so we may as well enforce it:
- The constructor MOZ_RELEASE_ASSERTs that it's not null.
- The accessor WriteFunc() returns a reference instead of a scary raw pointer.

(Note that we can't make mWriter a NotNull<...>, because the next patch will
give the option to keep that owning pointer null.)

Differential Revision: https://phabricator.services.mozilla.com/D154616
2022-08-17 07:07:53 +00:00
Iulian Moraru 859487ba6b Backed out 4 changesets (bug 1784812) for causing build bustages on DDMediaLogs. CLOSED TREE
Backed out changeset c9998c927079 (bug 1784812)
Backed out changeset d2568bc2f8a6 (bug 1784812)
Backed out changeset 9f01bf89c583 (bug 1784812)
Backed out changeset d8506496d8f2 (bug 1784812)
2022-08-17 05:48:36 +03:00
Gerald Squelart d7c05cb55e Bug 1784812 - Make all JSONWriteFunc-derived classes and their overriden methods final - r=canaltinova
All JSONWriteFuncs are effectively final, this patch enforces that, hopefully
helping the compiler to de-virtualize some calls.

Depends on D154618

Differential Revision: https://phabricator.services.mozilla.com/D154619
2022-08-16 22:57:50 +00:00
Gerald Squelart 253bb5dc48 Bug 1784812 - Use common JSONWriteFuncs when writing to a string - r=canaltinova,media-playback-reviewers,alwu
Most users of JSONWriter want to fill a string, so instead of having all these
similar implementations, we now have central reusable implementations:
- JSONStringWriteFunc contains a string and writes to it.
- JSONStringRefWriteFunc references a string and writes to it. This is most
  useful when the string already exists somewhere, or needs to be returned from
  a function (so we avoid another conversion when returning).

Depends on D154617

Differential Revision: https://phabricator.services.mozilla.com/D154618
2022-08-16 22:57:49 +00:00
Gerald Squelart 68a8dee9cc Bug 1784812 - JSONWriter::WriteFunc() returns a reference - r=canaltinova
mWriter is never null (and lots of calls just dereference it without checking),
so we may as well enforce it:
- The constructor MOZ_RELEASE_ASSERTs that it's not null.
- The accessor WriteFunc() returns a reference instead of a scary raw pointer.

(Note that we can't make mWriter a NotNull<...>, because the next patch will
give the option to keep that owning pointer null.)

Differential Revision: https://phabricator.services.mozilla.com/D154616
2022-08-16 22:57:48 +00:00
Andi-Bogdan Postelnicu eeac3728d2 Bug 1519636 - Reformat recent changes to the Google coding style. r=glandium
Updated with clang-format version 14.0.5 (taskcluster-DydCt-ryTuKvBYw1HQOugw)
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D154661
2022-08-16 07:08:27 +00:00
Andrew Osmond e8f9ed23ec Bug 1783299 - Add support for threadsafe mirrored StaticPref strings. r=KrisWright
Prior to this patch, one would need to manually instantiate a copy of a
string from a preference on the main thread in order to access it in a
threadsafe manner on another thread.

This patch adds support for a `DataMutexString` threadsafe type for
mirror: always type StaticPrefs, and works similarly to the existing
atomic types.

Differential Revision: https://phabricator.services.mozilla.com/D153829
2022-08-16 01:00:21 +00:00
Emilio Cobos Álvarez ff538cab0e Bug 1784349 - Don't use -moz-bool-pref for flexbox -moz-box emulation. r=dholbert,perftest-reviewers,sparky
Use a bool pref media query which allows dynamic changes to get
reflected instantly.

Differential Revision: https://phabricator.services.mozilla.com/D154449
2022-08-11 23:22:52 +00:00
Nika Layzell 706cf2f2fa Bug 1782765 - Fix nullability of arrays of interfaces in Rust, r=xpcom-reviewers,necko-reviewers,mccr8,valentin
When generating code for arrays of interfaces from the rust-xpidl
compiler, the type was declared incorrectly as ThinVec<RefPtr<T>>
instead of ThinVec<Option<RefPtr<T>>> meaning that null values in the
array would be handled incorrectly.

This patch fixes this code generation mistake and updates crates using
the interface to handle null values correctly.

Differential Revision: https://phabricator.services.mozilla.com/D153485
2022-08-11 17:53:48 +00:00
Nika Layzell aef919f890 Bug 1170668 - Improve short read handling in nsConverterInputStream, r=hsivonen
This patch changes how nsConverterInputStream handles passing data
through to the underlying unicode converter in order to make it more
reliably handle propagating errors and deal with short reads from the
underlying input stream.

This was done by making the code continuously read within the Fill
method until at least one character has been decoded from the input
stream, so that we don't spuriously communicate an EOF to the caller due
to a short read not producing enough bytes for the decoder to produce a
UTF-16 character.

In addition, while making this change it became easier to signal to
the decoder about the final read from the input stream, meaning that
partial characters at the end of the stream will now generate a
replacement character, rather than being ignored.

Differential Revision: https://phabricator.services.mozilla.com/D152682
2022-08-11 17:37:20 +00:00
Norisz Fay fd1720100c Backed out 3 changesets (bug 1658072) as they are related to previously backed out changeset CLOSED TREE
Backed out changeset 199d3ecfe13c (bug 1658072)
Backed out changeset a942be3d053d (bug 1658072)
Backed out changeset e0e98ee85f98 (bug 1658072)
2022-08-11 02:01:04 +03:00
Jed Davis 1dc9df1d11 Bug 1658072 - Cleanup: remove the signal handling glue in the IPC event loop. r=nika
Now that we're no longer using libevent's signal handling, we don't need
an OO wrapper for it.

Differential Revision: https://phabricator.services.mozilla.com/D141311
2022-08-10 21:25:49 +00:00
Norisz Fay 948922a968 Backed out changeset 2c6bb36b0667 (bug 1170668) for causing build bustages on TestShortRead.cpp CLOSED TREE 2022-08-11 00:01:03 +03:00
Nika Layzell 1972b3b710 Bug 1170668 - Improve short read handling in nsConverterInputStream, r=hsivonen
This patch changes how nsConverterInputStream handles passing data
through to the underlying unicode converter in order to make it more
reliably handle propagating errors and deal with short reads from the
underlying input stream.

This was done by making the code continuously read within the Fill
method until at least one character has been decoded from the input
stream, so that we don't spuriously communicate an EOF to the caller due
to a short read not producing enough bytes for the decoder to produce a
UTF-16 character.

In addition, while making this change it became easier to signal to
the decoder about the final read from the input stream, meaning that
partial characters at the end of the stream will now generate a
replacement character, rather than being ignored.

Differential Revision: https://phabricator.services.mozilla.com/D152682
2022-08-10 19:44:41 +00:00
Nika Layzell 11783bdb37 Bug 1745116 - Make TestThreadMetrics check against how much time was actually spent, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D153809
2022-08-08 13:42:29 +00:00
Tom Schuster 34c8b152df Bug 1779184 - Start rewrite of Sanitizer API for elements. r=emilio
There are still a lot of TODOs, but I want to make some incremental progress on this.

Differential Revision: https://phabricator.services.mozilla.com/D152271
2022-08-08 09:23:55 +00:00
Nika Layzell 512a0022d1 Bug 1782181 - Part 2: Notify nsMultiplexInputStream callbacks if AsyncWait fails, r=asuth
When `nsMultiplexInputStream` calls `AsyncWait` from within
`OnInputStreamReady`, it is possible for those calls to fail. In that case, we
will fail to notify AsyncWait listeners, which could lead to leaks or stream
hangs. This patch changes the error handling in this situation to instead fire
a pending stream callback after an error when re-dispatching `AsyncWait`.

Depends on D153628

Differential Revision: https://phabricator.services.mozilla.com/D153629
2022-08-03 19:36:29 +00:00
Nika Layzell b7b9c6816e Bug 1782181 - Part 1: Support canceling AsyncWait in nsMultiplexInputStream, r=asuth
Previously nsMultiplexInputStream would not call `AsyncWait` again when the
callback was cleared, meaning that the underlying wait wouldn't actually be
cancelled. This patch changes the behaviour to more consistently forward the
cancelling call to the underlying stream.

There are still some cases where the call will not be cancelled if a read or
other event caused the stream cursor to advance before canceling, however those
should generally be uncommon.

Differential Revision: https://phabricator.services.mozilla.com/D153628
2022-08-03 19:36:29 +00:00
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
Nika Layzell d706a983ec Bug 1780614 - Track potential crossoriginisolated status on BCG, r=smaug,kmag
This patch changes how BrowsingContextGroups track CrossOriginIsolated
status such that it should be more consistently tracked and easier to
assert in the places which depend on it. In the new state of the world,
a flag is stored within the BCG's ID which tracks whether it was
created for cross-origin isolated documents, and that is also checked
when making decisions about how to isolate initial about:blank
documents, and whether to allow certain changes to
CrossOriginOpenerPolicy.

This flag is stashed within the ID, as it needs to be preserved if the
BCG is destroyed and then re-created from the ID (which may be e.g.
round-tripped through JS code). I also considered making the ID be a
string instead, to make it easier to include extra information like
this, and more clear where the information is stored, however :kmag
generally preferred using a bit within the integer ID.

These new assertions should now be less likely to spuriously fail due to
a DocShell disappearing or similar as well, which should help fix the
original issue.

Differential Revision: https://phabricator.services.mozilla.com/D152695
2022-08-03 15:58:27 +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
Bob Owen d6333678d8 Bug 1682520 p1: Move GeckoProcessType and implementation of get and set into mozglue. r=glandium
This means we can set and use the process type earlier in process startup.

Differential Revision: https://phabricator.services.mozilla.com/D152198
2022-08-02 10:41:14 +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
Nika Layzell 5fa7dcc2f8 Bug 1772006 - Part 8: Allow building xpcom/string without unified builds, r=xpcom-reviewers,barret
The last remaining things requiring unified builds in this directory are the
explicit specializations. As each class' methods are now confined to a single
file, these can now be moved to the appropriate .cpp files.

Differential Revision: https://phabricator.services.mozilla.com/D148303
2022-07-30 00:12:49 +00:00
Nika Layzell 6255b11115 Bug 1772006 - Part 7: Remove unnecessary files from the string implementation, r=xpcom-reviewers,barret
These files exist only due to the history of how strings were previously
declared using macros, and aren't necessary anymore. The header files were not
removed, as they may be depended on from outside of the module. Cleaning up the
header situation is something which should probably happen in a follow-up.

Differential Revision: https://phabricator.services.mozilla.com/D148302
2022-07-30 00:12:49 +00:00
Nika Layzell effe5537b9 Bug 1772006 - Part 6: Simplify and move the find+replace methods from ns[T]StringObsolete, r=xpcom-reviewers,barret
The remaining methods in ns[T]StringObsolete are all find+replace methods for
nsTSubstring. These were migrated in a similar way to the find methods, and
partially updated to avoid using methods from nsStringObsolete.cpp.

This change removes the ns[T]StringObsolete.cpp files completely, as they are
no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D148301
2022-07-30 00:12:49 +00:00
Nika Layzell c15823d075 Bug 1772006 - Part 5: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret
The biggest set of APIs from ns[T]StringObsolete which are still heavily used
are the string searching APIs. It appears the intention was for these to be
replaced by the `FindInReadable` APIs, however that doesn't appear to have
happened.

In addition, the APIs have some quirks around their handling of mixed character
widths. These APIs generally supported both narrow strings and the native
string type, probably because char16_t string literals weren't available until
c++11. Finally they also used easy-to-confuse unlabeled boolean and integer
optional arguments to control behaviour.

These patches do the following major changes to the searching APIs:

1. The ASCII case-insensitive search method was split out as
   LowerCaseFindASCII, rather than using a boolean. This should be less
   error-prone and more explicit, and allows the method to continue to use
   narrow string literals for all string types (as only ASCII is supported).
2. The other [R]Find methods were restricted to only support arguments with
   matching character types. I considered adding a FindASCII method which would
   use narrow string literals for both wide and narrow strings but it would've
   been the same amount of work as changing all of the literals to unicode
   literals.
   This ends up being the bulk of the changes in the patch.
3. All find methods were re-implemented using std::basic_string_view's find
   algorithm or stl algorithms to reduce code complexity, and avoid the need to
   carry around the logic from nsStringObsolete.cpp.
4. The implementations were moved to nsTStringRepr.cpp.
5. An overload of Find was added to try to catch callers which previously
   called `Find(..., false)` or `Find(..., true)` to set case-sensitivity, due
   to booleans normally implicitly coercing to `index_type`. This should
   probably be removed at some point, but may be useful during the transition.

Differential Revision: https://phabricator.services.mozilla.com/D148300
2022-07-30 00:12:48 +00:00
Nika Layzell 997047e2a4 Bug 1772006 - Part 4: Simplify and move the string comparison APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,dragana,barret
This patch moves EqualsIgnoreCase to ns[T]StringObsolete, and removes
the aCount argument, instead migrating callers to use `StringBeginsWith`
with a case-insensitive comparator.

In addition, nsTStringRepr::Compare was removed and replaced with either
calls to methods like `StringBeginsWith` or the global `Compare` method.

These changes required some modifications at call-sites but should make
the behaviour less surprising and more consistent.

Differential Revision: https://phabricator.services.mozilla.com/D148299
2022-07-30 00:12:48 +00:00
Nika Layzell 939c91e1d9 Bug 1772006 - Part 3: Move basic string APIs to more appropriate .cpp files, r=xpcom-reviewers,barret
Due to the history of how nsString was implemented, many APIs ended up being
implemented in inappropriate files. This change moves simple definitions which
won't require any changes for each type to happen within that type's .cpp file.

This is necessary to eventually enable the directory to be built without
unified builds.

Differential Revision: https://phabricator.services.mozilla.com/D148298
2022-07-30 00:12:47 +00:00
Nika Layzell b41825fb93 Bug 1772006 - Part 2: Support converting nsTStringRepr<T> to std::basic_string_view<T>, r=xpcom-reviewers,barret
This type was introduced in c++17, and can be used as a convenient standard
medium for passing around borrowed substring references. It can be implicitly
converted to from string literals and `const char_type*`, meaning that after
this change it can be used as a convenient catch-all type to replace seperate
overloads for `const self_type&`, `const char_type*` and `const
char_type(&)[N]`.

std::basic_string_view also provides standard implementations of some
algorithms which will be convenient for code cleanup in later parts of this
bug.

Differential Revision: https://phabricator.services.mozilla.com/D148297
2022-07-30 00:12:47 +00:00
Nika Layzell f84e572177 Bug 1772006 - Part 1: Split nsSubstring.cpp into relevant files, r=xpcom-reviewers,barret
This file only exists as a wrapper around nsTSubstring.cpp, with some methods
left in it due to how the string types were defined before they were turned
into templates.

Differential Revision: https://phabricator.services.mozilla.com/D148296
2022-07-30 00:12:46 +00:00
Cristian Tuns 85e845a6dc Backed out 2 changesets (bug 1682520) for causing build bustages on ProcessType.h CLOSED TREE
Backed out changeset 679e19334225 (bug 1682520)
Backed out changeset dad72c7e0d7b (bug 1682520)
2022-07-29 17:04:49 -04:00
Bob Owen cf59d0973b Bug 1682520 p1: Move GeckoProcessType and implementation of get and set into separate files. r=glandium
This means we can include these files in other binaries when we need earlier
access to the process type and use consistent code.

Differential Revision: https://phabricator.services.mozilla.com/D152198
2022-07-29 18:10:53 +00:00
Nika Layzell f71f45508c Bug 1780054 - Part 2: Double-check notified stream in nsMultiplexInputStream, r=asuth
Previously, we could end up in situations where nsMultiplexInputStream
would receive a callback for a previously notified stream after it had
already advanced to the next stream due to the async nature of
notifications. This could cause us to skip a stream accidentally. This
changes the logic to re-call AsyncWait in that situation on the correct
stream rather than skipping streams.

Differential Revision: https://phabricator.services.mozilla.com/D152930
2022-07-28 15:01:49 +00:00
Nika Layzell c1e984d0c6 Bug 1779326 - Handle a few more `native` types in rust-xpidl, r=xpcom-reviewers,kmag
This makes the logic for the rust type line up a bit more with the C++
logic for existing types, and adds support for 'char' and 'char16_t'
native types (for 'charPtr').

This specifically enables `nsIInputStream::Read` to be used from Rust.

Differential Revision: https://phabricator.services.mozilla.com/D152715
2022-07-27 14:09:52 +00:00
Butkovits Atila 99f074b50f Backed out changeset d4dae48f386a (bug 1779326) for causing build bustages. CLOSED TREE 2022-07-27 02:28:37 +03:00
Nika Layzell 155b049ad5 Bug 1779326 - Handle a few more `native` types in rust-xpidl, r=xpcom-reviewers,kmag
This makes the logic for the rust type line up a bit more with the C++
logic for existing types, and adds support for 'char' and 'char16_t'
native types (for 'charPtr').

This specifically enables `nsIInputStream::Read` to be used from Rust.

Differential Revision: https://phabricator.services.mozilla.com/D152715
2022-07-26 23:12:58 +00:00
Emilio Cobos Álvarez 9e93f45bec Bug 1780788 - Prevent logStringMessage(null) from crashing.
MANUAL PUSH: Fixes some orange in a CLOSED TREE
2022-07-25 23:23:45 +02:00
Emilio Cobos Álvarez 42b7f1a58c Bug 1780788 - Use abstract strings as in-arguments for ipdl. r=nika,necko-reviewers,media-playback-reviewers,alwu,dragana
This prevents copies and avoids the hack we have to avoid this, which
right now is using nsDependent{C,}String.

Non-virtual actors can still use `nsString` if they need to on the
receiving end.

Differential Revision: https://phabricator.services.mozilla.com/D152519
2022-07-25 20:19:48 +00:00
Emilio Cobos Álvarez 92c9ff22dc Bug 1780385 - Remove canvas hit region api. r=jrmuizel
Add a pref for MouseEvent.region since that wasn't un-exposed. No other
browser supports it so we can probably safely remove it, but just in
case.

Differential Revision: https://phabricator.services.mozilla.com/D152274
2022-07-20 16:52:47 +00:00
Paul Adenot 8c285223e3 Bug 1657197 - Support enabling MOZ_LOG profilermarkers mirroring at runtime. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D152166
2022-07-20 13:25:33 +00:00
Tim Huang 86d982dc94 Bug 1773695 - Part 2: Add flags for the email tracking protections. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D151049
2022-07-18 21:48:15 +00:00
criss b77dc7a479 Backed out 6 changesets (bug 1773691, bug 1773695) for causing Bp-hybrid bustages on UrlClassifierFeatureEmailTrackingProtection
Backed out changeset f402f1bd4caa (bug 1773695)
Backed out changeset 001c38822c53 (bug 1773695)
Backed out changeset 8ef4d3597d92 (bug 1773695)
Backed out changeset f4770b2fe53d (bug 1773695)
Backed out changeset fb625ae08f73 (bug 1773695)
Backed out changeset 6c23adf9184f (bug 1773691)
2022-07-14 23:41:50 +03:00