Commit Graph
782 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
Magnus Melin dc5b222609 Bug 2037371 - fix ASan detected leak in PrefWrapper::GetStringValue(). r=profiler-reviewers,canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D298786
2026-05-06 17:38:04 +00:00
Sylvestre Ledru 8b037e6641 Bug 2036402 - Apply std::move in modules where values can be moved instead of copied r=dom-core,smaug
Differential Revision: https://phabricator.services.mozilla.com/D298105
2026-05-04 11:13:21 +00:00
serge-sans-paille e2c5e9e70b Bug 2034006 - Remove unused include of <regex> r=necko-reviewers,sunil
Differential Revision: https://phabricator.services.mozilla.com/D295794
2026-04-25 07:09:36 +00:00
serge-sans-paille a1755db116 Bug 2034001 - Remove unused include of <ctype.h> r=profiler-reviewers,firefox-style-system-reviewers,emilio,canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D295789
2026-04-25 07:09:20 +00:00
Alexandru Marc 52197ec05d Revert "Bug 2034001 - Remove unused include of <ctype.h> r=profiler-reviewers,firefox-style-system-reviewers,emilio,canaltinova"
This reverts commit e4406d802d.
2026-04-24 15:08:37 +00:00
Alexandru Marc 6552242066 Revert "Bug 2034006 - Remove unused include of <regex> r=necko-reviewers,sunil"
This reverts commit dad77e46f1.
2026-04-24 15:08:28 +00:00
serge-sans-paille dad77e46f1 Bug 2034006 - Remove unused include of <regex> r=necko-reviewers,sunil
Differential Revision: https://phabricator.services.mozilla.com/D295794
2026-04-24 14:19:44 +00:00
serge-sans-paille e4406d802d Bug 2034001 - Remove unused include of <ctype.h> r=profiler-reviewers,firefox-style-system-reviewers,emilio,canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D295789
2026-04-24 14:19:28 +00:00
Emilio Cobos Álvarez f1811701d3 Bug 2027340 - Remove moz-gio: protocol. r=stransky,necko-reviewers,extension-reviewers,rpl,jesup
It was added in bug 494163 for smb: / sftp: handling.

But we've stopped using it for anything meaningful by default:

 * bug 1433507 conditionally removed it.
 * bug 1666725 removed smb: support.
 * bug 1843763 removed sftp: support.

It's definitely not used in the codebase, and I haven't found any
remaining use of it outside (it wouldn't work unless with prefs
anyways).

So I'm fairly sure this is fine to kill nowadays.

Differential Revision: https://phabricator.services.mozilla.com/D292425
2026-04-08 06:53:57 +00:00
serge-sans-paille 9d62b9b5fc Bug 2027737 - Avoid forwarding an object to a call that does not accept r-value r=chutten,glandium
In that case, there's no overload of  pref->GetValue that takes an
r-value as second parameter.

Differential Revision: https://phabricator.services.mozilla.com/D290886
2026-04-07 06:43:56 +00:00
Greg Stoll 0bf7eb61cf Bug 2022738 - remove prefs_file_that_failed_to_parse telemetry r=glandium
We think we have fixed the problem, so remove the telemetry.

