Commit Graph

3380 Commits

Author SHA1 Message Date
Sandor Molnar
6a0fcc49d0 Backed out 6 changesets (bug 1900225) for causing build bustages @ GeolocationSystemWin.cpp CLOSED TREE
Backed out changeset 2c0d4dc4c52e (bug 1900225)
Backed out changeset 092cece48dcd (bug 1900225)
Backed out changeset d9debcb16932 (bug 1900225)
Backed out changeset b389e47cd649 (bug 1900225)
Backed out changeset 0bdd05d6a2f0 (bug 1900225)
Backed out changeset 35a1d931e407 (bug 1900225)
2024-08-09 02:18:32 +03:00
David P
bc4858498c Bug 1900225: Part 2 - Inform user of system UX issues initiated by geolocation request r=gstoll,emilio,bolsson,pbz
This patch installs the framework for various platforms to inform the user of
one of two things: 1) a coming system dialog asking for system geolocation
permission that will be presented after the Firefox doorhanger asking for
permission for the page, and 2) that we will open a system preferences window,
where the user can enable geolocation for Firefox because it is currently not
enabled.  The code that handles this has been remoted to the parent process
since implementations will not be able to operate in the content process
sandbox.

Here, it stubs the behavior so this does nothing on every platform.
In this patch series, the behavior will be implemented for Windows.

Note: The code will run the geolocation for the page if the user granted it in
Firefox, regardless of whether the user granted or canceled the system
permission.  This respects the user's instruction and provides a work-around in
the event of a bug, although it would usually either fail to get a location or
it will get a very poor one (e.g. via IP lookup).

Differential Revision: https://phabricator.services.mozilla.com/D216473
2024-08-08 22:38:01 +00:00
Kershaw Chang
feddcfbd8b Bug 1902621 - Sanity check for TRRMode, nsITRRSkipReason, and ResolverMode, r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D218812
2024-08-08 12:30:15 +00:00
Nika Layzell
112fcb23c7 Bug 1908725 - Part 4: Switch some basic uses of OtherPid over to OtherChildID, r=smaug
There are many other uses of OtherPid which could be switched over to
OtherChildID, but these were a couple of obvious low-hanging fruit use-cases
which will work better when using OtherChildID.

Differential Revision: https://phabricator.services.mozilla.com/D217120
2024-08-07 20:39:40 +00:00
Nika Layzell
2616e2f273 Bug 1908725 - Part 3: Use GeckoChildID as the value for ContentParentId, r=smaug,ipc-reviewers,mccr8
The type for ContentParentId is uint64_t, however only at most 22 bits
are allowed to be used (as it is used in the high bits of nsContentUtils
process-specific IDs, which need to fit within a JS double). Switching to use
the same existing ChildID reduces the risk of confusion, but this patch doesn't
attempt to update the types used for ContentParentId/ChildID to match
GeckoChildID.

In the future, we probably will want to align these types more closely, and
perhaps de-duplicate some code which currently passes around both.

Differential Revision: https://phabricator.services.mozilla.com/D217119
2024-08-07 20:39:40 +00:00
Nika Layzell
2c721f79d8 Bug 1908725 - Part 2: Make the ChildID available in the same places as OtherPid, r=ipc-reviewers,media-playback-reviewers,win-reviewers,alwu,rkraesig,gfx-reviewers,mccr8,nical
This requires quite a bit of piping to get the ChildID passed everywhere where
we currently pass the pid in IPC. This is done by adding a new struct type
(EndpointProcInfo), which is passed around instead of OtherPid in these places,
and contains the full pid.

In most cases, it was a fairly painless change to move over, however in some
cases, more complex changes were required, as the pid was being stored
previously in something like an Atomic<...>, and needed to be switched to using
a mutex-protected value.

In the future, it may be possible to remove OtherPid from IPDL actors once
everything is migrated to ChildID, but we're still a long way off from that, so
for now we unfortunately need to pass both around.

