Commit Graph
430 Commits
Author SHA1 Message Date
Daniel Holbert a88c0883b9 Bug 2037761: Change RegisterStrongMemoryReporter to take already_AddRefed instead of a raw pointer, and update callsites. r=dom-core,smaug
The callsites now mostly use MakeAndAddRef (which just stuffs a new object into
a RefPtr and calls `forget()` to yield an already_AddRefed).

In cases where the callsite constructs the object earlier and retains a strong
reference, they'll now use do_AddRef to explicitly generate a strong reference
(as an already_AddRefed) to pass into RegisterStrongMemoryReporter.

Differential Revision: https://phabricator.services.mozilla.com/D299042
2026-05-07 19:37:43 +00:00
Sandor Molnar 9987bc0bd7 Revert "Bug 2037761: Change RegisterStrongAsyncMemoryReporter to take already_AddRefed instead of a raw pointer, and update callsites. r=dom-core,smaug" for causing build bustages
This reverts commit 1ab110ab2f.

Revert "Bug 2037761: Change RegisterStrongMemoryReporter to take already_AddRefed instead of a raw pointer, and update callsites. r=dom-core,smaug"

This reverts commit 2e187ddbc8.
2026-05-07 08:23:58 +00:00
Daniel Holbert 2e187ddbc8 Bug 2037761: Change RegisterStrongMemoryReporter to take already_AddRefed instead of a raw pointer, and update callsites. r=dom-core,smaug
The callsites now mostly use MakeAndAddRef (which just stuffs a new object into
a RefPtr and calls `forget()` to yield an already_AddRefed).

In cases where the callsite constructs the object earlier and retains a strong
reference, they'll now use do_AddRef to explicitly generate a strong reference
(as an already_AddRefed) to pass into RegisterStrongMemoryReporter.

Differential Revision: https://phabricator.services.mozilla.com/D299042
2026-05-07 07:49:42 +00:00
serge-sans-paille 60cafad33c Bug 2025926 - Remove unused <cmath> inclusion and make sure we don't regress on those r=emilio,media-playback-reviewers,webrtc-reviewers,win-reviewers,firefox-style-system-reviewers,dshin,mjf,gstoll,padenot
Leveraging the `mach lint -lincludes` infrastructure

Differential Revision: https://phabricator.services.mozilla.com/D289623
2026-03-26 12:30:41 +00:00
serge-sans-paille f81328e365 Bug 2023519 - Make our codebase modernize-use-equals-default + modernize-use-equals-delete -safe wrt. clang-tidy r=sylvestre,necko-reviewers,media-playback-reviewers,profiler-reviewers,dom-storage-reviewers,layout-reviewers,dom-worker-reviewers,valentin,jesup,padenot,edenchuang,emilio
The changeset has been generated automatically through:

    ./mach static-analysis check --output ./clang-tidy-bugprone.json --format json --fix

followed by manual adjustment when needed or when the auto-fixer bailed out.

This paves the way for Bug 2023527

Differential Revision: https://phabricator.services.mozilla.com/D287941
2026-03-22 08:35:47 +00:00
Alexandru Marc 04e5f74151 Revert "Bug 2023519 - Make our codebase modernize-use-equals-default + modernize-use-equals-delete -safe wrt. clang-tidy r=sylvestre,necko-reviewers,media-playback-reviewers,profiler-reviewers,dom-storage-reviewers,layout-reviewers,dom-worker-reviewers,valentin,jesup,padenot,edenchuang,emilio"
This reverts commit a64dec2665.
2026-03-19 17:29:58 +00:00
serge-sans-paille a64dec2665 Bug 2023519 - Make our codebase modernize-use-equals-default + modernize-use-equals-delete -safe wrt. clang-tidy r=sylvestre,necko-reviewers,media-playback-reviewers,profiler-reviewers,dom-storage-reviewers,layout-reviewers,dom-worker-reviewers,valentin,jesup,padenot,edenchuang,emilio
The changeset has been generated automatically through:

    ./mach static-analysis check --output ./clang-tidy-bugprone.json --format json --fix