Differential Revision: https://phabricator.services.mozilla.com/D288196
2026-03-19 06:46:30 +00:00
Sylvestre Ledru 3bdffba86f Bug 2023419 - Remove Emacs/Vim modelines from modules/ r=emilio
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287857
2026-03-17 12:06:03 +00:00
Greg Stoll f9099ea34c Bug 2022735 - don't record UUIDs in pref failure telemetry r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D287268
2026-03-13 01:25:35 +00:00
Greg Stoll d99ceeeec1 Bug 2004956 - record in telemetry pref files that fail to parse r=TravisLong,glandium,data-stewards,chutten
Differential Revision: https://phabricator.services.mozilla.com/D283898
2026-03-05 23:52:14 +00:00
Alexandru Marc 258a5d71b7 Revert "Bug 2004956 - record in telemetry pref files that fail to parse r=TravisLong,glandium,data-stewards,chutten" for causing bnar bustages @ Parser.cpp
This reverts commit 3fda923e56.
2026-03-05 16:59:56 +00:00
Greg Stoll 3fda923e56 Bug 2004956 - record in telemetry pref files that fail to parse r=TravisLong,glandium,data-stewards,chutten
Differential Revision: https://phabricator.services.mozilla.com/D283898
2026-03-05 15:09:26 +00:00
Jens Stutte cefef0c5fe Bug 2016728 - Optimize runtime of FreeObserverList. r=gstoll
FreeObserverList appears in quite a few late shutdown hangs on CI. The current implementation has near-quadratic runtime, as we walk the entire callback list for each observer in the freed branch.

We can do better by just matching all callbacks for the branch in question in one linear sweep.

Differential Revision: https://phabricator.services.mozilla.com/D283453
2026-03-05 02:32:43 +00:00
Jens Stutte d2e91f6215 Bug 2016898 - Fix leak and identity bugs for weak pref observers. r=gstoll
Weak pref observer callbacks (CallbackNodes) were never removed from the
global callback list after the observer expired, causing unbounded growth.

This patch:
- Schedules an IdleTaskRunner to sweep expired weak callbacks, triggered
  when a notification finds an expired observer or after every 512 weak
  observer registrations.
- Fixes PrefCallback::KeyEquals to use the weak reference proxy object
  for identity instead of the raw canonical nsISupports pointer, which
  was vulnerable to address reuse after the observer was destroyed.
- Removes the now-unnecessary mCanonical field from PrefCallback.
- Adds gtests for both sweep trigger paths.

Differential Revision: https://phabricator.services.mozilla.com/D283452
2026-03-04 13:43:50 +00:00
Serban Stanca 5dda2e9b94 Revert "Bug 2004956 - record in telemetry pref files that fail to parse r=TravisLong,glandium,data-stewards" for causing source test python failures.
This reverts commit 84cdad1f9b.
2026-03-03 20:03:16 +00:00
Greg Stoll 84cdad1f9b Bug 2004956 - record in telemetry pref files that fail to parse r=TravisLong,glandium,data-stewards
Differential Revision: https://phabricator.services.mozilla.com/D283898
2026-03-03 19:28:47 +00:00
Alexandru Marc 97ec16596b Revert "Bug 2016728, Bug 2016898) for causing xpcshell failures
This reverts commit e251aa5b3c.

Revert "Bug 2016898 - Fix leak and identity bugs for weak pref observers. r=gstoll"

This reverts commit 00e3b60fcb.
2026-02-28 12:37:50 +00:00
Jens Stutte e251aa5b3c Bug 2016728 - Optimize runtime of FreeObserverList. r=gstoll
FreeObserverList appears in quite a few late shutdown hangs on CI. The current implementation has near-quadratic runtime, as we walk the entire callback list for each observer in the freed branch.

We can do better by just matching all callbacks for the branch in question in one linear sweep.

Differential Revision: https://phabricator.services.mozilla.com/D283453
2026-02-28 11:40:58 +00:00
Jens Stutte 00e3b60fcb Bug 2016898 - Fix leak and identity bugs for weak pref observers. r=gstoll
Weak pref observer callbacks (CallbackNodes) were never removed from the
global callback list after the observer expired, causing unbounded growth.

This patch:
- Schedules an IdleTaskRunner to sweep expired weak callbacks, triggered
  when a notification finds an expired observer or after every 512 weak
  observer registrations.
- Fixes PrefCallback::KeyEquals to use the weak reference proxy object
  for identity instead of the raw canonical nsISupports pointer, which
  was vulnerable to address reuse after the observer was destroyed.
- Removes the now-unnecessary mCanonical field from PrefCallback.
- Adds gtests for both sweep trigger paths.

