Commit Graph

7825 Commits

Author SHA1 Message Date
Jens Stutte
806b8e59f7 Bug 1778860 - Use the where and why message when crashing on IPC_FAIL in DEBUG. r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D186621
2023-08-23 10:30:02 +00:00
Cristian Tuns
bc5116b463 Backed out 4 changesets (bug 1758155) for causing build bustages in NetworkConnectivityService.cpp CLOSED TREE
Backed out changeset bec8e6762e2a (bug 1758155)
Backed out changeset 230add1b5bb5 (bug 1758155)
Backed out changeset 4bc26c75c26a (bug 1758155)
Backed out changeset 7b628b437e19 (bug 1758155)
2023-08-16 10:32:03 -04:00
Kershaw Chang
e247e6006d Bug 1758155 - PBackground clenup, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D185032
2023-08-16 13:13:31 +00:00
Kershaw Chang
37b27a28d1 Bug 1758155 - Make PWebSocketConnection a toplevel actor, r=necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D185031
2023-08-16 13:13:31 +00:00
Kershaw Chang
11a38e67b0 Bug 1758155 - Remove some PSM actos from PBackground, r=keeler,nika,necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D182996
2023-08-16 13:13:31 +00:00
Kershaw Chang
4066aac953 Bug 1758155 - Make PMediaTransport and PBackgroundDataBridge toplevel actors, r=nika,necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D182995
2023-08-16 13:13:30 +00:00
Andrew Osmond
25c238ea4e Bug 1845946 - Part 1. Switch GMP process launching IPDL messages from sync to async. r=ipc-reviewers,media-playback-reviewers,alwu,mccr8
When launching the GMP process, or querying its state, via PGMPService,
the design was already asynchronous. As such we can remove the sync
requirement quite easily and allow more flexibility on the parent
process side.

Differential Revision: https://phabricator.services.mozilla.com/D185335
2023-08-15 16:46:12 +00:00
Benjamin VanderSloot
58d36f75d6 Bug 1835907, part 1 - Add has storage access bit and triggering window id to the LoadInfo - r=smaug,necko-reviewers,kershaw,pbz
In the Storage Access API's latest draft, a few items were added to the user-agent state. Relevant here,
the source snapshot params gained two fields that are initialized from the sourceDocument during
snapshotting source params while navigating: "has storage access" and "environment id".

https://privacycg.github.io/storage-access/#ua-state

These are used to identify self-initiated navigations that come from documents that have obtained storage access.
Combined with a same-origin check, this determines if the destination document of the navigation should start
with storage access.

This is stricter than the current behavior, where if the permission is available, all documents start with storage access.
Instead, now a document will only have storage access if it requests it explicitly or if a same-origin document that has
storage access navigates itself to that document. This is seen as a security win.

Security discussion of this change was here: https://github.com/privacycg/storage-access/issues/113
Artur at Google wrote up a great summary here: https://docs.google.com/document/d/1AsrETl-7XvnZNbG81Zy9BcZfKbqACQYBSrjM3VsIpjY/edit#

Differential Revision: https://phabricator.services.mozilla.com/D184821
2023-08-15 13:04:04 +00:00
Cosmin Sabou
4f5ef3986b Backed out 6 changesets (bug 1835907) for causing multiple failures. CLOSED TREE
Backed out changeset 91ef29afec50 (bug 1835907)
Backed out changeset 989479621780 (bug 1835907)
Backed out changeset 86e3f98ceb31 (bug 1835907)
Backed out changeset 4790e44c234c (bug 1835907)
Backed out changeset bb9f48eec5bf (bug 1835907)
Backed out changeset 74f90708260a (bug 1835907)
2023-08-14 22:18:10 +03:00
Benjamin VanderSloot
06a4432ed1 Bug 1835907, part 1 - Add has storage access bit and triggering window id to the LoadInfo - r=smaug,necko-reviewers,kershaw,pbz
In the Storage Access API's latest draft, a few items were added to the user-agent state. Relevant here,
the source snapshot params gained two fields that are initialized from the sourceDocument during
snapshotting source params while navigating: "has storage access" and "environment id".

https://privacycg.github.io/storage-access/#ua-state

These are used to identify self-initiated navigations that come from documents that have obtained storage access.
Combined with a same-origin check, this determines if the destination document of the navigation should start
with storage access.

This is stricter than the current behavior, where if the permission is available, all documents start with storage access.
Instead, now a document will only have storage access if it requests it explicitly or if a same-origin document that has
storage access navigates itself to that document. This is seen as a security win.

Security discussion of this change was here: https://github.com/privacycg/storage-access/issues/113
Artur at Google wrote up a great summary here: https://docs.google.com/document/d/1AsrETl-7XvnZNbG81Zy9BcZfKbqACQYBSrjM3VsIpjY/edit#