Differential Revision: https://phabricator.services.mozilla.com/D217118
2024-08-07 20:39:39 +00:00
Emilio Cobos Álvarez
77c40caac6 Bug 1910698 - Remove nsIScriptError.sourceLine. r=smaug,devtools-reviewers,webdriver-reviewers,necko-reviewers,nchevobbe,kershaw,jdescottes,credential-management-reviewers,dimi
Afaict the source lines are not exposed anywhere in the UI.

Differential Revision: https://phabricator.services.mozilla.com/D218115
2024-08-01 17:12:48 +00:00
Nika Layzell
6e919ecc09 Bug 1907269 - Part 1: Allow pop-up windows to load external URIs for first load, r=Gijs
Previously this load would be allowed due to the "web-controlled" check
failing to reject the load. This patch instead bases it on the
docshell.newWindowTarget flag, which is set for the first load in a new
DocShell due to a call to window.open or target=_blank.

This required making the external protocol channel be a property bag so
that the flag can be set on the channel. In the future we may want to
switch this flag to being set in a more generic way which is less
specific to the channel.

Differential Revision: https://phabricator.services.mozilla.com/D217484
2024-07-31 20:34:54 +00:00
Sandor Molnar
84c538e41e Backed out 2 changesets (bug 1907269) for causing bc failures @ browser_ftp_protocol_handlers.js CLOSED TREE
Backed out changeset 3270496f12d8 (bug 1907269)
Backed out changeset 218c98804a83 (bug 1907269)
2024-07-30 02:16:42 +03:00
Nika Layzell
6ad52aa799 Bug 1907269 - Part 1: Allow pop-up windows to load external URIs for first load, r=Gijs
Previously this load would be allowed due to the "web-controlled" check
failing to reject the load. This patch instead bases it on the
docshell.newWindowTarget flag, which is set for the first load in a new
DocShell due to a call to window.open or target=_blank.

This required making the external protocol channel be a property bag so
that the flag can be set on the channel. In the future we may want to
switch this flag to being set in a more generic way which is less
specific to the channel.

Differential Revision: https://phabricator.services.mozilla.com/D217484
2024-07-29 22:15:43 +00:00
Nika Layzell
41fab435f6 Bug 1909374 - Register BrowserParent with CPM before calling Bind, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D217577
2024-07-25 22:06:02 +00:00
Tom Schuster
9ce1ed9cf1 Bug 1809713 - Make nsIClipboard ClipboardType an enum. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D213742
2024-07-24 14:36:29 +00:00
Greg Stoll
453e8955fc Bug 1907466 - make some thread-safety changes for clipboard content analysis r=nika,dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D216608
2024-07-19 19:49:52 +00:00
Can Berk Güder
9e25dc41b0 Bug 1901109 - Add initial unit tests for Private Attribution implementation. r=mt,simonf
* Allow mocking DAPTelemetrySender to test measurements without having
  to decrypt payloads
* Allow mocking Date.now to test expiration conditions

Also:

* Stop swallowing errors in DAPTelemetrySender
* Correct typo loopbackDays -> lookbackDays

Differential Revision: https://phabricator.services.mozilla.com/D212957
2024-07-11 22:09:09 +00:00
Tooru Fujisawa
5903c49a48 Bug 1081542 - Part 1: Add nsIBrowserDOMWindow.OPEN_NEWTAB_FOREGROUND. r=smaug,geckoview-reviewers,Gijs,amejiamarmol,tabbrowser-reviewers,dao
Given meta/ctrl key should use browser.tabs.loadInBackground pref instead of
browser.tabs.loadDivertedInBackground pref, the existing
nsIBrowserDOMWindow.OPEN_NEWTAB behavior doesn't match the requirement.

Add dedicate flag for "open in foreground tab" to make it controllable from
nsWindowWatcher::IsWindowOpenLocationModified.

Differential Revision: https://phabricator.services.mozilla.com/D201929
2024-07-10 06:16:52 +00:00
David P
c32e8a504a Bug 1893119: Part 16 - Make nsBaseDragService weakly remember PBrowsers instead of PContents r=nika,win-reviewers,rkraesig
nsBaseDragService keeps track of the processes that might need to cancel a drag with EndDragSession and this is technically correct since the drag session is a singleton in the child process, but this series of patches changes those sessions to be per-PuppetWidget/BrowserChild.  This allows content processes to distinguish which of its browsers is engaged in a drag.