Differential Revision: https://phabricator.services.mozilla.com/D283452
2026-02-28 11:40:56 +00:00
Serban Stanca 07e53f6d6c Revert "Bug 2016728, Bug 2016898 - Optimize runtime of FreeObserverList. r=gstoll" for causing gtest failures.
This reverts commit 5053585f2f.

This reverts commit be88d8102e.
2026-02-28 02:06:11 +00:00
Jens Stutte 5053585f2f Bug 2016728 - Optimize runtime of FreeObserverList. r=gstoll
FreeObserverList appears in quite a few late shutdown hangs on CI. The current implementation has near-quadratic runtime, as we walk the entire callback list for each observer in the freed branch.

We can do better by just matching all callbacks for the branch in question in one linear sweep.

Differential Revision: https://phabricator.services.mozilla.com/D283453
2026-02-28 00:28:37 +00:00
Jens Stutte be88d8102e Bug 2016898 - Fix leak and identity bugs for weak pref observers. r=gstoll
Weak pref observer callbacks (CallbackNodes) were never removed from the
global callback list after the observer expired, causing unbounded growth.

This patch:
- Schedules an IdleTaskRunner to sweep expired weak callbacks, triggered
  when a notification finds an expired observer or after every 512 weak
  observer registrations.
- Fixes PrefCallback::KeyEquals to use the weak reference proxy object
  for identity instead of the raw canonical nsISupports pointer, which
  was vulnerable to address reuse after the observer was destroyed.
- Removes the now-unnecessary mCanonical field from PrefCallback.
- Adds gtests for both sweep trigger paths.

Differential Revision: https://phabricator.services.mozilla.com/D283452
2026-02-28 00:28:34 +00:00
agoloman 7e43762210 Revert "Bug 2016728 - Optimize runtime of FreeObserverList. r=gstoll" for causing bc failures.
This reverts commit e6c70edab2.

Revert "Bug 2016898 - Fix potential leak for weak pref observers. r=gstoll"

This reverts commit e40f0062db.
2026-02-26 17:36:15 +00:00
Jens Stutte e6c70edab2 Bug 2016728 - Optimize runtime of FreeObserverList. r=gstoll
FreeObserverList appears in quite a few late shutdown hangs on CI. The current implementation has near-quadratic runtime, as we walk the entire callback list for each observer in the freed branch.

We can do better by just matching all callbacks for the branch in question in one linear sweep.

Differential Revision: https://phabricator.services.mozilla.com/D283453
2026-02-25 21:03:35 +00:00
Jens Stutte e40f0062db Bug 2016898 - Fix potential leak for weak pref observers. r=gstoll
The CallbackNodes for Preference observers added with AddWeakObserver are never removed from our callback list.

We can do so in two occasion:

- when a specific pref change is notified but the callback expired
- at regular growth thresholds to avoid unbounded growth

The patch also adds tests for both.

Differential Revision: https://phabricator.services.mozilla.com/D283452
2026-02-25 21:03:32 +00:00
agoloman 04cdde5beb Revert "Bug 2016728, Bug 2016898 - Optimize runtime of FreeObserverList. r=gstoll" for causing bc failures.
This reverts commit ebe97bac83.

Revert "Bug 2016898 - Fix potential leak for weak pref observers. r=gstoll"

This reverts commit 6373509232.
2026-02-25 04:43:27 +00:00
Jens Stutte ebe97bac83 Bug 2016728 - Optimize runtime of FreeObserverList. r=gstoll
FreeObserverList appears in quite a few late shutdown hangs on CI. The current implementation has near-quadratic runtime, as we walk the entire callback list for each observer in the freed branch.

We can do better by just matching all callbacks for the branch in question in one linear sweep.

Differential Revision: https://phabricator.services.mozilla.com/D283453
2026-02-24 18:24:53 +00:00
Jens Stutte 6373509232 Bug 2016898 - Fix potential leak for weak pref observers. r=gstoll
The CallbackNodes for Preference observers added with AddWeakObserver are never removed from our callback list.