Differential Revision: https://phabricator.services.mozilla.com/D184821
2023-08-14 18:02:46 +00:00
Cristian Tuns
da1e39f50e Backed out 3 changesets (bug 1845946) for causing bug 1848484. CLOSED TREE
Backed out changeset bad73ceb87dd (bug 1845946)
Backed out changeset f984e69872e4 (bug 1845946)
Backed out changeset af600f0290b6 (bug 1845946)
2023-08-13 15:38:36 -04:00
Manuel Bucher
43f8338f9c Bug 1842754 - Make LoadInfoArgs non-optional over IPC r=necko-reviewers,jesup
This makes all occurences of LoadInfoArgs non-optional also when
converting between nsILoadInfo in BackgroundUtils.h.

Differential Revision: https://phabricator.services.mozilla.com/D185299
2023-08-11 13:45:25 +00:00
Gregory Pappas
731275ba2f Bug 1846641 - Remove Adobe Flash fullscreen IPC handling r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D185110
2023-08-10 18:48:07 +00:00
Andrew Osmond
4ca8d166c5 Bug 1845946 - Part 1. Switch GMP process launching IPDL messages from sync to async. r=ipc-reviewers,media-playback-reviewers,alwu,mccr8
When launching the GMP process, or querying its state, via PGMPService,
the design was already asynchronous. As such we can remove the sync
requirement quite easily and allow more flexibility on the parent
process side.

Differential Revision: https://phabricator.services.mozilla.com/D185335
2023-08-10 14:31:47 +00:00
Jed Davis
583d256da7 Bug 1840515 - Step 2: Preload the omnijars in the fork server. r=nika
This extends the previous support for `-greomni` and `-appomni` to the
fork server, so that it can pre-open the jar files and thus continue
using the correct versions in forked child processes even if the files on
disk are replaced by an update or deleted.

Differential Revision: https://phabricator.services.mozilla.com/D185331
2023-08-09 21:35:50 +00:00
Jed Davis
2ad421aaf8 Bug 1840515 - Step 1: Use -greomni/-appomni for content processes. r=nika,mhowell
Currently, each content process re-derives the path(s) of the omnijar
file(s).  We used to pass it down as a command-line argument, but
those args were also accepted by the parent process and there were
issues with that (CVE-2020-6799) such that they were completely removed
(bug 1531475).  However, content processes can generally trust their
arguments; note that they currently accept `-appDir`.

