Commit Graph

891520 Commits

Author SHA1 Message Date
Maxx Crawford
32ca8aa13e Bug 1940566 - Add section to manage followed/blocked topics in Customize panel r=home-newtab-reviewers,fluent-reviewers,bolsson,amy
Differential Revision: https://phabricator.services.mozilla.com/D234219
2025-01-17 16:49:56 +00:00
Jens Stutte
00d84f5344 Bug 1903758 - Make mozjemalloc have a lazy purge for all arenas via idle processing on the main thread. r=smaug
We can defer the purging of arenas to happen during idle processing on the main thread.

We already have the following prerequisites thanks to bug 1488780:

- The (often) expensive OS functions to give back memory pages are not blocking the use of the arena on other threads anymore.

- A single call to moz_may_purge_one_now (D232083) wraps just arena_t::Purge() that will just do "some work on one chunk" and tell if more is needed, giving us a fine grained control.

Synchronous purging can block the caller of a memory freeing function for an unexpectedly long time. Furthermore, memory that might be reclaimed very soon can be madvised early and thus its reuse can lead to frequent page faults.

We thus use moz_enable_deferred_purge (see D232083) to queue purge requests and execute them on the main thread only if it is about to become idle. We do this using an IdleTaskRunner that ensures we won't purge too often or never.

We believe that the main thread being idle is probably the best easy indicator we have to tell if the process is idle enough to purge without performance regrets.

We expect the peak memory usage of a single arena to not be affected significantly by this during normal use, but the time that this peak holds up might extend. This means the peak sum of all memory from all running processes may rise for short periods of time until enough purges happened on potentially several processes.

There is a chance to mitigate this effect by lowering the settings of allowed dirty pages for arenas, as there should be less churn in general with this patch, potentially resulting in a lower memory usage in average.

Differential Revision: https://phabricator.services.mozilla.com/D220616
2025-01-17 16:13:33 +00:00
Jens Stutte
da839793c8 Bug 1903758 - Add an API to mozjemalloc to allow to control when to purge from outside. r=pbone,smaug
Introduce a list of outstanding purge requests and API calls to enable its use and hooks to actually purge.

Without enabling, the behavior remains unchanged.

Differential Revision: https://phabricator.services.mozilla.com/D232083
2025-01-17 16:13:32 +00:00
Jens Stutte
a76b0abf34 Bug 1903758 - Precalculate mMaxDirty. r=pbone
EffectiveUpdateMaxDirty() is called on every free and doing some calculations and reads memory from gArenas. After an arena is created, the value can only change when moz_set_max_dirty_page_modifier is called.

This showed up in profiles while working on Bug 1903758. During a full speedometer 3 run on that machine we used to spend 44ms in EffectiveMaxDirty(), with this patch only 4ms in ShouldStartPurge().

Differential Revision: https://phabricator.services.mozilla.com/D232902
2025-01-17 16:13:32 +00:00
Jens Stutte
955a376513 Bug 1903758 - Have helpers for purge thresholds. r=pbone
This is meant to increase readability where we used to use EffectiveMaxDirty() directly.

Note that ExtraCommitPages() uses different thresholds than Purge(), for that use we do not change anything.

Differential Revision: https://phabricator.services.mozilla.com/D232163
2025-01-17 16:13:31 +00:00
Jens Stutte
41622444e6 Bug 1903758 - Add an extra jemalloc_free_dirty_pages to the MinimizeMemoryUsageRunnable. r=pbone,smaug
This is most likely only paranoia, but we did not audit all listeners of "memory-pressure" if they do not dispatch other runnables to the main thread that might change the order.

