Commit Graph
122 Commits
Author SHA1 Message Date
Andrew Osmond c12babe4ca Bug 2035602 - Annotate GPUProcessManager::MaybeCrashIfGpuProcessOnceStable as OOM crash if GPU process OOMed. r=gfx-reviewers,lsalzman,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D297124
2026-04-28 22:38:05 +00:00
Andrew Osmond b606d1c9a9 Bug 2028606 - Log GPU process launch error details in the gfx critical log. r=gfx-reviewers,jrmuizel
This will help debug launch failures, which is the top reason why we
lose the GPU process on Windows and Android.

Differential Revision: https://phabricator.services.mozilla.com/D291571
2026-04-01 20:41:17 +00:00
Sylvestre Ledru e1fe74e9e3 Bug 2023419 - Remove Emacs/Vim modelines from gfx/ r=emilio
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287846
2026-03-16 12:52:50 +00:00
Jamie Nicol 1d4569b701 Bug 2002422 - Fix liveToken usage in GPUProcessHost. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D274103
2025-11-26 13:56:53 +00:00
Jamie Nicol 55acbeb41c Bug 1960922 - Obtain reference to CompositorSurfaceManager asynchronously. r=aosmond
GPUProcessHost must obtain a reference to the GPU process'
CompositorSurfaceManager, which requires a round-trip to the IPC
launcher thread in order to interact with GeckoProcessManager.
Currently this is achieved using a synchronous task, which has the
downside of blocking the main thread during startup.

This patch attempts to obtain the reference asynchronously, by
scheduling a task to run on the IPC launcher thread to obtain the
reference from GeckoSurfaceManager, then another back on the main
thread to initialize GPUProcessHost's member variable.

If GPUProcessHost::WaitForLaunch() is called prior to the async
initialization completing, we fall back to the synchronous task
approach.

Differential Revision: https://phabricator.services.mozilla.com/D272309
2025-11-18 19:38:15 +00:00
Jamie Nicol 01601ac352 Bug 1999645 - Avoid synchronous GPUChild::SendGetDeviceStatus after GPU process channel is connected asynchronously. r=aosmond
In the case where the GPU process channel is connected asynchronously
we unfortunately send a synchronous GPUChild::SendGetDeviceStatus()
message immediately afterwards. This is a regression from bug 1993758,
which added a call to GPUChild::EnsureGPUReady() to
GPUProcessManager::OnProcessLaunchComplete(). Ideally we'd like to
avoid using this synchronous message unless required, and instead
allow time for the asynchronous Init()/InitComplete() callback to
complete.

This patch achieves just that by delaying calling the listener's
OnProcessLaunchComplete() callback until after the post-connection
initialization is complete, rather than immediately after the channel
has connected. This means that by the time the GPUProcessManager calls
EnsureGPUReady(), initialization will have already completed.

A new "Connected" LaunchPhase is added prior to "Complete", indicating
that the channel has been connected but post-connection initialization
has not yet completed. Upon connection we start asynchronous
initialization as before, but now track its completion using a Promise
and call OnProcessLaunchComplete when that resolves.

As before, if GPUProcessManager requires the launch to complete
synchronously it calls GPUProcessHost::WaitForLaunch(). This will now
additionally ensure initialization has completed prior to returning by
sending the synchronous SendGetDeviceData message.

Differential Revision: https://phabricator.services.mozilla.com/D272308
2025-11-18 19:38:13 +00:00
Jamie Nicol 76bd5afb87 Bug 1999645 - Use live token instead of ipc::TaskFactory in GPUProcessHost. r=aosmond
To ensure tasks dispatched between threads in GPUProcessHost do not
run after the GPU process has been destroyed we currently use
ipc::TaskFactory, which allows us to revoke pending tasks on
shutdown.

This patch switches to using a refcounted "live token" and checking
whether the process is still live before doing any work in the
task. This is the same approach used in the RDD and Utility processes.

This should have no functional change, but will allow subsequent
patches to ensure the process is still live when executing promise
callbacks.

Additionally removes the unused OnChannelErrorTask() function.

Differential Revision: https://phabricator.services.mozilla.com/D272307
2025-11-18 19:38:12 +00:00
Atila Butkovits 76a3351007 Revert "Bug 1960922, Bug 1999645 - Obtain reference to CompositorSurfaceManager asynchronously. r=aosmond" for causing bustages.
This reverts commit 8b91e5ff50.

Revert "Bug 1999645 - Avoid synchronous GPUChild::SendGetDeviceStatus after GPU process channel is connected asynchronously. r=aosmond"