followed by manual adjustment when needed or when the auto-fixer bailed out.

This paves the way for Bug 2023527

Differential Revision: https://phabricator.services.mozilla.com/D287941
2026-03-18 17:25:01 +00:00
Sylvestre Ledru 9eb1a31a98 Bug 2023419 - Remove Emacs/Vim modelines from dom/ r=emilio,media-playback-reviewers,webidl,padenot
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287843
2026-03-16 21:02:32 +00:00
Nika Layzell c7233601c6 Bug 2013389 - Part 8: Avoid the unnecessary ClonedMessageData intermediate, r=asuth,mccr8,extension-reviewers,dom-worker-reviewers,robwu
This patch is to remove the ClonedMessageData type which is currently
frequently used for sending a StructuredCloneData over IPC manually. Instead,
under the new approach, the StructuredCloneData is transferred directly using
its serializer.

This allows for simplification of various types across the codebase which
previously needed complex handling for this manual {de-}serialization step,
especially around keeping the borrowed-from buffers alive in some cases.

As part of this, the type has also been changed to be a threadsafe refcounted
object. This is in part possible due to earlier parts, which have made it safe
to Read() from the same StructuredCloneData object concurrently from multiple
threads (so long as it does not support transferrables).

The underlying data storage within StructuredCloneData was previously already
reference counted (due to SharedJSAllocatedData).

In addition to StructuredCloneData, other data structures (e.g.
nsStructuredCloneContainer and SharedMessageBody) have also been updated to be
serialized directly, avoiding now-unnecessary intermediate objects.

Differential Revision: https://phabricator.services.mozilla.com/D281115
2026-02-12 02:43:41 +00:00
Nika Layzell 2bbd1ac126 Bug 2013389 - Part 7: Only deserialize once in nsFrameMessageManager, r=asuth
Previously, we would copy the data and deserialize it once for each listener.
This interacts poorly with the actual data which can be sent over the message
manager, as it is possible to include transferables (which must only be
deserialized once).

This new approach ensures that the data structure is always deserialized once
in the shared scope, and then passed to all of the listeners, avoiding issues
with deserializing the same transferable multiple times.

Differential Revision: https://phabricator.services.mozilla.com/D281553
2026-02-12 02:43:38 +00:00
Nika Layzell 6af132e51a Bug 2013389 - Part 6: Remove weak listener support from MessageManager, r=smaug
This was never used outside of tests, and adds a substantial amount of
complexity to the nsFrameMessageManager's ReceiveMessage implementation, which
is going to be further rewritten in the next part.

Differential Revision: https://phabricator.services.mozilla.com/D281552
2026-02-12 02:43:35 +00:00
Nika Layzell f104036f02 Bug 2013389 - Part 5: Broadcasting MessageManagers cannot support transferrables, r=asuth
This already would not have worked (as you cannot transfer a transferrable to
multiple destinations at the same time). This makes it explicit, preventing
future code from being added and breaking things, and ensuring that codepaths
in StructuredCloneHolder which mutate the object during Read will not.

We already disable transferrables in this way for BroadcastChannel, but this
codepath was likely missed due to only being used by internal system JS.

Differential Revision: https://phabricator.services.mozilla.com/D281114
2026-02-12 02:43:33 +00:00
Nika Layzell 0c69e1ec9e Bug 2013389 - Part 4: Avoid depending on mErrorMessage when deserializing StructuredCloneHolder, r=asuth,dom-worker-reviewers
This is the last member of StructuredCloneHolder which is mutated when reading
a StructuredCloneHolder which does not support transfers.

This does change behaviour, as the Read functions no longer clobber every
exception thrown by the StructuredClone implementation with a DataCloneError
exception, instead stealing the exceptions as they are thrown. The behaviour of
the Write function has been changed less substantially, as it already avoided
clobbering existing exceptions.