Differential Revision: https://phabricator.services.mozilla.com/D232087
2025-01-17 16:13:30 +00:00
Tom Schuster
cce012a58b Bug 1940710 - Disallow and remove inline event handlers in historySidebar.xhtml. r=places-reviewers,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D234002
2025-01-17 16:10:00 +00:00
Gabriel Luong
d10649f901 Bug 1942231 - Add nimbus flag for enabling MARS integration r=android-reviewers,twhite
Differential Revision: https://phabricator.services.mozilla.com/D234641
2025-01-17 16:00:49 +00:00
Benjamin Forehand Jr
605a85f780 Bug 1942145 - Update Fenix Integration tests for new UI flow. r=jajohnson DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D234571
2025-01-17 15:43:05 +00:00
Fatih Kilic
7f8c8c561d Bug 1941875: Disable captcha detection in non-nightly builds. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D234512
2025-01-17 15:40:07 +00:00
Jon Coppeard
dcf48c6ab8 Bug 1941602 - Part 4: Ensure large dynamic elements allocations use good sizes r=jandem
This changes NativeObject::goodElementsAllocationAmount to ensure that good
sizes are used when allocating large buffers and that we avoid slop.

Differential Revision: https://phabricator.services.mozilla.com/D234370
2025-01-17 15:23:07 +00:00
Jon Coppeard
86c54f7510 Bug 1941602 - Part 3: Inline functions to get good buffer allocation sizes r=sfink
This should produce better code when the requested size is known in advance. If
the size is calculated it should let the compiler simplify the generated code
by combining the calculations.

Differential Revision: https://phabricator.services.mozilla.com/D234369
2025-01-17 15:23:06 +00:00
Jon Coppeard
22c1906c83 Bug 1941602 - Part 2: Re-add free of unused slots on resize r=jandem
This was removed in an earlier version of the buffer allocator before the free
operation was implemented. We can replace this now.

Differential Revision: https://phabricator.services.mozilla.com/D234368
2025-01-17 15:23:06 +00:00
Jon Coppeard
0bb44a3bc8 Bug 1941602 - Part 1: Simplify LargeBuffer implementation r=sfink
Originally the aim was to keep the size of this class very small to help with
telling the difference between pointers into large buffer allocations and other
kinds of GC thing (which would have have a great offset modulo chunk size).
However that was not used so we can use a more straigtforward representation
here.

The extra space is not sigificant for allocations of this size.

Differential Revision: https://phabricator.services.mozilla.com/D234367
2025-01-17 15:23:06 +00:00
Jon Coppeard
51fd38e8cf Bug 1941728 - Increase the granularity of large buffer allocations to 1MB r=sfink
Currently the granularity is PageSize, but that may be less then the system
page size.

This also simplifies some size calculations that did more work then required.