Differential Revision: https://phabricator.services.mozilla.com/D211062
2024-07-04 07:48:09 +00:00
David P
805b8742ba Bug 1893119: Part 3 - Add widget to nsContentUtils::GetDragSession r=gstoll,rkraesig
Updates each client of the nsContentUtils method to get the right drag session -- the one for the widget that is currently the source or target of the drag session.
The change to nsDOMWindowUtils::DispatchDOMEventViaPresShellForTesting() supports the change to WidgetDragEvent::InitDropEffectForTests() and enabled a
large number of test fixes in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D211067
2024-07-04 07:48:04 +00:00
Greg Stoll
6b9c668503 Bug 1901197: do synchronous Content Analysis for clipboard operations on a background thread r=dlp-reviewers,ipc-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D215457
2024-07-04 01:24:53 +00:00
Iulian Moraru
5634fbae13 Backed out changeset 1983386d307c (bug 1901109) for causing xpcshell failures on test_ppa.js. CLOSED TREE 2024-06-27 00:10:08 +03:00
Can Berk Güder
8898fc57b7 Bug 1901109 - Add initial unit tests for Private Attribution implementation. r=mt,simonf
* Allow mocking DAPTelemetrySender to test measurements without having
  to decrypt payloads
* Allow mocking Date.now to test expiration conditions

Also:

* Stop swallowing errors in DAPTelemetrySender
* Correct typo loopbackDays -> lookbackDays

Differential Revision: https://phabricator.services.mozilla.com/D212957
2024-06-26 16:30:51 +00:00
Jan-Niklas Jaeschke
914d043b7d Bug 1901064, part 1 - Preserve user activation when Fission is disabled. r=edgar,dom-core,tabbrowser-reviewers,mak,geckoview-reviewers,ohall
The code path that was used for loading a document
with fission disabled did not take user activation into account.
This made almost all WPTs for Text Fragments fail,
since they depend on this flag to decide if
a text directive is allowed to be scrolled to.

This patch makes sure that the user activation is
also available for code paths that run through
`CanonicalBrowsingContext::FixupAndLoadURIString()`
to load a document.

This is done by adding a flag `hasValidUserGestureActivation`
to the `nsIOpenWindowInfo`, which carries it through
the JS stack for loading a document.

Differential Revision: https://phabricator.services.mozilla.com/D213401
2024-06-26 14:24:35 +00:00
Nika Layzell
279b50ebe8 Bug 1728331 - Part 4: Make ContentParent KeepAlives explicit with RAII references, r=smaug,dom-worker-reviewers,asuth
This is a fairly significant patch, however it would be difficult to break it
down into smaller patches:

1) The various mechanisms used to manage ContentParent lifecycles have been
   merged together into a common "KeepAlive" system. A process will
   begin shutdown when its keepalive count reaches 0. (though it will
   still wait for all BrowserParents to also be dead before sending the
   actual shutdown message as before).

   This replaces a number of bespoke systems for tracking BrowserParent
   instances in different lifecycle states, remote workers, ongoing
   process switches, and preallocated processes.

2) KeepAlives are now managed automatically by a UniquePtr variant
   (Unique[Threadsafe]ContentParentKeepAlive). This makes the hand-off
   over KeepAlive lifecycles explicit, even for workers.

3) All KeepAlives are now keyed by a BrowserId, which will be 0 for keepalives
   not associated with a specific tab. This allows the new process
   selection logic to count all tabs other than the one being navigated
   when deciding which process to use.

4) The process switching logic now tracks it's KeepAlive with a BrowserId,
   meaning that ongoing process switches are considered when performing
   process selection, even if the BrowserParent hasn't been created yet.

Differential Revision: https://phabricator.services.mozilla.com/D213338
2024-06-24 23:19:28 +00:00
Nika Layzell
0e207ef6ab Bug 1728331 - Part 2: Remove JS process selectors, r=smaug
This shouldn't change behaviour, as the default JS MinTabSelector's behaviour
should roughly match the C++ one. The selector will be updated in a later
patch.