This change in behaviour is not a complete shift. Our Structured Clone custom
callbacks have historically not reliably thrown exceptions on failure, so
uncatchable exceptions are replaced with generic exceptions before being
returned to the JS engine to avoid throwing uncatchable exceptions in error
cases where we did not previously.

It's worth noting that this change assumes that the JS implementation of
structured clone reliably throws exceptions itself. In general SpiderMonkey
code is better about this (due to better-established patterns), than Gecko code
using SpiderMonkey calling conventions.

The new implementations of Read/Write use StealExceptionFromJSContext over
NoteJSContextException, as SuppressExceptions/IgnoreErrors/IgnoredErrorResult
are frequently used with StructuredCloneHolder, and JSContext exceptions are
not suppressed when SuppressExceptions is called.

Differential Revision: https://phabricator.services.mozilla.com/D281113
2026-02-12 02:43:30 +00:00
Cristina Horotan 3e788840d2 Revert "Bug 2013389 - Part 12: Restore eager serialization of InputStream, r=asuth" for causing Hazard failure on StructuredCloneHolder.cpp
This reverts commit 72c32e25bf.

Revert "Bug 2013389 - Part 11: Make attachment arrays more consistent in StructuredCloneHolder, r=asuth"

This reverts commit c0912428c7.

Revert "Bug 2013389 - Part 10: Fix version tracking in nsStructuredCloneContainer, r=asuth,extension-reviewers,spidermonkey-reviewers,sfink,robwu"

This reverts commit f2e9691831.

Revert "Bug 2013389 - Part 9: Remove the now-unused ReadFromBuffer method, r=asuth"

This reverts commit 6eb034458e.

Revert "Bug 2013389 - Part 8: Avoid the unnecessary ClonedMessageData intermediate, r=asuth,mccr8,extension-reviewers,dom-worker-reviewers,robwu"

This reverts commit 4dd6f1d6ea.

Revert "Bug 2013389 - Part 7: Only deserialize once in nsFrameMessageManager, r=asuth"

This reverts commit 65d16af619.

Revert "Bug 2013389 - Part 6: Remove weak listener support from MessageManager, r=smaug"

This reverts commit 66f4b308a0.

Revert "Bug 2013389 - Part 5: Broadcasting MessageManagers cannot support transferrables, r=asuth"

This reverts commit e95e1a5a6c.

Revert "Bug 2013389 - Part 4: Avoid depending on mErrorMessage when deserializing StructuredCloneHolder, r=asuth,dom-worker-reviewers"

This reverts commit ae78c69357.

Revert "Bug 2013389 - Part 3: Remove aGlobal argument from StructuredCloneHolder::Read, r=asuth,dom-worker-reviewers"

This reverts commit 066bd37bfd.

Revert "Bug 2013389 - Part 2: Stop tracking mGlobal within StructuredCloneHolder::Read, r=asuth"

This reverts commit 6b4f3a43c0.

Revert "Bug 2013389 - Part 1: Add an Adopt API to StructuredCloneHolder, r=asuth"

This reverts commit 8624db71c2.
2026-02-10 20:11:41 +00:00
Nika Layzell 4dd6f1d6ea Bug 2013389 - Part 8: Avoid the unnecessary ClonedMessageData intermediate, r=asuth,mccr8,extension-reviewers,dom-worker-reviewers,robwu
This patch is to remove the ClonedMessageData type which is currently
frequently used for sending a StructuredCloneData over IPC manually. Instead,
under the new approach, the StructuredCloneData is transferred directly using
its serializer.

This allows for simplification of various types across the codebase which
previously needed complex handling for this manual {de-}serialization step,
especially around keeping the borrowed-from buffers alive in some cases.

As part of this, the type has also been changed to be a threadsafe refcounted
object. This is in part possible due to earlier parts, which have made it safe
to Read() from the same StructuredCloneData object concurrently from multiple
threads (so long as it does not support transferrables).