We can do so in two occasion:

- when a specific pref change is notified but the callback expired
- at regular growth thresholds to avoid unbounded growth

The patch also adds tests for both.

Differential Revision: https://phabricator.services.mozilla.com/D283452
2026-02-24 18:24:50 +00:00
Pier Angelo Vendrame 7a8cc12b4f Bug 2016052 - Add a build flag to disable system preferences. r=gstoll
Differential Revision: https://phabricator.services.mozilla.com/D282768
2026-02-17 14:59:47 +00:00
Mark Banner 1251f28a7b Bug 2015819 - Change nsIPrefBranch.getPrefType definition to return a cenum rather than an integer. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D282607
2026-02-12 20:47:10 +00:00
Greg Stoll d6dfd9f8cd Bug 2004387 - send failure reason when parsing prefs file over Glean r=chutten,glandium
We are seeing a lot of clients failing to parse their prefs file, and
we don't know why. This is a first step to help us figure out what's going
on; we can record the failure reason to see if one reason is much more
common than the others, which might indicate a common problem.

Note that the message we're recording is a static string, so there should
not be any data sensitivity concerns with this.

Differential Revision: https://phabricator.services.mozilla.com/D275627
2026-02-10 16:43:16 +00:00
Nikolas Wipper f6fd23dc63 Bug 2014243 - Remove mutex in MaybeInitOncePrefs(). r=gstoll
Differential Revision: https://phabricator.services.mozilla.com/D282365
2026-02-10 14:20:20 +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
Emilio Cobos Álvarez 6a9374258b Bug 2014945 - Avoid \n in NS_WARNING. r=stransky,necko-reviewers,webrtc-reviewers,dbaker
It is not needed and makes the warning filename and so on show up in a
different line.

Differential Revision: https://phabricator.services.mozilla.com/D282098
2026-02-06 08:45:22 +00:00
Jens Stutte e7635d804f Bug 1998133 - Serialize Preference writes through a TaskQueue. r=gstoll
Previously a burst of WritePrefFile calls could lead to saturize the underlying pool if the first event blocked on IO.

We can avoid this by going through a TaskQueue, and we can just use the background event target with DISPATCH_EVENT_MAY_BLOCK.

Differential Revision: https://phabricator.services.mozilla.com/D279526
2026-01-20 15:45:53 +00:00
Chris Peterson c22d71ab11 Bug 2002864 - Replace MOZ_CONSTINIT with C++20 constinit in desktop app code. r=firefox-desktop-core-reviewers ,mossop
Differential Revision: https://phabricator.services.mozilla.com/D274497
2025-12-09 06:59:28 +00:00
Greg Stoll 4644daa4db Bug 849620 - handle deleteBranch() calls with trailing dots and double dots consistently r=beth
Differential Revision: https://phabricator.services.mozilla.com/D270322
2025-11-14 17:05:41 +00:00
serge-sans-paille 112b4ba840 Bug 1996697 - Remove unused mfbt inclusion in xpcom/** r=emilio,media-playback-reviewers,profiler-reviewers,profiles-reviewers,chunmin,canaltinova,mossop
Differential Revision: https://phabricator.services.mozilla.com/D270267
2025-10-28 14:33:40 +00:00
serge-sans-paille 9b6eb9c7f9 Bug 1996048 - Remove unused inclusion of UniquePtr.h or UniquePtrExtensions.h r=emilio,media-playback-reviewers,profiler-reviewers,win-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,gstoll,mstange,TYLin,chunmin
Differential Revision: https://phabricator.services.mozilla.com/D269782
2025-10-24 06:50:27 +00:00
serge-sans-paille 1667ec582b Bug 1995723 - Remove unused inclusion of mozilla/ArrayUtils.h r=necko-reviewers,application-update-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,firefox-svg-reviewers,layout-reviewers,gstoll,canaltinova,bytesized,alwu,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D269573
2025-10-23 07:30:37 +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