This reverts commit b535b81d7c.

Revert "Bug 1999645 - Use live token instead of ipc::TaskFactory in GPUProcessHost. r=aosmond"

This reverts commit 6d17a0731b.
2025-11-18 18:59:13 +00:00
Jamie Nicol 8b91e5ff50 Bug 1960922 - Obtain reference to CompositorSurfaceManager asynchronously. r=aosmond
GPUProcessHost must obtain a reference to the GPU process'
CompositorSurfaceManager, which requires a round-trip to the IPC
launcher thread in order to interact with GeckoProcessManager.
Currently this is achieved using a synchronous task, which has the
downside of blocking the main thread during startup.

This patch attempts to obtain the reference asynchronously, by
scheduling a task to run on the IPC launcher thread to obtain the
reference from GeckoSurfaceManager, then another back on the main
thread to initialize GPUProcessHost's member variable.

If GPUProcessHost::WaitForLaunch() is called prior to the async
initialization completing, we fall back to the synchronous task
approach.

Differential Revision: https://phabricator.services.mozilla.com/D272309
2025-11-18 18:45:33 +00:00
Jamie Nicol b535b81d7c Bug 1999645 - Avoid synchronous GPUChild::SendGetDeviceStatus after GPU process channel is connected asynchronously. r=aosmond
In the case where the GPU process channel is connected asynchronously
we unfortunately send a synchronous GPUChild::SendGetDeviceStatus()
message immediately afterwards. This is a regression from bug 1993758,
which added a call to GPUChild::EnsureGPUReady() to
GPUProcessManager::OnProcessLaunchComplete(). Ideally we'd like to
avoid using this synchronous message unless required, and instead
allow time for the asynchronous Init()/InitComplete() callback to
complete.

This patch achieves just that by delaying calling the listener's
OnProcessLaunchComplete() callback until after the post-connection
initialization is complete, rather than immediately after the channel
has connected. This means that by the time the GPUProcessManager calls
EnsureGPUReady(), initialization will have already completed.

A new "Connected" LaunchPhase is added prior to "Complete", indicating
that the channel has been connected but post-connection initialization
has not yet completed. Upon connection we start asynchronous
initialization as before, but now track its completion using a Promise
and call OnProcessLaunchComplete when that resolves.

As before, if GPUProcessManager requires the launch to complete
synchronously it calls GPUProcessHost::WaitForLaunch(). This will now
additionally ensure initialization has completed prior to returning by
sending the synchronous SendGetDeviceData message.

Differential Revision: https://phabricator.services.mozilla.com/D272308
2025-11-18 18:45:30 +00:00
Jamie Nicol 6d17a0731b Bug 1999645 - Use live token instead of ipc::TaskFactory in GPUProcessHost. r=aosmond
To ensure tasks dispatched between threads in GPUProcessHost do not
run after the GPU process has been destroyed we currently use
ipc::TaskFactory, which allows us to revoke pending tasks on
shutdown.

This patch switches to using a refcounted "live token" and checking
whether the process is still live before doing any work in the
task. This is the same approach used in the RDD and Utility processes.

This should have no functional change, but will allow subsequent
patches to ensure the process is still live when executing promise
callbacks.

Additionally removes the unused OnChannelErrorTask() function.

Differential Revision: https://phabricator.services.mozilla.com/D272307
2025-11-18 18:45:27 +00:00
Narcis Beleuzu 5331201d17 Revert "Bug 1960922 - Obtain reference to CompositorSurfaceManager asynchronously. r=aosmond" for causing Bug 1993818
This reverts commit 3ef34f13f0.

This reverts commit 4d93b3cafc.

This reverts commit 7ee10d8ccf.
2025-11-17 10:19:22 +00:00
Jamie Nicol 3ef34f13f0 Bug 1960922 - Obtain reference to CompositorSurfaceManager asynchronously. r=aosmond
GPUProcessHost must obtain a reference to the GPU process'
CompositorSurfaceManager, which requires a round-trip to the IPC
launcher thread in order to interact with GeckoProcessManager.
Currently this is achieved using a synchronous task, which has the
downside of blocking the main thread during startup.

This patch attempts to obtain the reference asynchronously, by
scheduling a task to run on the IPC launcher thread to obtain the
reference from GeckoSurfaceManager, then another back on the main
thread to initialize GPUProcessHost's member variable.

If GPUProcessHost::WaitForLaunch() is called prior to the async
initialization completing, we fall back to the synchronous task
approach.