The underlying data storage within StructuredCloneData was previously already
reference counted (due to SharedJSAllocatedData).

In addition to StructuredCloneData, other data structures (e.g.
nsStructuredCloneContainer and SharedMessageBody) have also been updated to be
serialized directly, avoiding now-unnecessary intermediate objects.

Differential Revision: https://phabricator.services.mozilla.com/D281115
2026-02-09 21:23:37 +00:00
Nika Layzell 65d16af619 Bug 2013389 - Part 7: Only deserialize once in nsFrameMessageManager, r=asuth
Previously, we would copy the data and deserialize it once for each listener.
This interacts poorly with the actual data which can be sent over the message
manager, as it is possible to include transferables (which must only be
deserialized once).

This new approach ensures that the data structure is always deserialized once
in the shared scope, and then passed to all of the listeners, avoiding issues
with deserializing the same transferable multiple times.

Differential Revision: https://phabricator.services.mozilla.com/D281553
2026-02-09 21:23:34 +00:00
Nika Layzell 66f4b308a0 Bug 2013389 - Part 6: Remove weak listener support from MessageManager, r=smaug
This was never used outside of tests, and adds a substantial amount of
complexity to the nsFrameMessageManager's ReceiveMessage implementation, which
is going to be further rewritten in the next part.

Differential Revision: https://phabricator.services.mozilla.com/D281552
2026-02-09 21:23:31 +00:00
Nika Layzell e95e1a5a6c Bug 2013389 - Part 5: Broadcasting MessageManagers cannot support transferrables, r=asuth
This already would not have worked (as you cannot transfer a transferrable to
multiple destinations at the same time). This makes it explicit, preventing
future code from being added and breaking things, and ensuring that codepaths
in StructuredCloneHolder which mutate the object during Read will not.

We already disable transferrables in this way for BroadcastChannel, but this
codepath was likely missed due to only being used by internal system JS.

Differential Revision: https://phabricator.services.mozilla.com/D281114
2026-02-09 21:23:28 +00:00
Nika Layzell ae78c69357 Bug 2013389 - Part 4: Avoid depending on mErrorMessage when deserializing StructuredCloneHolder, r=asuth,dom-worker-reviewers
This is the last member of StructuredCloneHolder which is mutated when reading
a StructuredCloneHolder which does not support transfers.

This does change behaviour, as the Read functions no longer clobber every
exception thrown by the StructuredClone implementation with a DataCloneError
exception, instead stealing the exceptions as they are thrown. The behaviour of
the Write function has been changed less substantially, as it already avoided
clobbering existing exceptions.

This change in behaviour is not a complete shift. Our Structured Clone custom
callbacks have historically not reliably thrown exceptions on failure, so
uncatchable exceptions are replaced with generic exceptions before being
returned to the JS engine to avoid throwing uncatchable exceptions in error
cases where we did not previously.

It's worth noting that this change assumes that the JS implementation of
structured clone reliably throws exceptions itself. In general SpiderMonkey
code is better about this (due to better-established patterns), than Gecko code
using SpiderMonkey calling conventions.

The new implementations of Read/Write use StealExceptionFromJSContext over
NoteJSContextException, as SuppressExceptions/IgnoreErrors/IgnoredErrorResult
are frequently used with StructuredCloneHolder, and JSContext exceptions are
not suppressed when SuppressExceptions is called.

Differential Revision: https://phabricator.services.mozilla.com/D281113
2026-02-09 21:23:25 +00:00
Damien Carver d4d96c1939 Bug 1979356 - Remove the "searchable" flag from marker schema fields r=necko-reviewers,profiler-reviewers,toolkit-telemetry-reviewers,canaltinova,jesup
Differential Revision: https://phabricator.services.mozilla.com/D281769
2026-02-06 14:49:32 +00:00
Cristina Horotan c262421c6d Revert "Bug 2013389 - Part 11: Make attachment arrays more consistent in StructuredCloneHolder, r=asuth" for causing build bustages at MessageManagerFuzzer.cpp
This reverts commit 5c5cf7465b.