A new pref has been added to disable content process re-use which to replace
the test-only use-case for replacing the process selector.

Differential Revision: https://phabricator.services.mozilla.com/D213336
2024-06-24 23:19:28 +00:00
Nika Layzell
8c38c7c3b6 Bug 1728331 - Part 1: Remove e10s process recycling, r=smaug
This logic did nothing in Fission, however it did have an effect for
e10s-Android, which will no longer have process recycling. I expect the impact
of this to be minimal given Android's tendency to kill processes already.

This feature is being removed because supporting the recycling approach with
the new KeepAlive system being added in future patches would've added
complexity for a largely-unsupported configuration.

Differential Revision: https://phabricator.services.mozilla.com/D213335
2024-06-24 23:19:27 +00:00
Nika Layzell
4a297e61cd Bug 1901851 - Part 3: Make PRemoteWorkerService a toplevel actor which manages PRemoteWorker, r=dom-worker-reviewers,asuth
This enables the PRemoteWorkerService to be created by the parent process
instead of by the content process, which is useful as the parent process is the
party initiating remote worker actions.

Differential Revision: https://phabricator.services.mozilla.com/D213333
2024-06-24 23:19:26 +00:00
Aron Cseh
b01be1057e Backed out 9 changesets (bug 1901851, bug 1728331) for causing remote worker crashes. a=backout
Backed out changeset 30bbda0eb197 (bug 1728331)
Backed out changeset dabd7d6836c8 (bug 1728331)
Backed out changeset 9e04f49c926e (bug 1728331)
Backed out changeset 779ac735736c (bug 1728331)
Backed out changeset 1d413fe340a0 (bug 1728331)
Backed out changeset 15608efcbeb6 (bug 1901851)
Backed out changeset f711bbec11b2 (bug 1901851)
Backed out changeset 8bb1d267d08f (bug 1901851)
Backed out changeset b29282956a04 (bug 1901851)
2024-06-22 00:52:24 +03:00
Sebastian Hengst
e43a62744c Backed out 2 changesets (bug 1901064) for blocking the backout of bug 1888756
Backed out changeset 0e582d262ca8 (bug 1901064)
Backed out changeset 992a876144a0 (bug 1901064)
2024-06-21 12:07:33 +02:00
Nika Layzell
7547f3f8db Bug 1728331 - Part 4: Make ContentParent KeepAlives explicit with RAII references, r=smaug,dom-worker-reviewers,asuth
This is a fairly significant patch, however it would be difficult to break it
down into smaller patches:

1) The various mechanisms used to manage ContentParent lifecycles have been
   merged together into a common "KeepAlive" system. A process will
   begin shutdown when its keepalive count reaches 0. (though it will
   still wait for all BrowserParents to also be dead before sending the
   actual shutdown message as before).

   This replaces a number of bespoke systems for tracking BrowserParent
   instances in different lifecycle states, remote workers, ongoing
   process switches, and preallocated processes.

2) KeepAlives are now managed automatically by a UniquePtr variant
   (Unique[Threadsafe]ContentParentKeepAlive). This makes the hand-off
   over KeepAlive lifecycles explicit, even for workers.

3) All KeepAlives are now keyed by a BrowserId, which will be 0 for keepalives
   not associated with a specific tab. This allows the new process
   selection logic to count all tabs other than the one being navigated
   when deciding which process to use.

4) The process switching logic now tracks it's KeepAlive with a BrowserId,
   meaning that ongoing process switches are considered when performing
   process selection, even if the BrowserParent hasn't been created yet.

Differential Revision: https://phabricator.services.mozilla.com/D213338
2024-06-20 19:24:51 +00:00
Nika Layzell
90b9d8182f Bug 1728331 - Part 2: Remove JS process selectors, r=smaug
This shouldn't change behaviour, as the default JS MinTabSelector's behaviour
should roughly match the C++ one. The selector will be updated in a later
patch.

A new pref has been added to disable content process re-use which to replace
the test-only use-case for replacing the process selector.