Differential Revision: https://phabricator.services.mozilla.com/D272309
2025-11-14 10:50:00 +00:00
Jamie Nicol 4d93b3cafc Bug 1999645 - Avoid synchronous GPUChild::SendGetDeviceStatus after GPU process channel is connected asynchronously. r=aosmond
In the case where the GPU process channel is connected asynchronously
we unfortunately send a synchronous GPUChild::SendGetDeviceStatus()
message immediately afterwards. This is a regression from bug 1993758,
which added a call to GPUChild::EnsureGPUReady() to
GPUProcessManager::OnProcessLaunchComplete(). Ideally we'd like to
avoid using this synchronous message unless required, and instead
allow time for the asynchronous Init()/InitComplete() callback to
complete.

This patch achieves just that by delaying calling the listener's
OnProcessLaunchComplete() callback until after the post-connection
initialization is complete, rather than immediately after the channel
has connected. This means that by the time the GPUProcessManager calls
EnsureGPUReady(), initialization will have already completed.

A new "Connected" LaunchPhase is added prior to "Complete", indicating
that the channel has been connected but post-connection initialization
has not yet completed. Upon connection we start asynchronous
initialization as before, but now track its completion using a Promise
and call OnProcessLaunchComplete when that resolves.

As before, if GPUProcessManager requires the launch to complete
synchronously it calls GPUProcessHost::WaitForLaunch(). This will now
additionally ensure initialization has completed prior to returning by
sending the synchronous SendGetDeviceData message.

Differential Revision: https://phabricator.services.mozilla.com/D272308
2025-11-14 10:49:57 +00:00
Jamie Nicol 7ee10d8ccf Bug 1999645 - Use live token instead of ipc::TaskFactory in GPUProcessHost. r=aosmond
To ensure tasks dispatched between threads in GPUProcessHost do not
run after the GPU process has been destroyed we currently use
ipc::TaskFactory, which allows us to revoke pending tasks on
shutdown.

This patch switches to using a refcounted "live token" and checking
whether the process is still live before doing any work in the
task. This is the same approach used in the RDD and Utility processes.

This should have no functional change, but will allow subsequent
patches to ensure the process is still live when executing promise
callbacks.

Additionally removes the unused OnChannelErrorTask() function.

Differential Revision: https://phabricator.services.mozilla.com/D272307
2025-11-14 10:49:55 +00:00
Haik Aftandilian 5c45ae74da Bug 1974546 - Enable sandboxing for the macOS GPU process r=mac-reviewers,gfx-reviewers,mstange,bradwerth
Add a sandbox profile for the macOS GPU process (which is pref'd off at this
time). By default, the sandbox will be enabled whenever the GPU process is
enabled.

The sandbox is enabled by the integer pref `security.sandbox.gpu.level` already
used on Windows. Any value > 0 enables the sandbox. For now, the implementation
does not have different levels and is either on or off.

The environment variable MOZ_SANDBOX_GPU_LOGGING can be used to enable sandbox
violation logging for only the GPU process in macOS log viewing tools (not
Firefox logs).

Includes a minimal sandboxing test exercised on debug builds to validate that
the sandbox gets started for the GPU process.

Differential Revision: https://phabricator.services.mozilla.com/D264685
2025-09-22 19:43:40 +00:00
Nika Layzell 12d5dea84d Bug 1440207 - Part 3a: Migrate GeckoChildProcessHost callers to use ChildProcessArgs, r=ipc-reviewers,necko-reviewers,media-playback-reviewers,aosmond,mccr8
This patch implements the majority of the public interface for the new IPC
handle passing design.

The rough design is an expansion of `geckoargs` to allow passing
`UniqueFileHandle` arguments to child processes. This replaces the existing
extra options array to make the list of files explicit.

This currently just replaces things which were already passed this way on the
command line from outside of GeckoChildProcessHost. Note that this does not
migrate callers which were not already passing file handles using geckoargs,
and does not implement the actual OS-level support for passing arguments this
way.