Revert "Bug 2013389 - Part 10: Fix version tracking in nsStructuredCloneContainer, r=asuth,extension-reviewers,spidermonkey-reviewers,sfink,robwu"

This reverts commit c87a327d86.

Revert "Bug 2013389 - Part 9: Remove the now-unused ReadFromBuffer method, r=asuth"

This reverts commit 5adf49e5d8.

Revert "Bug 2013389 - Part 8: Avoid the unnecessary ClonedMessageData intermediate, r=asuth,mccr8,extension-reviewers,dom-worker-reviewers,robwu"

This reverts commit f6d12563fe.

Revert "Bug 2013389 - Part 7: Only deserialize once in nsFrameMessageManager, r=asuth"

This reverts commit 44c1325d76.

Revert "Bug 2013389 - Part 6: Remove weak listener support from MessageManager, r=smaug"

This reverts commit 1d1b495c91.

Revert "Bug 2013389 - Part 5: Broadcasting MessageManagers cannot support transferrables, r=asuth"

This reverts commit e2eb75ff8f.

Revert "Bug 2013389 - Part 4: Avoid depending on mErrorMessage when deserializing StructuredCloneHolder, r=asuth,dom-worker-reviewers"

This reverts commit d9a234ad7b.

Revert "Bug 2013389 - Part 3: Remove aGlobal argument from StructuredCloneHolder::Read, r=asuth,dom-worker-reviewers"

This reverts commit 48279cea50.

Revert "Bug 2013389 - Part 2: Stop tracking mGlobal within StructuredCloneHolder::Read, r=asuth"

This reverts commit 27162e5046.

Revert "Bug 2013389 - Part 1: Add an Adopt API to StructuredCloneHolder, r=asuth"

This reverts commit e3a9f32716.
2026-02-05 22:11:47 +00:00
Nika Layzell f6d12563fe Bug 2013389 - Part 8: Avoid the unnecessary ClonedMessageData intermediate, r=asuth,mccr8,extension-reviewers,dom-worker-reviewers,robwu
This patch is to remove the ClonedMessageData type which is currently
frequently used for sending a StructuredCloneData over IPC manually. Instead,
under the new approach, the StructuredCloneData is transferred directly using
its serializer.

This allows for simplification of various types across the codebase which
previously needed complex handling for this manual {de-}serialization step,
especially around keeping the borrowed-from buffers alive in some cases.

As part of this, the type has also been changed to be a threadsafe refcounted
object. This is in part possible due to earlier parts, which have made it safe
to Read() from the same StructuredCloneData object concurrently from multiple
threads (so long as it does not support transferrables).

The underlying data storage within StructuredCloneData was previously already
reference counted (due to SharedJSAllocatedData).

In addition to StructuredCloneData, other data structures (e.g.
nsStructuredCloneContainer and SharedMessageBody) have also been updated to be
serialized directly, avoiding now-unnecessary intermediate objects.

Differential Revision: https://phabricator.services.mozilla.com/D281115
2026-02-05 21:25:52 +00:00
Nika Layzell 44c1325d76 Bug 2013389 - Part 7: Only deserialize once in nsFrameMessageManager, r=asuth
Previously, we would copy the data and deserialize it once for each listener.
This interacts poorly with the actual data which can be sent over the message
manager, as it is possible to include transferables (which must only be
deserialized once).

This new approach ensures that the data structure is always deserialized once
in the shared scope, and then passed to all of the listeners, avoiding issues
with deserializing the same transferable multiple times.

Differential Revision: https://phabricator.services.mozilla.com/D281553
2026-02-05 21:25:49 +00:00
Nika Layzell 1d1b495c91 Bug 2013389 - Part 6: Remove weak listener support from MessageManager, r=smaug
This was never used outside of tests, and adds a substantial amount of
complexity to the nsFrameMessageManager's ReceiveMessage implementation, which
is going to be further rewritten in the next part.