Differential Revision: https://phabricator.services.mozilla.com/D213336
2024-06-20 19:24:50 +00:00
Nika Layzell
eb815aa686 Bug 1728331 - Part 1: Remove e10s process recycling, r=smaug
This logic did nothing in Fission, however it did have an effect for
e10s-Android, which will no longer have process recycling. I expect the impact
of this to be minimal given Android's tendency to kill processes already.

This feature is being removed because supporting the recycling approach with
the new KeepAlive system being added in future patches would've added
complexity for a largely-unsupported configuration.

Differential Revision: https://phabricator.services.mozilla.com/D213335
2024-06-20 19:24:50 +00:00
Nika Layzell
c8530b3657 Bug 1901851 - Part 3: Make PRemoteWorkerService a toplevel actor which manages PRemoteWorker, r=dom-worker-reviewers,asuth
This enables the PRemoteWorkerService to be created by the parent process
instead of by the content process, which is useful as the parent process is the
party initiating remote worker actions.

Differential Revision: https://phabricator.services.mozilla.com/D213333
2024-06-20 19:24:49 +00:00
Jan-Niklas Jaeschke
245ec27b92 Bug 1901064, part 1 - Preserve user activation when Fission is disabled. r=edgar,dom-core,tabbrowser-reviewers,mak,geckoview-reviewers,ohall
The code path that was used for loading a document
with fission disabled did not take user activation into account.
This made almost all WPTs for Text Fragments fail,
since they depend on this flag to decide if
a text directive is allowed to be scrolled to.

This patch makes sure that the user activation is
also available for code paths that run through
`CanonicalBrowsingContext::FixupAndLoadURIString()`
to load a document.

This is done by adding a flag `hasValidUserGestureActivation`
to the `nsIOpenWindowInfo`, which carries it through
the JS stack for loading a document.

Differential Revision: https://phabricator.services.mozilla.com/D213401
2024-06-20 15:00:31 +00:00
Andreas Farre
0a1a357b83 Bug 1890748 - Move responsibility of FeaturePolicy initialization to nsILoadInfo. r=freddyb,necko-reviewers,jesup,dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D207140
2024-06-20 13:22:41 +00:00
Edgar Chen
f6f9b13961 Bug 1883799 - Rename nsIAsyncGetClipboardData to nsIClipboardDataSnapshot; r=nika
Differential Revision: https://phabricator.services.mozilla.com/D214135
2024-06-20 07:36:40 +00:00
Edgar Chen
9548778fb3 Bug 1883799 - Rename nsIAsyncClipboardGetCallback to nsIClipboardGetDataSnapshotCallback; r=nika
Differential Revision: https://phabricator.services.mozilla.com/D214134
2024-06-20 07:36:40 +00:00
Edgar Chen
ad0396c801 Bug 1883799 - Rename nsIClipboard.asyncGetData to nsIClipboard.getDataSnapshot; r=nika
Differential Revision: https://phabricator.services.mozilla.com/D214132
2024-06-20 07:36:39 +00:00
Cristian Tuns
cd4bca3a0a Backed out 8 changesets (bug 1901851, bug 1728331) for causing bc failures in browser_docshell_type_editor.js CLOSED TREE
Backed out changeset 2cf5cad90099 (bug 1728331)
Backed out changeset d920c2d72d00 (bug 1728331)
Backed out changeset 9e5bd0186aa6 (bug 1728331)
Backed out changeset 45735575df21 (bug 1728331)
Backed out changeset fbafea1663e3 (bug 1901851)
Backed out changeset 30bdf88d3bb7 (bug 1901851)
Backed out changeset 1d994915bd71 (bug 1901851)
Backed out changeset 0b3249432b9c (bug 1901851)
2024-06-19 20:51:53 -04:00
Nika Layzell
14d11f5f70 Bug 1728331 - Part 4: Make ContentParent KeepAlives explicit with RAII references, r=smaug,dom-worker-reviewers,asuth
This is a fairly significant patch, however it would be difficult to break it
down into smaller patches:

1) The various mechanisms used to manage ContentParent lifecycles have been
   merged together into a common "KeepAlive" system. A process will
   begin shutdown when its keepalive count reaches 0. (though it will
   still wait for all BrowserParents to also be dead before sending the
   actual shutdown message as before).

   This replaces a number of bespoke systems for tracking BrowserParent
   instances in different lifecycle states, remote workers, ongoing
   process switches, and preallocated processes.

2) KeepAlives are now managed automatically by a UniquePtr variant
   (Unique[Threadsafe]ContentParentKeepAlive). This makes the hand-off
   over KeepAlive lifecycles explicit, even for workers.

3) All KeepAlives are now keyed by a BrowserId, which will be 0 for keepalives
   not associated with a specific tab. This allows the new process
   selection logic to count all tabs other than the one being navigated
   when deciding which process to use.

4) The process switching logic now tracks it's KeepAlive with a BrowserId,
   meaning that ongoing process switches are considered when performing
   process selection, even if the BrowserParent hasn't been created yet.

Differential Revision: https://phabricator.services.mozilla.com/D213338
2024-06-19 20:14:50 +00:00
Nika Layzell
e16a5c8ced Bug 1728331 - Part 2: Remove JS process selectors, r=smaug
This shouldn't change behaviour, as the default JS MinTabSelector's behaviour
should roughly match the C++ one. The selector will be updated in a later
patch.

A new pref has been added to disable content process re-use which to replace
the test-only use-case for replacing the process selector.

Differential Revision: https://phabricator.services.mozilla.com/D213336
2024-06-19 20:14:49 +00:00
Nika Layzell
a1a9ca4882 Bug 1728331 - Part 1: Remove e10s process recycling, r=smaug
This logic did nothing in Fission, however it did have an effect for
e10s-Android, which will no longer have process recycling. I expect the impact
of this to be minimal given Android's tendency to kill processes already.

This feature is being removed because supporting the recycling approach with
the new KeepAlive system being added in future patches would've added
complexity for a largely-unsupported configuration.

Differential Revision: https://phabricator.services.mozilla.com/D213335
2024-06-19 20:14:48 +00:00
Nika Layzell
b5bd2ffdef Bug 1901851 - Part 3: Make PRemoteWorkerService a toplevel actor which manages PRemoteWorker, r=dom-worker-reviewers,asuth
This enables the PRemoteWorkerService to be created by the parent process
instead of by the content process, which is useful as the parent process is the
party initiating remote worker actions.

Differential Revision: https://phabricator.services.mozilla.com/D213333
2024-06-19 20:14:48 +00:00
Emilio Cobos Álvarez
eb0f818772 Bug 1901060 - Privacy Preserving Attribution origin trial and API. r=bbirdsong,mt,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D211093
2024-06-06 16:43:41 +00:00
Nika Layzell
11d3698341 Bug 1681457 - Allow non-auxiliary BrowsingContexts created by script to close themselves, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D211792
2024-06-05 00:06:48 +00:00
Jens Stutte
2d01bffcc8 Bug 1711734 - Add a more explicit IPC_FAIL case for discarded parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D212112
2024-05-30 16:55:19 +00:00
Cristian Tuns
ce526f805f Backed out changeset 9b708a1dc402 (bug 1890748) for causing bc failures in browser_permission_delegate_geo.js CLOSED TREE 2024-05-27 12:25:10 -04:00
Andreas Farre
b66f6322f2 Bug 1890748 - Move responsibility of FeaturePolicy initialization to nsILoadInfo. r=freddyb,necko-reviewers,jesup,dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D207140
2024-05-27 10:06:58 +00:00
Butkovits Atila
bd73be20f9 Backed out changeset a710fd347db2 (bug 1890748) for causing bustages at Document.cpp. CLOSED TREE 2024-05-24 18:06:30 +03:00
Andreas Farre
bcf940af03 Bug 1890748 - Move responsibility of FeaturePolicy initialization to nsILoadInfo. r=freddyb,necko-reviewers,jesup,dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D207140
2024-05-24 14:28:47 +00:00
Paul Bone
5fbea18ee4 Bug 1897060 - Gather process lifetime telemetry r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D210751
2024-05-18 02:05:50 +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