Differential Revision: https://phabricator.services.mozilla.com/D221371
2024-10-01 22:21:47 +00:00
Cristian Tuns ef799296b7 Backed out 13 changesets (bug 1440207) for causing multiple failures. CLOSED TREE
Backed out changeset c9f33dfc1cc5 (bug 1440207)
Backed out changeset 76d823a34925 (bug 1440207)
Backed out changeset 75a99142ee1c (bug 1440207)
Backed out changeset b4d283d3e8da (bug 1440207)
Backed out changeset ea81a08ce181 (bug 1440207)
Backed out changeset c581a4e8cd15 (bug 1440207)
Backed out changeset d13799a1dc26 (bug 1440207)
Backed out changeset 6d715586c911 (bug 1440207)
Backed out changeset 30ff6a4db1d0 (bug 1440207)
Backed out changeset 2da0bbfdfee5 (bug 1440207)
Backed out changeset f3445c3fdd5e (bug 1440207)
Backed out changeset 07fbed499fe4 (bug 1440207)
Backed out changeset 1c2ac609c466 (bug 1440207)
2024-09-24 19:10:35 -04:00
Nika Layzell 62686c41b3 Bug 1440207 - Part 3a: Migrate GeckoChildProcessHost callers to use ChildProcessArgs, r=ipc-reviewers,necko-reviewers,media-playback-reviewers,aosmond,mccr8
This patch implements the majority of the public interface for the new IPC
handle passing design.

The rough design is an expansion of `geckoargs` to allow passing
`UniqueFileHandle` arguments to child processes. This replaces the existing
extra options array to make the list of files explicit.

This currently just replaces things which were already passed this way on the
command line from outside of GeckoChildProcessHost. Note that this does not
migrate callers which were not already passing file handles using geckoargs,
and does not implement the actual OS-level support for passing arguments this
way.

Differential Revision: https://phabricator.services.mozilla.com/D221371
2024-09-24 19:28:09 +00:00
Jamie Nicol d96b82368a Bug 1880503 - Handle sync IPC timeout in UiCompositorControllerChild. r=aosmond
Extend the sync IPC timeout mechanism in CompositorManagerChild to
additionally cover UiCompositorControllerChild. As
UiCompositorControllerChild runs on the Android UI thread, we ensure
GPUProcessManager::KillProcess dispatches to the gecko main thread.

Along with the previous patch in this series this should provide us
with crash reports when the Android UI thread is hung waiting for the
GPU process to reply.

Differential Revision: https://phabricator.services.mozilla.com/D202167
2024-05-14 12:58:36 +00:00
Jamie Nicol e0b977ad39 Bug 1880503 - Generate paired minidump when GPU process is killed following IPC timeout. r=aosmond,gsvelto
When sync IPC under the top-level PCompositorManager protocol does not
reply within a certain time threshold we purposefully kill the GPU
process. While this allows the user to recover from a stuck GPU
process, we have little visibility about the underlying cause.

This patch makes it so that we generate a paired minidump for the GPU
and parent processes prior to killing the GPU process in
GPUProcessHost::KillHard(). The implementation roughly follows the
equivalent for content processes in ContentParent::KillHard().

As the GPU process can be purposefully killed during normal operation,
and because generating minidumps can be expensive, we are careful to
only do so when the new argument aGenerateMinidump is true. We
additionally remove the aReason argument as it is unused (and
currently innacurate in some places).

As these minidumps may not automatically submitted we limit the
minidumps generation to twice per session in order to avoid
accumulating a large number of unsubmitted minidumps on disk.

Differential Revision: https://phabricator.services.mozilla.com/D202166
2024-05-14 12:58:35 +00:00
Stanca Serban a160adf466 Backed out 3 changesets (bug 1880503) for causing build bustages in nsCOMPtr.h. CLOSED TREE
Backed out changeset 437063345a7b (bug 1880503)
Backed out changeset 9665aa5e821d (bug 1880503)
Backed out changeset 44d08ce97ae6 (bug 1880503)
2024-05-13 21:08:49 +03:00
Jamie Nicol 37d94d4a2d Bug 1880503 - Handle sync IPC timeout in UiCompositorControllerChild. r=aosmond
Extend the sync IPC timeout mechanism in CompositorManagerChild to
additionally cover UiCompositorControllerChild. As
UiCompositorControllerChild runs on the Android UI thread, we ensure
GPUProcessManager::KillProcess dispatches to the gecko main thread.

Along with the previous patch in this series this should provide us
with crash reports when the Android UI thread is hung waiting for the
GPU process to reply.

Differential Revision: https://phabricator.services.mozilla.com/D202167
2024-05-13 16:52:13 +00:00
Jamie Nicol c9d8189117 Bug 1880503 - Generate paired minidump when GPU process is killed following IPC timeout. r=aosmond,gsvelto
When sync IPC under the top-level PCompositorManager protocol does not
reply within a certain time threshold we purposefully kill the GPU
process. While this allows the user to recover from a stuck GPU
process, we have little visibility about the underlying cause.