Differential Revision: https://phabricator.services.mozilla.com/D281552
2026-02-05 21:25:45 +00:00
Nika Layzell e2eb75ff8f Bug 2013389 - Part 5: Broadcasting MessageManagers cannot support transferrables, r=asuth
This already would not have worked (as you cannot transfer a transferrable to
multiple destinations at the same time). This makes it explicit, preventing
future code from being added and breaking things, and ensuring that codepaths
in StructuredCloneHolder which mutate the object during Read will not.

We already disable transferrables in this way for BroadcastChannel, but this
codepath was likely missed due to only being used by internal system JS.

Differential Revision: https://phabricator.services.mozilla.com/D281114
2026-02-05 21:25:42 +00:00
Nika Layzell d9a234ad7b Bug 2013389 - Part 4: Avoid depending on mErrorMessage when deserializing StructuredCloneHolder, r=asuth,dom-worker-reviewers
This is the last member of StructuredCloneHolder which is mutated when reading
a StructuredCloneHolder which does not support transfers.

This does change behaviour, as the Read functions no longer clobber every
exception thrown by the StructuredClone implementation with a DataCloneError
exception, instead stealing the exceptions as they are thrown. The behaviour of
the Write function has been changed less substantially, as it already avoided
clobbering existing exceptions.

This change in behaviour is not a complete shift. Our Structured Clone custom
callbacks have historically not reliably thrown exceptions on failure, so
uncatchable exceptions are replaced with generic exceptions before being
returned to the JS engine to avoid throwing uncatchable exceptions in error
cases where we did not previously.

It's worth noting that this change assumes that the JS implementation of
structured clone reliably throws exceptions itself. In general SpiderMonkey
code is better about this (due to better-established patterns), than Gecko code
using SpiderMonkey calling conventions.

The new implementations of Read/Write use StealExceptionFromJSContext over
NoteJSContextException, as SuppressExceptions/IgnoreErrors/IgnoredErrorResult
are frequently used with StructuredCloneHolder, and JSContext exceptions are
not suppressed when SuppressExceptions is called.

Differential Revision: https://phabricator.services.mozilla.com/D281113
2026-02-05 21:25:39 +00:00
Mike Conley 0e7692507c Bug 2012009 - Part 1: Don't retrieve scripts from non omni.ja JAR files from the ScriptPreloader or StartupCache. r=tcampbell
System add-ons can be installed in the profile directory as .xpi JAR files that
are updated independently of the application. Prior to this patch, when these JARs
are updated independently from the rest of the application, the ScriptPreloader
and StartupCache can serve stale bytecode compiled from the previous version of
the JAR, causing the old code to execute even though the JAR has been replaced.

This fix here adds a helper to checking if a script's JAR file is in one of
the omni.ja files before using cached bytecode.

Scripts from the omni.ja files continue to benefit from bytecode caching as
before.

Differential Revision: https://phabricator.services.mozilla.com/D280333
2026-01-28 15:18:42 +00:00
Alexandru Marc 903cacf596 Revert "Bug 2012009 - Part 2: Add a regression test for ScriptPreloader. r=tcampbell" for causing marionette failures @ test_preloader_cache_bypass
This reverts commit 74f72acbbb.

Revert "Bug 2012009 - Part 1: Don't retrieve scripts from non omni.ja JAR files from the ScriptPreloader or StartupCache. r=tcampbell"

This reverts commit 25dbc84378.
2026-01-27 22:16:17 +00:00
Mike Conley 25dbc84378 Bug 2012009 - Part 1: Don't retrieve scripts from non omni.ja JAR files from the ScriptPreloader or StartupCache. r=tcampbell
System add-ons can be installed in the profile directory as .xpi JAR files that
are updated independently of the application. Prior to this patch, when these JARs
are updated independently from the rest of the application, the ScriptPreloader
and StartupCache can serve stale bytecode compiled from the previous version of
the JAR, causing the old code to execute even though the JAR has been replaced.