We were already using `-gredir` for this on Android (it has a unified
omnijar, so there's no `-appdir` in that case); this patch subsumes the
content-process case of that, but not the parent process (which consumes
basically a fake argv constructed in Java code).

Note that only the parent process and content processes use the
omnijars; every other process type uses either minimal XPCOM, which
doesn't include them, or no XPCOM at all (e.g., GMP before bug 1845946).

The end goal of this patch series is to use those flags with the fork
server (so that it can preload the files without needing any XPCOM), but
this patch changes only the case of content processes.

Differential Revision: https://phabricator.services.mozilla.com/D182510
2023-08-09 21:35:49 +00:00
Jed Davis
c9012150fb Bug 1840515 - Step 0: Use GeckoArgs for the -greomni and -appomni flags. r=nika
The `-appomni` flag isn't currently used, but the next patch will bring
it back and change how both flags are processed in child processes.

Differential Revision: https://phabricator.services.mozilla.com/D185330
2023-08-09 21:35:49 +00:00
Natalia Csoregi
d2ed1b1ca2 Backed out changeset 3c585e66b44b (bug 1842754) for causing Bug 1847904. CLOSED TREE 2023-08-09 19:35:08 +03:00
Christian Holler (:decoder)
c4325468f0 Bug 1847780 - Make RemoteLazyInputStream and DataPipeReceiver non-nullable. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D185721
2023-08-09 15:47:15 +00:00
Manuel Bucher
f37405ff24 Bug 1842754 - Make LoadInfoArgs non-optional over IPC r=necko-reviewers,jesup
This makes all occurences of LoadInfoArgs non-optional also when
converting between nsILoadInfo in BackgroundUtils.h.

Differential Revision: https://phabricator.services.mozilla.com/D185299
2023-08-08 14:37:19 +00:00
Paul Adenot
5cc7f12b8c Bug 1823953 - Adjust utility process tests: the expected decoders are now ffmpeg. r=gerard-majax
Differential Revision: https://phabricator.services.mozilla.com/D182369
2023-08-08 12:12:54 +00:00
Iulian Moraru
98f7137dd1 Backed out changeset 05857d2111ba (bug 1842754) for causing build bustages on BackgroundUtils.cpp. CLOSED TREE 2023-08-08 13:51:28 +03:00
Manuel Bucher
25a2f89619 Bug 1842754 - Make LoadInfoArgs non-optional over IPC r=necko-reviewers,jesup
This makes all occurences of LoadInfoArgs non-optional also when
converting between nsILoadInfo in BackgroundUtils.h.

Differential Revision: https://phabricator.services.mozilla.com/D185299
2023-08-08 10:25:04 +00:00
Nika Layzell
e21e43e089 Bug 1845146 - Check numberOfBytes{Read,Written} in TestManyHandles, r=ipc-reviewers,handyman
When running GTests on Windows 7, the TestManyHandles test crashes due
to the lpNumberOfBytesWritten argument to WriteFile not being passed.
This argument is required on earlier versions of Windows like Windows 7.

While we no longer support Windows 7 on Nightly, we still support it on
ESR, and are trying to run GTests on Windows 7 there. It also doesn't
hurt to add extra assertions that the full amount of data is
read/written, so checking this could be valuable on m-c as well.

Differential Revision: https://phabricator.services.mozilla.com/D184393
2023-08-02 21:40:19 +00:00
Brad Werth
5c1d5c00b9 Bug 1845144 Part 2: Remove macOS available and builtin_available directives for always-supported versions of macOS. r=mac-reviewers,mstange,keeler,padenot
This also does minimal refactoring of cases where the directives were
protecting a simple expression that could be refactored back to the
callers.

Differential Revision: https://phabricator.services.mozilla.com/D184399
2023-08-02 02:26:14 +00:00
Cristian Tuns
5d6b51256b Backed out 57 changesets (bug 1839389, bug 1840869, bug 1840399, bug 1840402, bug 1823953, bug 1828912, bug 1826382, bug 1837160, bug 1839391, bug 1833654) for causing build bustages in ogg_<something> CLOSED TREE
Backed out changeset 61356e1447e3 (bug 1823953)
Backed out changeset 85785505b6d6 (bug 1823953)
Backed out changeset 46a61cbfe8a8 (bug 1833654)
Backed out changeset 83e3de80337b (bug 1833654)
Backed out changeset 1a10c12874ac (bug 1840399)
Backed out changeset 6b087145b67f (bug 1833654)
Backed out changeset b9ac857ad43f (bug 1840399)
Backed out changeset 4b841e8dd033 (bug 1823953)
Backed out changeset 650e35803834 (bug 1823953)
Backed out changeset c11b58ac0709 (bug 1823953)
Backed out changeset c0249c90bc31 (bug 1823953)
Backed out changeset 8929288d5aec (bug 1823953)
Backed out changeset 828792b886bd (bug 1823953)
Backed out changeset 873f1d4a8875 (bug 1840869)
Backed out changeset a25abd05302c (bug 1823953)
Backed out changeset d4b1eb442c36 (bug 1840399)
Backed out changeset c25509d72a96 (bug 1840399)
Backed out changeset 0f72a0626a28 (bug 1840402)
Backed out changeset 82e7574364ce (bug 1840399)
Backed out changeset 93073105f063 (bug 1840399)
Backed out changeset 56ec8e3405e9 (bug 1840399)
Backed out changeset ff15dad37ab8 (bug 1840399)
Backed out changeset 0655ebd61eda (bug 1840399)
Backed out changeset 7bca1ae06c7d (bug 1828912)
Backed out changeset 8a5a849cfe5f (bug 1828912)
Backed out changeset 3d8422a2038a (bug 1828912)
Backed out changeset f08ee5de9370 (bug 1823953)
Backed out changeset a4eb210620ff (bug 1823953)
Backed out changeset aa8914cd55be (bug 1839391)
Backed out changeset 3ea1f43e4024 (bug 1823953)
Backed out changeset 3efe02ffa1c8 (bug 1826382)
Backed out changeset 81c4553ec23d (bug 1839391)
Backed out changeset 130894e4a781 (bug 1839391)
Backed out changeset 9a0247b0fc85 (bug 1839391)
Backed out changeset 11a923064382 (bug 1839391)
Backed out changeset 98ffb66160c3 (bug 1837160)
Backed out changeset a80dda9a220a (bug 1837160)
Backed out changeset 251b4ef97a2b (bug 1837160)
Backed out changeset 7372632eb32f (bug 1837160)
Backed out changeset c5d54bc3ee26 (bug 1839389)
Backed out changeset b232ec1bbc2d (bug 1833654)
Backed out changeset fc7ba125c2fe (bug 1833654)
Backed out changeset 8a47f6882e61 (bug 1823953)
Backed out changeset e29810541b53 (bug 1828912)
Backed out changeset bcf10730c8c9 (bug 1828912)
Backed out changeset 8df8290b6c33 (bug 1826382)
Backed out changeset 2811d12803cf (bug 1826382)
Backed out changeset 3fc718561ec9 (bug 1826382)
Backed out changeset 7827183776e1 (bug 1823953)
Backed out changeset a3eb5f228d9a (bug 1826382)
Backed out changeset 3113ad2e0987 (bug 1823953)
Backed out changeset 4b1dc01525af (bug 1823953)
Backed out changeset f7f4a7585ceb (bug 1823953)
Backed out changeset 93042f1becec (bug 1823953)
Backed out changeset b9ca30a0a066 (bug 1823953)
Backed out changeset 1000c4a6a92a (bug 1823953)
Backed out changeset 05dc13775fd6 (bug 1823953)
2023-08-01 09:37:39 -04:00
Paul Adenot
dc3ade886c Bug 1823953 - Adjust utility process tests: the expected decoders are now ffmpeg. r=gerard-majax DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D182369
2023-08-01 12:41:15 +00:00
Iulian Moraru
f8b5b0e9dc Backed out 3 changesets (bug 1845144) for causing py3 failures on test_toolchain_configure.py. CLOSED TREE
Backed out changeset 5168c7b1cf04 (bug 1845144)
Backed out changeset 6afda17fe413 (bug 1845144)
Backed out changeset d233c63f8121 (bug 1845144)
2023-08-01 06:06:53 +03:00
Brad Werth
4280325241 Bug 1845144 Part 2: Remove macOS available and builtin_available directives for always-supported versions of macOS. r=mac-reviewers,mstange,keeler
This also does minimal refactoring of cases where the directives were
protecting a simple expression that could be refactored back to the
callers.

Differential Revision: https://phabricator.services.mozilla.com/D184399
2023-07-31 22:18:09 +00:00
Tom Schuster
ed711958ea Bug 1627263 - Propagate nonce attribute from Link header preloads to loaders. r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D183968
2023-07-31 14:49:57 +00:00
Masatoshi Kimura
1518105f40 Bug 1844908 - Remove pre-Win10-specific codepath from ipc/. r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D184295
2023-07-26 08:52:51 +00:00
Natalia Csoregi
72a7b95555 Backed out 19 changesets (bug 1844908) for causing win bustage on AvailableMemoryTracker.cpp. CLOSED TREE
Backed out changeset 44c66f2233cf (bug 1844908)
Backed out changeset a8010ff534bf (bug 1844908)
Backed out changeset 225dc3aeb220 (bug 1844908)
Backed out changeset a1414db64e33 (bug 1844908)
Backed out changeset 7f1e0a527839 (bug 1844908)
Backed out changeset 6dc7646d1ffa (bug 1844908)
Backed out changeset 8d715131510f (bug 1844908)
Backed out changeset 4b6fe8a4e7db (bug 1844908)
Backed out changeset 2b419fabf1e8 (bug 1844908)
Backed out changeset af84e701d616 (bug 1844908)
Backed out changeset 2fa203969ec5 (bug 1844908)
Backed out changeset 2b3d2df94db3 (bug 1844908)
Backed out changeset 7eca452f5fd7 (bug 1844908)
Backed out changeset 3d961cf25afe (bug 1844908)
Backed out changeset 3c59143f8dd7 (bug 1844908)
Backed out changeset ab50c6c5425a (bug 1844908)
Backed out changeset b2c5636df673 (bug 1844908)
Backed out changeset e9a0f1c6760c (bug 1844908)
Backed out changeset 945ccbedde0b (bug 1844908)
2023-07-25 19:55:35 +03:00
Masatoshi Kimura
83598950c1 Bug 1844908 - Remove pre-Win10-specific codepath from ipc/. r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D184295
2023-07-25 14:41:02 +00:00
Alexandre Lissy
ef97fd6a47 Bug 1844922 - Use getExtraKey() for proper telemetry validation r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D184322
2023-07-24 09:22:00 +00:00
Alexandre Lissy
6599b6b882 Bug 1844284 - Add utility audio decoding telemetry for EME r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D183978
2023-07-21 08:28:32 +00:00
Nika Layzell
aa962084cc Bug 1454808 - Remove SharedMemoryBasic_android, r=jld
The special handling for android is in chromium's SharedMemory type,
meaning we can use SharedMemoryBasic_chromium now on Android.

This patch removes the android special casing to use the chromium
backend on that platform as well.

Differential Revision: https://phabricator.services.mozilla.com/D182808
2023-07-20 20:23:41 +00:00
Masatoshi Kimura
181d1d2914 Bug 1844257 - Remove ipc/glue/LibrarySandboxPreload.(cpp|h). r=glandium
They are leftovers from bug 1572618 and bug 1737733.

Differential Revision: https://phabricator.services.mozilla.com/D183973
2023-07-19 23:29:19 +00:00
Benjamin VanderSloot
19ec221a97 Bug 1805860 - Remove navigator.permissions.revoke dead code - r=anti-tracking-reviewers,ipc-reviewers,webidl,saschanaz,mccr8,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D182242
2023-07-19 14:51:11 +00:00
Stanca Serban
9e82c693d0 Backed out 8 changesets (bug 1805860, bug 1733556) for causing bp-nu bustages in StorageAccessAPIHelper.cpp.
Backed out changeset fa21a55ce837 (bug 1733556)
Backed out changeset 6c09379cdb5a (bug 1733556)
Backed out changeset d8c19265b981 (bug 1733556)
Backed out changeset d48d415fca83 (bug 1805860)
Backed out changeset 3acd0ba1dba6 (bug 1805860)
Backed out changeset d2a6174bbb14 (bug 1805860)
Backed out changeset 48558ba49efe (bug 1805860)
Backed out changeset c8693b9449d3 (bug 1805860)
2023-07-18 23:39:08 +03:00
Benjamin VanderSloot
0530069978 Bug 1805860 - Remove navigator.permissions.revoke dead code - r=anti-tracking-reviewers,ipc-reviewers,webidl,saschanaz,mccr8,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D182242
2023-07-18 19:14:30 +00:00
Alexandre Lissy
eccd396194 Bug 1843020 - Re-enable Win32k Lockdown for Utility WMF r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D183861
2023-07-18 13:19:32 +00:00
Nika Layzell
bf04b0d8de Bug 1840974 - Part 3: Make sure otherpid is set if known on IPC::Channel, r=ipc-reviewers,jld
This improves the quality of the logging from IPC::Channel, and also
adds extra assertions to ensure that it's aligned with the values
sent/received in the HELLO message.

This patch also makes the other_pid type more consistent, using
base::ProcessId instead of int32_t in IPC::Channel.

Differential Revision: https://phabricator.services.mozilla.com/D183410
2023-07-17 20:32:09 +00:00
Nika Layzell
df80b1cacb Bug 1840974 - Part 2: Silence spurious IPC channel errors on Windows, r=ipc-reviewers,jld
There were a few types of errors which could spuriously happen on Windows, and
are being fixed by this patch. The `ERROR_NO_DATA` error is now being silenced
similar to `ERROR_BROKEN_PIPE`. This appears to happen in some specific
edge-cases around the pipe's lifecycle, such as when the pipe has been created
and then destroyed, but no data has been sent yet.

This patch also silences errors when transferring or accepting handles if
`DuplicateHandle` fails due to the target process terminating. In this
situation, `DuplicateHandle` returns `ERROR_ACCESS_DENIED`, which is
unfortunately ambiguous. To avoid that ambiguity, this patch takes the same
approach as Chromium, and uses the `RtlGetLastNtStatus` function from ntdll to
get the true error status, and compare it to `STATUS_PROCESS_IS_TERMINATING`.
This matches the behaviour in Chromium to silence the same error.

Differential Revision: https://phabricator.services.mozilla.com/D183409
2023-07-17 20:32:09 +00:00
Nika Layzell
8b0181289a Bug 1840974 - Part 1: Improve ipc_channel_win HANDLE transfer errors, r=ipc-reviewers,mccr8
Previously these logs would produce misleading errors due to the HANDLE being
duplicated having been clobbered by the failed DuplicateHandle call. This patch
changes them to include more information in the error log, and makes the error
logs more accurate.

Differential Revision: https://phabricator.services.mozilla.com/D183408
2023-07-17 20:32:09 +00:00
kriswright
51331a8ca5 Bug 1834629 - Set main thread QoS Priority from another thread. r=mccr8
This bug uses the existing process hang messaging infrastructure to raise priorities on main threads. To ensure reduced latency, we also increase the priority of ProcessHangMon threads. We also address an edge-case bug where flipping the QoS prefs during use might lead to a tab getting stuck at the wrong priority.

Due to increasing the priority of the hang monitor thread, we may see some increase in its utilization on MacOS during high CPU load. I'm not sure the extent of how this may impact the browser, but as it makes the thread "faster" it may be more responsive than some other threads during this case.

I tested thread responsiveness by using the stress tool and dispatching various numbers of worker threads, up to 250. During these tests, even when other parts of firefox were less responsive under stress, tab switching appeared to remain snappy and responsive.

I captured some updated power profiles using the change. Profile where pref flipped off during use: https://share.firefox.dev/46BksO3 (Note that we start with the prefs on, then we flip off the prefs half way and repeat the same behavior to observe the fix to the previous bug that left tabs trapped in the background)

Profile with the pref fully enabled: https://share.firefox.dev/46EBIC7

In regards to the edge case, to avoid spurious tab wakeups, we won't reinstate normal thread priority when pref is disabled until the tab is interacted with again.

Differential Revision: https://phabricator.services.mozilla.com/D182787
2023-07-14 16:13:00 +00:00
Narcis Beleuzu
060e6a5a23 Backed out changeset 70e3969301b9 (bug 1834629) for bustages on ProcessHangMonitor.cpp . CLOSED TREE 2023-07-13 21:00:46 +03:00
kriswright
e6c30dd889 Bug 1834629 - Set main thread QoS Priority from another thread. r=mccr8
This bug uses the existing process hang messaging infrastructure to raise priorities on main threads. To ensure reduced latency, we also increase the priority of ProcessHangMon threads. We also address an edge-case bug where flipping the QoS prefs during use might lead to a tab getting stuck at the wrong priority.

Due to increasing the priority of the hang monitor thread, we may see some increase in its utilization on MacOS during high CPU load. I'm not sure the extent of how this may impact the browser, but as it makes the thread "faster" it may be more responsive than some other threads during this case.

I tested thread responsiveness by using the stress tool and dispatching various numbers of worker threads, up to 250. During these tests, even when other parts of firefox were less responsive under stress, tab switching appeared to remain snappy and responsive.

I captured some updated power profiles using the change. Profile where pref flipped off during use: https://share.firefox.dev/46BksO3 (Note that we start with the prefs on, then we flip off the prefs half way and repeat the same behavior to observe the fix to the previous bug that left tabs trapped in the background)

Profile with the pref fully enabled: https://share.firefox.dev/46EBIC7

In regards to the edge case, to avoid spurious tab wakeups, we won't reinstate normal thread priority when pref is disabled until the tab is interacted with again.

Differential Revision: https://phabricator.services.mozilla.com/D182787
2023-07-13 15:44:03 +00:00
Jan Varga
29600e3ad5 Bug 1840770 - Move PQuotaParent implementation to separate source files; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D182307
2023-07-13 09:57:18 +00:00
Kagami Sascha Rosylight
b65d4356c8 Bug 1842825 - Split new Observer() outside of ipc::UtilityProcessManager r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D183260
2023-07-12 13:44:32 +00:00
serge-sans-paille
34f4a08400 Bug 1841085 - Aggregate scalar reading code in ipc pickling r=handyman,jld
Differential Revision: https://phabricator.services.mozilla.com/D182472
2023-07-06 07:20:23 +00:00
Kagami Sascha Rosylight
b46a392d48 Bug 1798493 - Part 1: Use nsIPrincipal instead of ContentPrincipalInfo for PLockManager r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D163337
2023-06-28 20:48:14 +00:00
Nika Layzell
4e0633ce16 Bug 1838906 - Part 4: Don't require a listener in IPC::Channel until Connect, r=ipc-reviewers,jld
Depends on D181803

Differential Revision: https://phabricator.services.mozilla.com/D182225
2023-06-27 19:59:47 +00:00
Nika Layzell
1a1cb945e4 Bug 1838906 - Part 3: Clean up ConnectNamedPipe logic, r=ipc-reviewers,jld
This call is no longer required after the other changes in part 1 and 2,
and adds substantial complexity to the type. This just removes all of
the ConnectNamedPipe handling logic from ipc_channel_win now that it is
unnecessary.

Differential Revision: https://phabricator.services.mozilla.com/D181803
2023-06-27 19:59:47 +00:00
Nika Layzell
4a72a442c0 Bug 1838906 - Part 2: Simplify the types for IPC::Channel::Listener, r=ipc-reviewers,necko-reviewers,kershaw,jld
Now that we've simplified the startup process somewhat, it is easier to clean
up IPC channel creation for NodeChannel connections. This stops having
GeckoChildProcessHost inherit from IPC::Channel::Listener, as it would never
receive most of the relevant callbacks, and instead implements the one callback
it would receive directly as a method on that type.

Differential Revision: https://phabricator.services.mozilla.com/D181282
2023-06-27 19:59:47 +00:00
Nika Layzell
18d0bf2094 Bug 1838906 - Part 1: Inherit the initial process pipe on Windows, r=bobowen,ipc-reviewers,jld
This allows simplifying how IPC::Channel is created and passed between
processes, as all platforms now inherit the initial handle/fd into the content
process in a similar way. To keep things simple for now, I've continued to use
the base::CommandLine class to pass the HANDLE's identity on Windows, however
we may want to change this to make it a bit easier to follow, perhaps treating
it more like how we handle the IPC fd on Android.

Differential Revision: https://phabricator.services.mozilla.com/D181281
2023-06-27 19:59:46 +00:00
sotaro
50ab537300 Bug 1839314 - Force sync IPC if there are many flushed cmds without calling ClientWebGLContext::GetFrontBuffer() r=ipc-reviewers,nika,gfx-reviewers,lsalzman
There were cases that a lot of cmds messages were sent by WebGLChild::FlushPendingCmds() without calling ClientWebGLContext::GetFrontBuffer(). And the IPC messages were waiting to be handled by WebGLParent, since OpenGL handling could take longer. Then there were cases that pending IPC messages were accumulated and it caused out of file descriptor on Linux. The sync IPC could reduce the pending IPC messages if there are a lot of cmds flashes.

async Ping is used for checking if IPC message is congested at WebGLParent. If a count of flushes since last congestion check reaches maybeIPCMessageCongestion, we think that IPC message is congested at WebGLParent. Then send sync SyncPing message to flush pending IPC messages.

Differential Revision: https://phabricator.services.mozilla.com/D181484
2023-06-27 18:23:41 +00:00
Alexandre Lissy
a9ee883ccf Bug 1839834 - Allow per-sandbox disabling on Utility r=jld
Differential Revision: https://phabricator.services.mozilla.com/D181782
2023-06-27 13:10:14 +00:00
James Teh
d762f87c52 Bug 1831035 part 2: Remove DocAccessibleChild::RecvAddToSelection. r=eeejay,ipc-reviewers,mccr8
The sync IPDL RemoteAccessible::AddToSelection was removed in bug 1811092, but the DocAccessibleChildBase method remained.
This is no longer used, so remove it.

Differential Revision: https://phabricator.services.mozilla.com/D181937
2023-06-26 21:20:12 +00:00
James Teh
aecc1ba54a Bug 1831035 part 1: Remove PDocAccessible::SyncTextChangeEvent. r=nlapre,ipc-reviewers,mccr8
I neglected to remove this in bug 1821956.

Differential Revision: https://phabricator.services.mozilla.com/D181847
2023-06-26 21:20:12 +00:00
Norisz Fay
53d9f9072c Backed out changeset 38a62f7736e9 (bug 1839834) for causing sandboxing related Gtest failures CLOSED TREE 2023-06-26 20:04:59 +03:00
Alexandre Lissy
be3bdb474b Bug 1839834 - Allow per-sandbox disabling on Utility r=jld
Differential Revision: https://phabricator.services.mozilla.com/D181782
2023-06-26 14:47:33 +00:00
serge-sans-paille
ab13de4ec4 Bug 1839325 - Add missing header dependency on mozilla/PSandboxTestingChild.h r=bobowen,necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D181446
2023-06-22 12:40:14 +00:00
Ray Kraesig
1444f17712 Bug 1836349 - [3/3] Restrict IPCResult not to accept nonconstant strings r=nika,ipc-reviewers
Text passed to `IPCResult::Fail` (and, therefore, text passed to
`IPC_FAIL`) may end up in telemetry.

To avoid accidentally capturing unwanted information, restrict all such
text to compile-time constant strings, unless approved by data-review.

Differential Revision: https://phabricator.services.mozilla.com/D180152
2023-06-21 20:54:48 +00:00
Eitan Isaacson
b3cea24dfd Bug 1834874 - P2: Remove DocAccessiblePlatformExt. r=Jamie,ipc-reviewers,mccr8
Since we removed the last dependency on this subprotocol, we can now
remove it.

Differential Revision: https://phabricator.services.mozilla.com/D181321
2023-06-20 18:15:43 +00:00
Alexandre Lissy
7f2d2bf247 Bug 1835804 - Completely block from doing audio decoding on Content and RDD r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D179699
2023-06-20 17:23:23 +00:00
Alexandre Lissy
593b2bd6f1 Bug 1832020 - Allow 60s IPC timeout for gtest r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D181196
2023-06-20 03:57:41 +00:00
Cristian Tuns
78718dabb9 Backed out changeset 3cf2e1c625e4 (bug 1835804) for causing Bug 1839021 and Bug 1838931 CLOSED TREE 2023-06-17 11:38:40 -04:00
Emilio Cobos Álvarez
cea323d30e Bug 1837816 - Make selector cache not tied to a document. r=media-playback-reviewers,karlt,mstange
It doesn't really need to.

Differential Revision: https://phabricator.services.mozilla.com/D180591
2023-06-16 17:20:42 +00:00
Alexandre Lissy
63186bc601 Bug 1835804 - Completely block from doing audio decoding on Content and RDD r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D179699
2023-06-16 15:38:55 +00:00
Stanca Serban
0c0327ae6a Backed out changeset f4f3e84e7e15 (bug 1835804) for win64-nightlyasrelease opt related Bpgo build bustages in PDMFactory.cpp. 2023-06-16 13:27:29 +03:00
Alexandre Lissy
ad0bf399e0 Bug 1835804 - Completely block from doing audio decoding on Content and RDD r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D179699
2023-06-16 08:24:23 +00:00
Cosmin Sabou
43ffe0d010 Backed out 2 changesets (bug 1798493) for causing wpt failures on partitioned-web-locks.tentative.https.html CLOSED TREE
Backed out changeset c8c8ab2aa130 (bug 1798493)
Backed out changeset f65876226f15 (bug 1798493)
2023-06-16 01:22:54 +03:00
Kagami Sascha Rosylight
60521aa51a Bug 1798493 - Part 1: Use nsIPrincipal instead of ContentPrincipalInfo for PLockManager r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D163337
2023-06-15 19:25:54 +00:00
Jan Grulich
4715b5a927 Bug 1724900: Add PipeWire camera support r=pehrsons,ipc-reviewers,nika
Adds a PipeWire based camera support that was recently merged into
WebRTC. This should be an experimental feature for now and therefore it
is kept behind a config option.

Differential Revision: https://phabricator.services.mozilla.com/D176625
2023-06-15 12:41:55 +00:00
Natalia Csoregi
eebccccb89 Backed out 4 changesets (bug 1724900) for causing crashes on getUserMedia-audio. CLOSED TREE
Backed out changeset b94558d76bd2 (bug 1724900)
Backed out changeset 8ac9e05de573 (bug 1724900)
Backed out changeset 8ebb0f9ec0ae (bug 1724900)
Backed out changeset 241d7632685a (bug 1724900)
2023-06-15 13:19:47 +03:00
Jan Grulich
527c5c1a21 Bug 1724900: Add PipeWire camera support r=pehrsons,ipc-reviewers,nika
Adds a PipeWire based camera support that was recently merged into
WebRTC. This should be an experimental feature for now and therefore it
is kept behind a config option.

Differential Revision: https://phabricator.services.mozilla.com/D176625
2023-06-15 09:13:27 +00:00
Cristian Tuns
2e0d92db58 Backed out changeset ebe58b0d7ffc (bug 1835804) for causing multiple failures on Android 7.0 with crash @ libxul.so CLOSED TREE 2023-06-14 18:20:08 -04:00
Alexandre Lissy
b355e9646c Bug 1835804 - Completely block from doing audio decoding on Content and RDD r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D179699
2023-06-14 20:22:52 +00:00
Sylvestre Ledru
74418cbde1 no bug - doc: Fix some lexical issue r=marco,devtools-reviewers DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D179308
2023-06-12 14:54:49 +00:00
Tom Schuster
f8f27474c3 Bug 1409200 - Add integrityMetadata to nsILoadInfo. r=freddyb,necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D179822
2023-06-09 18:39:59 +00:00
Norisz Fay
ceef84983b Backed out 3 changesets (bug 1409200) as requested by dev
Backed out changeset ea10214aa35f (bug 1409200)
Backed out changeset a66ea7d7f812 (bug 1409200)
Backed out changeset e8a83b1e7e08 (bug 1409200)
2023-06-09 15:11:48 +03:00
Tooru Fujisawa
b87b4a2527 Bug 1826106 - Use JS::FrontendContext in Utility Process. r=sefeng
Differential Revision: https://phabricator.services.mozilla.com/D179430
2023-06-09 11:08:58 +00:00
Bob Owen
18e588031f Bug 1821440: If process is in an app container, add the container SID to the COM ACL. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D180207
2023-06-09 10:41:07 +00:00
Tom Schuster
789a99b940 Bug 1409200 - Add integrityMetadata to nsILoadInfo. r=freddyb,necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D179822
2023-06-09 07:52:49 +00:00
Nika Layzell
fb140add17 Bug 1835647 - Switch FatalError to asynchronously report channel errors under fuzzing, r=ipc-reviewers,mccr8
This should avoid potential fuzzing-only issues which would be caused by
the actor being torn down synchronously after a FatalError or KillHard.
Instead, the state is set to error synchronously, blocking all further
message sending/receiving, and the notification is made async, similar
to how it is handled for normal channel errors.

Differential Revision: https://phabricator.services.mozilla.com/D180254
2023-06-08 23:09:19 +00:00
Andrew McCreight
6869dc0a66 Bug 1836989 - Rename the hacky string conversion function in ipc/glue/StringUtil.cpp. r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D180095
2023-06-07 13:20:08 +00:00
Gabriele Svelto
4b039f20f2 Bug 1776197 - Remove the old IPC channel used for retrieving annotations and all related machinery r=geckoview-reviewers,afranchuk,owlish
Depends on D173699

Differential Revision: https://phabricator.services.mozilla.com/D173700
2023-06-07 12:34:31 +00:00
Mike Hommey
c72ed0e448 Bug 1835185 - Adjust preprocessor conditions knowing that XP_WIN and XP_UNIX are mutually exclusive. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D180137
2023-06-06 21:05:37 +00:00
Mike Hommey
285d1dfbd8 Bug 1835185 - Stop setting OS_* macros from the build system. r=ipc-reviewers,mccr8
Now that the ipc code doesn't use the OS_* macros, we don't need to set
them for most everything.

Differential Revision: https://phabricator.services.mozilla.com/D180056
2023-06-06 21:05:36 +00:00
Mike Hommey
3a281b3787 Bug 1835185 - Remove build_config.h from ipc code. r=ipc-reviewers,mccr8
It is, in fact, pulled instead of security/sandbox/chromium's when
building the sandbox, because the ipc code is used virtually everywhere.
We're better off with one less copy of the file, especially in such
ubiquitous code.

Incidentally, the sandbox code also needed ipc's for its use of
EnvironmentMap.h, which now doesn't require it.

Differential Revision: https://phabricator.services.mozilla.com/D180055
2023-06-06 21:05:36 +00:00
Mike Hommey
75e6a18851 Bug 1835185 - Replace WCHAR_T_IS_UTF* with checks on XP_WIN in ipc code. r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D180054
2023-06-06 21:05:36 +00:00
Mike Hommey
cf61902bf4 Bug 1835185 - Replace ARCH_CPU_ARM64 with __aarch64__ in ipc code. r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D180053
2023-06-06 21:05:35 +00:00
Mike Hommey
d2da9c1907 Bug 1835185 - Replace ARCH_CPU_64_BITS with HAVE_64BIT_BUILD in ipc code. r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D180052
2023-06-06 21:05:35 +00:00
Mike Hommey
a9b1e3bb63 Bug 1835185 - Replace COMPILER_* with equivalent macros in ipc code. r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D180051
2023-06-06 21:05:34 +00:00
Mike Hommey
1cfa6935e2 Bug 1835185 - Remove NaCl support code. r=ipc-reviewers,mccr8
It's not a supported target.

Differential Revision: https://phabricator.services.mozilla.com/D180050
2023-06-06 21:05:34 +00:00
Mike Hommey
6195df0b79 Bug 1835185 - Replace OS_*BSD with equivalent macros in ipc code. r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D180049
2023-06-06 21:05:34 +00:00
Mike Hommey
55ec63d832 Bug 1835185 - Replace OS_SOLARIS with XP_SOLARIS in ipc code. r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D180048
2023-06-06 21:05:33 +00:00
Mike Hommey
ae2a3b3bff Bug 1835185 - Replace OS_ANDROID with ANDROID in ipc code. r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D180047
2023-06-06 21:05:33 +00:00
Mike Hommey
177e38422c Bug 1835185 - Replace OS_LINUX with XP_LINUX in ipc code. r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D180046
2023-06-06 21:05:32 +00:00
Mike Hommey
1a1da788c7 Bug 1835185 - Replace OS_MACOSX with XP_DARWIN in ipc code. r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D180045
2023-06-06 21:05:32 +00:00