This patch makes it so that we generate a paired minidump for the GPU
and parent processes prior to killing the GPU process in
GPUProcessHost::KillHard(). The implementation roughly follows the
equivalent for content processes in ContentParent::KillHard().

As the GPU process can be purposefully killed during normal operation,
and because generating minidumps can be expensive, we are careful to
only do so when the new argument aGenerateMinidump is true. We
additionally remove the aReason argument as it is unused (and
currently innacurate in some places).

As these minidumps may not automatically submitted we limit the
minidumps generation to twice per session in order to avoid
accumulating a large number of unsubmitted minidumps on disk.

Differential Revision: https://phabricator.services.mozilla.com/D202166
2024-05-13 16:52:12 +00:00
Natalia Csoregi f3ec5febcc Backed out 3 changesets (bug 1880503) for causing bustage on CrashReporterHost.h. CLOSED TREE
Backed out changeset 296455072556 (bug 1880503)
Backed out changeset 842611b8fcbc (bug 1880503)
Backed out changeset eae32f6ab26c (bug 1880503)
2024-04-30 18:26:00 +03:00
Jamie Nicol f4a26e487e Bug 1880503 - Handle sync IPC timeout in UiCompositorControllerChild. r=aosmond
Extend the sync IPC timeout mechanism in CompositorManagerChild to
additionally cover UiCompositorControllerChild. As
UiCompositorControllerChild runs on the Android UI thread, we ensure
GPUProcessManager::KillProcess dispatches to the gecko main thread.

Along with the previous patch in this series this should provide us
with crash reports when the Android UI thread is hung waiting for the
GPU process to reply.

Differential Revision: https://phabricator.services.mozilla.com/D202167
2024-04-30 15:06:21 +00:00
Jamie Nicol b3683a8b68 Bug 1880503 - Generate paired minidump when GPU process is killed following IPC timeout. r=aosmond,gsvelto
When sync IPC under the top-level PCompositorManager protocol does not
reply within a certain time threshold we purposefully kill the GPU
process. While this allows the user to recover from a stuck GPU
process, we have little visibility about the underlying cause.

This patch makes it so that we generate a paired minidump for the GPU
and parent processes prior to killing the GPU process in
GPUProcessHost::KillHard(). The implementation roughly follows the
equivalent for content processes in ContentParent::KillHard().

As the GPU process can be purposefully killed during normal operation,
and because generating minidumps can be expensive, we are careful to
only do so when the new argument aGenerateMinidump is true. We
additionally remove the aReason argument as it is unused (and
currently innacurate in some places).

As these minidumps may not automatically submitted we limit the
minidumps generation to twice per session in order to avoid
accumulating a large number of unsubmitted minidumps on disk.

Differential Revision: https://phabricator.services.mozilla.com/D202166
2024-04-30 15:06:21 +00:00
Nika Layzell 03663ac007 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 386058c120 Bug 1824465 - Part 8: Make PGPU refcounted, r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D173723
2023-04-19 22:10:08 +00:00
Noemi Erli ebdaf2bae0 Backed out 24 changesets (bug 1824465) for causing failures in nsISupportsImpl.cpp CLOSED TREE
Backed out changeset a5c8f22b7170 (bug 1824465)
Backed out changeset b551b655ac72 (bug 1824465)
Backed out changeset 0e6768a6419c (bug 1824465)
Backed out changeset fb115ebb7fe0 (bug 1824465)
Backed out changeset aaa7a2c8aa3b (bug 1824465)
Backed out changeset 7ef94bfa90b3 (bug 1824465)
Backed out changeset a4238fd6b86f (bug 1824465)
Backed out changeset 3a88e4cfbe45 (bug 1824465)
Backed out changeset 40c2467d3162 (bug 1824465)
Backed out changeset 8f900395c72c (bug 1824465)
Backed out changeset 92e4c6e4d73c (bug 1824465)
Backed out changeset 445c5d5d9661 (bug 1824465)
Backed out changeset de51ed5389d9 (bug 1824465)
Backed out changeset 72049d72bcb6 (bug 1824465)
Backed out changeset 126773c2427a (bug 1824465)
Backed out changeset 886e76bc80be (bug 1824465)
Backed out changeset a69a851411f0 (bug 1824465)
Backed out changeset 703599cf6189 (bug 1824465)
Backed out changeset 11ecb78ebc15 (bug 1824465)
Backed out changeset 563255aaa1e1 (bug 1824465)
Backed out changeset d1bf32c2a6c6 (bug 1824465)
Backed out changeset ef28b2777487 (bug 1824465)
Backed out changeset a2015d354bb1 (bug 1824465)
Backed out changeset 31d6b53fdc6a (bug 1824465)
2023-04-06 01:50:55 +03:00
Nika Layzell ef634352da Bug 1824465 - Part 8: Make PGPU refcounted, r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D173723
2023-04-05 21:33:39 +00:00
Nika Layzell f0ab46f2f6 Bug 1779792 - Part 3: Use an endpoint to bind the initial actor in parent processes, r=ipc-reviewers,necko-reviewers,media-playback-reviewers,alwu,mccr8
This improves consistency with the child process case, and will make it easier
to attach additional state without needing to thread it through every child
process callsite manually.