Differential Revision: https://phabricator.services.mozilla.com/D234366
2025-01-17 15:23:05 +00:00
Butkovits Atila
230205c1ae Backed out changeset 925a7c634e8c (bug 1184538) for causing failures at browser_rules_gridline-names-are-shown-correctly.js. CLOSED TREE 2025-01-17 18:39:40 +02:00
Meg Viar
3bd09d7884 Bug 1941350 - Add preonboarding modal Nimbus feature r=firefox-desktop-core-reviewers ,omc-reviewers,negin
- Add `preonboarding` Nimbus feature for showing a window modal over about:welcome that cannot be dismissed via ESC
- Include the ability to suppress showing the privacy notice tab on first run using a variable under the new `preonboarding` feature
- Remove legacy `showModal` related `aboutwelcome` Nimbus feature variables (these are not in use and were for [[ https://experimenter.services.mozilla.com/nimbus/window-modal-vs-tab-modal/summary | an old experiment ]])

Differential Revision: https://phabricator.services.mozilla.com/D234039
2025-01-17 15:18:15 +00:00
Emilio Cobos Álvarez
b12263f84f Bug 1942158 - Remove outparam from nsTreeBodyFrame::GetImage. r=dshin
No behavior change, because nobody inspects the return value.

Differential Revision: https://phabricator.services.mozilla.com/D234582
2025-01-17 15:10:44 +00:00
DJ
857429c48c Bug 1937856 - prevent saving tab groups with only discarded tabs. r=dao,jswinarton,sessionstore-reviewers,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D234505
2025-01-17 14:46:24 +00:00
Chris H-C
b7aab7b2fb Bug 1942150 - Remove SEARCH_SERVICE_INIT2_MS in favour of search.service.startup_time r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D234576
2025-01-17 14:37:31 +00:00
Valentin Gosu
047b388bc9 Bug 1940027 - Use nsACString in jar code r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D234164
2025-01-17 14:33:04 +00:00
Shane Hughes
65116b6a5c Bug 1941391 - Check for popups before opening tab preview panel. r=dao,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D234085
2025-01-17 14:32:44 +00:00
Jon Coppeard
f2c46512ec Bug 1941876 - Fix handling of dynamic elements when swapping objects r=jandem
There are two problems here. Firstly, swapping a nursery and a tenured object
can leave dynamic element buffers with the wrong ownership kind. For example
we could have a tenured object with a nursery-owned buffer. This could cause
UAF if the buffer we collected in the next nursery collection.

Secondly, the code to copy dynamic elements doesn't account for shifted
elements.

I added the testcase but also updated the testObjectSwap JSAPI test to catch
this problem. The change to BufferAllocator::checkChunkGCStateNotInUse is to
speed up this test.

Differential Revision: https://phabricator.services.mozilla.com/D234513
2025-01-17 14:26:00 +00:00
Greg Stoll
591aab7b39 Bug 1930846 - downgrade a MOZ_DIAGNOSTIC_ASSERT while we investigate r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D234672
2025-01-17 14:18:08 +00:00
Valentin Gosu
bafb4341c1 Bug 1942030 - nsStandarURL.setHost("") throws for URLTYPE_STANDARD r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D234487
2025-01-17 14:07:19 +00:00
Valentin Gosu
23fac99b8a Bug 1939493 - Make nsStandardURL::SetUserPass/SetUsername/SetPassword/SetPort be no-ops when the URL has an empty authority r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D234486
2025-01-17 14:07:19 +00:00
Tom Schuster
a957b463cf Bug 1941297 - Remove inline handler and use a restrictive CSP for bookmarkProperties.xhtml. r=places-reviewers,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D234034
2025-01-17 13:58:51 +00:00
Jonathan Kew
4a00d32b21 Bug 1936113 - Update metadata for WPT tests that now pass. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D234095
2025-01-17 13:49:57 +00:00
Jonathan Kew
24ee843a0b Bug 1936113 - Add a couple of reftests for the :open pseudo-class. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D234331
2025-01-17 13:49:56 +00:00
Jonathan Kew
6d25ae0f09 Bug 1936113 - Hook up :open to details, select, dialog, and input elements. r=webidl,emilio
Most of these elements are simple to support.

One slightly tricky item was <input type=date>, as testing indicates that the
front-end code usually (consistently?) hides the picker using setPickerState(),
which does not end up calling closeDateTimePicker() as might be expected.
So to properly track the open/closed state, I had to add a SetDateTimePickerState
webidl method, rather than just patching into the existing Open/Close calls.

Differential Revision: https://phabricator.services.mozilla.com/D234093
2025-01-17 13:49:56 +00:00
Jonathan Kew
fcdf5ee488 Bug 1936113 - Parse :open pseudo-class in the style system. r=dshin
This enables us to parse the pseudo, but it's not yet connected to anything.

Differential Revision: https://phabricator.services.mozilla.com/D234092
2025-01-17 13:49:55 +00:00
Jonathan Kew
8fb88eaa7d Bug 1936113 - Remove mention of obsolete param from the pseudo_class_macro comment. r=dshin
Trivial doc cleanup that I noticed when going to edit this file.

Differential Revision: https://phabricator.services.mozilla.com/D234091
2025-01-17 13:49:55 +00:00
Butkovits Atila
62de37b9ee Backed out changeset 0784e5fc89cd (bug 1941704) for causing failures at browser_ml_model.js. CLOSED TREE 2025-01-17 17:02:40 +02:00
Butkovits Atila
faa12f1f17 Backed out changeset c5b9604c6fe7 (bug 1939555) for causing Xpcshell failures at test_backgroundtask_help.js. 2025-01-17 16:59:23 +02:00
Emilio Cobos Álvarez
cbda6bd0d1 Bug 1941755 - Reftest-snapshot is slightly more fuzzy.
MANUAL PUSH: Trivial orange fix CLOSED TREE
2025-01-17 16:11:25 +01:00
Benjamin VanderSloot
c8fa85421b Bug 1941960 - Fix intermittent race condition in storage access telemetry test - r=anti-tracking-reviewers,emz
Differential Revision: https://phabricator.services.mozilla.com/D234523
2025-01-17 13:38:47 +00:00
Nicolas Chevobbe
03db070c70 Bug 1184538 - [devtools] Shift+Up|Down should not trigger autocomplete in InplaceEditor. r=devtools-reviewers,jdescottes.
Those were triggering specific issues as they do cause
characters to be selected in the input, which makes it
looks like a regular completion to the maybeSuggestCompletion
method. Other selecting combination (e.g. Shift+Right|Home)
didn't suffer from this because they're triggering a different
code path.
This adds a few test cases to make sure we're handling all those
as we should.

Differential Revision: https://phabricator.services.mozilla.com/D234468
2025-01-17 13:38:45 +00:00
Emma Zuehlcke
68ff212cc6 Bug 1936363 - Include STATE_ALLOWED_TRACKING_CONTENT in content blocking events field. r=anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D231722
2025-01-17 13:37:37 +00:00
Otto Länd
6826d77fb1 Bug 1901492: apply code formatting via Lando
# ignore-this-changeset
2025-01-17 13:38:37 +00:00
Frédéric Wang
8e7927cc6d Bug 1901492 - Make GetTrustedTypesCompliantString work with workers. r=smaug,tschuster
Make sure GetTrustedTypesCompliantString() work when the specified
global object is a WorkerGlobalScope. If that happens the function
is executed from the worker thread. The following changes are made:

- ReportSinkTypeMismatchViolations: accept a nsICSPEventListener
  argument, so we can specify it for workers.
- LogSinkTypeMismatchViolationsRunnable: new helper class that
  executes ReportSinkTypeMismatchViolations on the main thread where
  WorkerPrivate::GetCsp() is accessible. This is similar to what
  LogViolationDetailsRunnable does for eval violations.
- ProcessValueWithADefaultPolicy: Retrieve TrustedTypePolicyFactory
  from WorkerGlobalScope::TrustedTypes() for workers. We also add add
  assert in that method to ensure it is only accessed from the worker
  thread, similarly to other implementations for WorkerGlobalScope
  IDL attributes.
- GetTrustedTypesCompliantString: retrieve the CSPInfo, and then
  RequireTrustedTypesForDirectiveState, from the worker thread.
  Use LogViolationDetailsRunnable to dispatch the sink mismatch
  violations.

Differential Revision: https://phabricator.services.mozilla.com/D233507
2025-01-17 13:35:40 +00:00
Frédéric Wang
443d8df98d Bug 1901492 - Add RequireTrustedTypesForDirective info to IPC structures. r=smaug,tschuster
Expose dom::nsCSPPolicy::mHasRequireTrustedTypesForDirective and
dom::nsCSPContext::mRequireTrustedTypesForDirectiveState on
ipc::ContentSecurityPolicy and ipc::CSPInfo respectively, making sure
that things remain in sync when converting between dom and ipc
structures and when serializing/deserializing ipc structures.

There is no exposed behavior change but having
RequireTrustedTypesForDirectiveState on ipc::CSPInfo will allow
to implement GetTrustedTypesCompliantString for worker thread.
The info on ipc::ContentSecurityPolicy is needed to ensure
nsCSPContext::mRequireTrustedTypesForDirectiveState is correctly
set after we append IPC policies and before EnsureIPCPoliciesRead()
is called.

Differential Revision: https://phabricator.services.mozilla.com/D233636
2025-01-17 13:35:40 +00:00
Frédéric Wang
51c2edda75 Bug 1901492 - Introduce RequireTrustedTypesForDirectiveState enum for CSP. r=smaug
Extend the hasPolicyWithRequireTrustedTypesForDirective boolean on
nsIContentSecurityPolicy to an enum in order to indicate whether there
is actually a require-trusted-types-for directive with "enforce"
disposition. Because there is currently only one sink group, we can
use this enum in GetTrustedTypesCompliantString() to determine whether
violations must be blocked, and perform violation reporting in an
independent function.

This will allow to make GetTrustedTypesCompliantString() work with
workers, by testing the enum on the worker thread and reporting
violations on the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D233506
2025-01-17 13:35:39 +00:00
Frédéric Wang
63dd0f8d49 Bug 1901492 - Simplify some require-trusted-types-for checks. r=smaug
Currently, there is only one sink group defined in the spec, accepted
by nsCSPParser::handleRequireTrustedTypesForDirective and used by
callers of GetTrustedTypesCompliantString. This means that the flag
added in bug 1909168 to indicate whether a policy contains a
require-trusted-types-for directive equivalently indicates whether
a policy contains a require-trusted-types-for for the supported
sink group and we currently don't need to browse the list of
directives to perform actual sink group matching.

Differential Revision: https://phabricator.services.mozilla.com/D233505
2025-01-17 13:35:39 +00:00
Updatebot
89c6815340 Bug 1942226 - Update android nightly application-services version bump to f63adf866474ef8b56fa1ce3c1ef922bce00f9df r=release-managers,dmeehan
Differential Revision: https://phabricator.services.mozilla.com/D234639
2025-01-17 13:31:12 +00:00
Alexandru Marc
43763ddc47 Bug 1798750 - Fix trailing whitespace lint error CLOSED TREE 2025-01-17 15:33:23 +02:00
ihar.hrachyshka
a6931855d3 Bug 1939555 - Don't initialize nsApplication on --*version or --help. r=mossop
This is wasteful; and it fails with SIGABRT when executed in a sandboxed
environment. (The issue was spotted in a sandboxed nixpkgs build environment
where `firefox --version` is used as a sanity check for the produced binary.)

Differential Revision: https://phabricator.services.mozilla.com/D233027
2025-01-17 13:29:26 +00:00
André Bargull
ae3568c4ff Bug 1941864 - Part 10: Remove unreachable case from LIRGenerator::visitClampToUint8. r=spidermonkey-reviewers,jandem
The input can only be (Int32, Double, Value), cf. `ClampPolicy::adjustInputs`.

Differential Revision: https://phabricator.services.mozilla.com/D234394
2025-01-17 13:20:30 +00:00
André Bargull
32dec672b1 Bug 1941864 - Part 9: Handle all comparison types in ComparePolicy. r=spidermonkey-reviewers,jandem
Makes it clearer why comparison types aren't handled by the type policy.

Differential Revision: https://phabricator.services.mozilla.com/D234393
2025-01-17 13:20:30 +00:00
André Bargull
54634bc875 Bug 1941864 - Part 8: Split wasm and non-wasm code paths in outOfLineTruncateSlow. r=spidermonkey-reviewers,jandem
The code is more readable when there are fewer `if (compilingWasm) { ... }` blocks.

Differential Revision: https://phabricator.services.mozilla.com/D234392
2025-01-17 13:20:29 +00:00
André Bargull
62134fdec6 Bug 1941864 - Part 7: Use ScratchDoubleScope for all targets in MacroAssembler::outOfLineTruncateSlow. r=spidermonkey-reviewers,jandem
`ScratchDoubleScope` is also available on x86 and x64, so it's unclear why using
the stack is necessary here.

Differential Revision: https://phabricator.services.mozilla.com/D234391
2025-01-17 13:20:29 +00:00