This fix here adds a helper to checking if a script's JAR file is in one of
the omni.ja files before using cached bytecode.

Scripts from the omni.ja files continue to benefit from bytecode caching as
before.

Differential Revision: https://phabricator.services.mozilla.com/D280333
2026-01-27 21:39:06 +00:00
serge-sans-paille 7662b3abdc Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 19:36:01 +00:00
Cristina Horotan 8a1b1970b7 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing Gtest failures on AlreadyAddRefed.h
This reverts commit e98adca292.
2025-10-21 16:16:29 +00:00
serge-sans-paille e98adca292 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 15:05:17 +00:00
Cristina Horotan aab924e90d Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing build bustage at nsBrowserApp.cpp
This reverts commit fd0ffa193c.
2025-10-21 10:44:13 +00:00
serge-sans-paille fd0ffa193c Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 09:44:11 +00:00
Narcis Beleuzu e1e6bbb1c9 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing bustages on Document.cpp
This reverts commit b23c15e927.
2025-10-21 06:34:58 +00:00
serge-sans-paille b23c15e927 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 06:01:36 +00:00
serge-sans-paille 88c252a126 Bug 1994278 - Cleanup mozilla/TypedEnumBits.h useless inclusion r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D268603
2025-10-15 05:42:09 +00:00
serge-sans-paille 280f29e2b8 Bug 1993181 - Cleanup mfbt/NotNull.h r=emilio
- Remove unused includes
- use std::nullptr_t instead of decltype(nullptr)

Differential Revision: https://phabricator.services.mozilla.com/D267925
2025-10-10 13:59:05 +00:00
serge-sans-paille b7aa5d34b0 Bug 1993159 - Remove unused inclusion of mozilla/MacroForEach.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D267907
2025-10-08 13:06:57 +00:00
uniqueident 5b80575fda Bug 1957059 - Removed the "{marker.name} - " from all TableLabel and SetTableLabel calls in order to clean up existing marcher schemas in the profiler. r=canaltinova,profiler-reviewers,win-reviewers,toolkit-telemetry-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D263049
2025-09-16 13:51:07 +00:00
Andrew McCreight 2d02eabe09 Bug 1977139, part 2 - Don't allow StructuredCloneData to be moved. r=nika
While SCD doesn't have the problems that its parent classes have in terms
of moving, people have done a poor job of keeping the move constructor
updated as they add new auxiliary arrays. This led to strange behavior where
something would work when being sent between processes, but would crash
with a bounds error when being sent within a process.

This patch addresses the problem by preventing SCD from being moved. Instead,
UniquePtr<StructuredCloneData> must be used to move them around.

The dropping of the "using" of SCD from PBrowser means a few related places
have to explicitly qualify SCD with the ipc namespace.

Differential Revision: https://phabricator.services.mozilla.com/D262718
2025-08-29 23:45:31 +00:00
Cristina Horotan 938795eb09 Revert "Bug 1977139, part 2 - Don't allow StructuredCloneData to be moved. r=nika" for causing build bustage at JSActor.cpp
This reverts commit cd2962e220.

Revert "Bug 1977139, part 1 - Use macro for HasClonedDOMObjects and StructuredCloneHolder::Read. r=asuth"

This reverts commit 2cc5ec76dd.
2025-08-29 22:49:12 +00:00
Andrew McCreight cd2962e220 Bug 1977139, part 2 - Don't allow StructuredCloneData to be moved. r=nika
While SCD doesn't have the problems that its parent classes have in terms
of moving, people have done a poor job of keeping the move constructor
updated as they add new auxiliary arrays. This led to strange behavior where
something would work when being sent between processes, but would crash
with a bounds error when being sent within a process.