Differential Revision: https://phabricator.services.mozilla.com/D153619
2022-08-10 14:55:22 +00:00
Tom Ritter a4973e44f2 Bug 1752332: Remove the shouldSanitizeFunction member r=KrisWright
In the following patch we are going to change the signature of
ShouldSanitizePreference to take a Pref object.  Pref is only
known to the Preferences compilation unit; so to keep this member
(whose signature will change) we would need to expose the Pref
class. However it will only be a forward declaration, one could
not construct a Pref object in e.g. the gtest.

It is simpler to just remove the member entirely and call
ShouldSanitizePreference unconditionally - the member was only
used for the gtest, and while the gtest will be less robust
because of this change, it will still do some testing.

Depends on D141419

Differential Revision: https://phabricator.services.mozilla.com/D141420
2022-04-27 12:57:38 +00:00
Tom Ritter 4d077a8b48 Bug 1752332: Make SerializePreferences correctly sanitize preferences r=KrisWright,necko-reviewers,dragana
To do the correct thing in Preferences::SerializePreferences
(which is used during subprocess startup) we need to know if
the destination process is a web content process or not.
We add parameters to
SharedPreferenceSerializer::SerializeToSharedMemory that let
us figure that out.

In Preferences::SerializePreferences we fix the call to
aShouldSanitizeFn to pass the correct destination.

Depends on D141415

Differential Revision: https://phabricator.services.mozilla.com/D141416
2022-04-27 12:57:37 +00:00
Tom Ritter 0d49156bd8 Bug 1752332: Rename ShouldSyncPreference to ShouldSanitizePreference r=KrisWright
This simplifies the number of negations needed,
and makes things easy to understand. I think
anyway; I know that without renaming it I made
several annoying-to-diagnose negation errors...

Depends on D141411

Differential Revision: https://phabricator.services.mozilla.com/D141412
2022-04-27 12:57:35 +00:00
Tom Ritter baa1f4da1f Bug 1752332: Move ShouldSyncPreferences to Preferences module r=KrisWright
Depends on D141409

Differential Revision: https://phabricator.services.mozilla.com/D141410
2022-04-27 12:57:34 +00:00
Mike Hommey 96c044b561 Bug 1766377 - Fix some sign-compare warnings by using ProcessId more consistently. r=nika,necko-reviewers,kershaw
dom/media/ipc/RDDProcessManager.cpp(320,21): error: comparison of integers of different signs: 'base::ProcessId' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
      gpuProcessPid != -1 ? gpuProcessPid : base::GetCurrentProcId();
      ~~~~~~~~~~~~~ ^  ~~