This patch addresses the problem by preventing SCD from being moved. Instead,
UniquePtr<StructuredCloneData> must be used to move them around.

The dropping of the "using" of SCD from PBrowser means a few related places
have to explicitly qualify SCD with the ipc namespace.

Differential Revision: https://phabricator.services.mozilla.com/D262718
2025-08-29 21:41:29 +00:00
Nazım Can Altınova 9469d2d919 Bug 1980588 - Add PayloadFlags to the old and Rust marker API r=mstange,profiler-reviewers
This changes a lot of places, but it's essentially just find and
replace. We had to change this old marker API, because the new API
uses this one to serialize the marker schema fields.

This patch removes the AddKey{Label,}FormatSearchable methods and
switches to use the original AddKey{Label,}Format methods with an
optional parameter instead to make sure that we can pass multiple flags
instead of just Searchable.

For Rust, since we can't have default argument values, we had to create
a new method for them.

Differential Revision: https://phabricator.services.mozilla.com/D260465
2025-08-27 22:02:38 +00:00
Emilio Cobos Álvarez 791917d8af Bug 1976665 - Sort headers in dom/. r=dom-core,media-playback-reviewers,webrtc-reviewers,dom-storage-reviewers,padenot,janv,smaug,jesup,jib
Most changes are automated. Relevant bit is dom/.clang-format. I had to
manually disable clang-format in a few places where importing external
files and so on that aren't self-contained, and fix a couple includes /
forward declarations.

Differential Revision: https://phabricator.services.mozilla.com/D256800
2025-08-05 11:47:34 +00:00
Florian Quèze 9885783942 Bug 1956726 - remove leftover Telemetry.h includes in .cpp files, r=chutten,geckoview-reviewers,cookie-reviewers,win-reviewers,dom-storage-reviewers,gstoll,valentin,m_kato,janv.
Differential Revision: https://phabricator.services.mozilla.com/D244351
2025-04-08 13:03:02 +00:00
Jan de Mooij 33eb26d6d2 Bug 1914895 - Make Symbol.unscopables support optional for non-syntactic with-environments. r=arai
In D220213 we tried to change `Symbol.unscopables` so that it's only supported on
syntactic `with` environments (for performance reasons). This failed some WPT tests
for event handlers because they use non-syntactic with-environments but have to
support `Symbol.unscopables`.

This patch adds a `JS::EnvironmentChain` class and uses it instead of an object vector
for some JS APIs. This class also lets the embedder specify whether `Symbol.unscopables`
must be supported. The `evaluate` shell function now has an option for this too.

Differential Revision: https://phabricator.services.mozilla.com/D226139
2024-10-21 17:56:43 +00:00
Noemi Erli c039a8c0dd Backed out changeset e3ad21dfdd4b (bug 1914895) for causing SM bustages 2024-10-21 16:29:12 +03:00
Jan de Mooij 7132e31ec4 Bug 1914895 - Make Symbol.unscopables support optional for non-syntactic with-environments. r=arai
In D220213 we tried to change `Symbol.unscopables` so that it's only supported on
syntactic `with` environments (for performance reasons). This failed some WPT tests
for event handlers because they use non-syntactic with-environments but have to
support `Symbol.unscopables`.

This patch adds a `JS::EnvironmentChain` class and uses it instead of an object vector
for some JS APIs. This class also lets the embedder specify whether `Symbol.unscopables`
must be supported. The `evaluate` shell function now has an option for this too.

Differential Revision: https://phabricator.services.mozilla.com/D226139
2024-10-21 11:32:03 +00:00
Florian Quèze 8a6c9c7810 Bug 1913624 - Remove expired telemetry histograms IPC_SAME_PROCESS_MESSAGE_COPY_OOM_KB and IPC_SYNC_MESSAGE_MANAGER_LATENCY_MS, r=TravisLong.
Depends on D219481

Differential Revision: https://phabricator.services.mozilla.com/D219482
2024-08-21 09:14:32 +00:00