dom/media/ipc/RDDProcessManager.cpp(332,21): error: comparison of integers of different signs: 'base::ProcessId' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
  if (gpuProcessPid != -1) {
      ~~~~~~~~~~~~~ ^  ~~
gfx/layers/ipc/SharedSurfacesParent.cpp(360,38): error: comparison of integers of different signs: 'base::ProcessId' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
    if (!gpm || gpm->GPUProcessPid() != -1) {
                ~~~~~~~~~~~~~~~~~~~~ ^  ~~
ipc/glue/MessageChannel.cpp(2145,13): error: comparison of integers of different signs: 'int32_t' (aka 'int') and 'const base::ProcessId' (aka 'const unsigned long') [-Werror,-Wsign-compare]
    if (pid != base::kInvalidProcessId &&
        ~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~

Differential Revision: https://phabricator.services.mozilla.com/D144688
2022-04-27 07:45:19 +00:00
Butkovits Atila 9d9191e364 Backed out 17 changesets (bug 1752332) for causing crashes at JS::AutoAssertNoGC::AutoAssertNoGC(JSContext*). CLOSED TREE
Backed out changeset eaa4213b9e08 (bug 1752332)
Backed out changeset 2d794b61fbf7 (bug 1752332)
Backed out changeset 69cbec3e9a11 (bug 1752332)
Backed out changeset 022a68e8d603 (bug 1752332)
Backed out changeset 1ff8656b362d (bug 1752332)
Backed out changeset 46ea5b4f9ad3 (bug 1752332)
Backed out changeset e1dcb4c7cb88 (bug 1752332)
Backed out changeset f9d6bc72406f (bug 1752332)
Backed out changeset dd02b8ef0219 (bug 1752332)
Backed out changeset 3e60b77153a3 (bug 1752332)
Backed out changeset ce93b08837d2 (bug 1752332)
Backed out changeset d165042105ea (bug 1752332)
Backed out changeset 22b910308ecd (bug 1752332)
Backed out changeset d2e748ccd01c (bug 1752332)
Backed out changeset a89203990075 (bug 1752332)
Backed out changeset b580c2a3bac0 (bug 1752332)
Backed out changeset a2d5880b528f (bug 1752332)
2022-04-25 17:55:17 +03:00
Tom Ritter ca2b970ed6 Bug 1752332: Remove the shouldSanitizeFunction member r=KrisWright
In the following patch we are going to change the signature of
ShouldSanitizePreference to take a Pref object.  Pref is only
known to the Preferences compilation unit; so to keep this member
(whose signature will change) we would need to expose the Pref
class. However it will only be a forward declaration, one could
not construct a Pref object in e.g. the gtest.

It is simpler to just remove the member entirely and call
ShouldSanitizePreference unconditionally - the member was only
used for the gtest, and while the gtest will be less robust
because of this change, it will still do some testing.

Depends on D141419

Differential Revision: https://phabricator.services.mozilla.com/D141420
2022-04-25 13:54:03 +00:00
Tom Ritter efb8295ef4 Bug 1752332: Make SerializePreferences correctly sanitize preferences r=KrisWright,necko-reviewers,dragana
To do the correct thing in Preferences::SerializePreferences
(which is used during subprocess startup) we need to know if
the destination process is a web content process or not.
We add parameters to
SharedPreferenceSerializer::SerializeToSharedMemory that let
us figure that out.

In Preferences::SerializePreferences we fix the call to
aShouldSanitizeFn to pass the correct destination.

Depends on D141415

Differential Revision: https://phabricator.services.mozilla.com/D141416
2022-04-25 13:54:02 +00:00
Tom Ritter 3b0ee350e7 Bug 1752332: Rename ShouldSyncPreference to ShouldSanitizePreference r=KrisWright
This simplifies the number of negations needed,
and makes things easy to understand. I think
anyway; I know that without renaming it I made
several annoying-to-diagnose negation errors...

Depends on D141411

Differential Revision: https://phabricator.services.mozilla.com/D141412
2022-04-25 13:54:00 +00:00
Tom Ritter a874d86bda Bug 1752332: Move ShouldSyncPreferences to Preferences module r=KrisWright
Depends on D141409

Differential Revision: https://phabricator.services.mozilla.com/D141410
2022-04-25 13:53:59 +00:00
Cristian Tuns a19a27341c Backed out 16 changesets (bug 1752332) for causing gtest failures CLOSED TREE
Backed out changeset 2523f5463789 (bug 1752332)
Backed out changeset 8d2932869cbd (bug 1752332)
Backed out changeset 7d159898e81d (bug 1752332)
Backed out changeset 5b9bbe252fec (bug 1752332)
Backed out changeset aeb79413e987 (bug 1752332)
Backed out changeset c184c517de91 (bug 1752332)
Backed out changeset 1bc4f1780f37 (bug 1752332)
Backed out changeset 2b78f295d903 (bug 1752332)
Backed out changeset 21f015b60220 (bug 1752332)
Backed out changeset a74095dfe3da (bug 1752332)
Backed out changeset 4b04bf33486e (bug 1752332)
Backed out changeset 8566711743a8 (bug 1752332)
Backed out changeset eec507d87b2b (bug 1752332)
Backed out changeset ef50d2618c7f (bug 1752332)
Backed out changeset 1b4d316e7f20 (bug 1752332)
Backed out changeset e40a778cb93f (bug 1752332)
2022-04-20 17:23:11 -04:00
Tom Ritter 04d9e5ef7d Bug 1752332: Remove the shouldSanitizeFunction member r=KrisWright
In the following patch we are going to change the signature of
ShouldSanitizePreference to take a Pref object.  Pref is only
known to the Preferences compilation unit; so to keep this member
(whose signature will change) we would need to expose the Pref
class. However it will only be a forward declaration, one could
not construct a Pref object in e.g. the gtest.

It is simpler to just remove the member entirely and call
ShouldSanitizePreference unconditionally - the member was only
used for the gtest, and while the gtest will be less robust
because of this change, it will still do some testing.

Depends on D141419

Differential Revision: https://phabricator.services.mozilla.com/D141420
2022-04-20 20:21:47 +00:00
Tom Ritter 0b74427bce Bug 1752332: Make SerializePreferences correctly sanitize preferences r=KrisWright,necko-reviewers,dragana
To do the correct thing in Preferences::SerializePreferences
(which is used during subprocess startup) we need to know if
the destination process is a web content process or not.
We add parameters to
SharedPreferenceSerializer::SerializeToSharedMemory that let
us figure that out.

In Preferences::SerializePreferences we fix the call to
aShouldSanitizeFn to pass the correct destination.

Depends on D141415

Differential Revision: https://phabricator.services.mozilla.com/D141416
2022-04-20 20:21:46 +00:00
Tom Ritter b4ea228b4b Bug 1752332: Rename ShouldSyncPreference to ShouldSanitizePreference r=KrisWright
This simplifies the number of negations needed,
and makes things easy to understand. I think
anyway; I know that without renaming it I made
several annoying-to-diagnose negation errors...

Depends on D141411

Differential Revision: https://phabricator.services.mozilla.com/D141412
2022-04-20 20:21:44 +00:00
Tom Ritter b739e97527 Bug 1752332: Move ShouldSyncPreferences to Preferences module r=KrisWright
Depends on D141409

Differential Revision: https://phabricator.services.mozilla.com/D141410
2022-04-20 20:21:43 +00:00
Cristian Tuns 684a18a0ed Backed out 16 changesets (bug 1752332) for causing multiple failures on StaticPrefList_media.h
Backed out changeset ec6a5f016318 (bug 1752332)
Backed out changeset 10ac6886fa5e (bug 1752332)
Backed out changeset d37dec5c0d9e (bug 1752332)
Backed out changeset 258d19fe4e28 (bug 1752332)
Backed out changeset 52f6b46250a3 (bug 1752332)
Backed out changeset ab5c00d2fb02 (bug 1752332)
Backed out changeset d72dc14eeafd (bug 1752332)
Backed out changeset 061cdf612d0e (bug 1752332)
Backed out changeset 26707a82d896 (bug 1752332)
Backed out changeset 01ca344dedbf (bug 1752332)
Backed out changeset 22c6c04046b1 (bug 1752332)
Backed out changeset ce809df435e1 (bug 1752332)
Backed out changeset 185026a397b0 (bug 1752332)
Backed out changeset 9dfd530f26b8 (bug 1752332)
Backed out changeset deadcb975866 (bug 1752332)
Backed out changeset 4944ae34f15b (bug 1752332)
2022-04-20 13:10:55 -04:00
Tom Ritter de0aefcf2f Bug 1752332: Remove the shouldSanitizeFunction member r=KrisWright
In the following patch we are going to change the signature of
ShouldSanitizePreference to take a Pref object.  Pref is only
known to the Preferences compilation unit; so to keep this member
(whose signature will change) we would need to expose the Pref
class. However it will only be a forward declaration, one could
not construct a Pref object in e.g. the gtest.

It is simpler to just remove the member entirely and call
ShouldSanitizePreference unconditionally - the member was only
used for the gtest, and while the gtest will be less robust
because of this change, it will still do some testing.

Depends on D141419

Differential Revision: https://phabricator.services.mozilla.com/D141420
2022-04-20 15:44:40 +00:00
Tom Ritter cbc935239a Bug 1752332: Make SerializePreferences correctly sanitize preferences r=KrisWright,necko-reviewers,dragana
To do the correct thing in Preferences::SerializePreferences
(which is used during subprocess startup) we need to know if
the destination process is a web content process or not.
We add parameters to
SharedPreferenceSerializer::SerializeToSharedMemory that let
us figure that out.

In Preferences::SerializePreferences we fix the call to
aShouldSanitizeFn to pass the correct destination.

Depends on D141415

Differential Revision: https://phabricator.services.mozilla.com/D141416
2022-04-20 15:44:39 +00:00