-
Notifications
You must be signed in to change notification settings - Fork 62
API Review: ProcessId for ProcessFailedEventArgs #5401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add ProcessId property to CoreWebView2ProcessFailedEventArgs4 This API extends ProcessFailedEventArgs to include the process ID of the failed process, enabling applications to: - Correlate process failures with running process data from the ProcessInfo API - Collect process-specific diagnostic information for logging and telemetry - Analyze crash dumps for specific processes - Better track and respond to failures in multi-renderer scenarios The process ID is only available if the process has started and ended unexpectedly. For other failure types, the process ID value will be 0.
|
@prija-microsoft please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a ProcessId property to CoreWebView2ProcessFailedEventArgs to expose the process ID of failed WebView2 processes. This enhancement enables applications to correlate process failures with runtime process information, collect process-specific diagnostics, and better handle failures in multi-renderer scenarios.
Key Changes:
- Added
ICoreWebView2ProcessFailedEventArgs4interface withProcessIdproperty - The process ID returns 0 for failure types where the process never started successfully
- Provides correlation capability with existing ProcessInfo API
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| WebView2 provides applications with the [ProcessFailed](https://learn.microsoft.com/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.705.50#add_processfailed) event so they can react accordingly when a process failure occurs. However, this event does not currently provide the process id of the failed process. This is particularly problematic when running multiple renderers, it becomes difficult for the application to determine which process to address. | ||
|
|
||
| In this document we describe an extended version of the [ProcessFailedEventArgs](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2processfailedeventargs?view=webview2-1.0.2151.40), which includes the process id. This enables the host application to collect additional information about the process failure whether a renderer, GPU, or even the browser process. |
Copilot
AI
Oct 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected 'process id' to 'process ID' for consistency with industry standard capitalization.
| WebView2 provides applications with the [ProcessFailed](https://learn.microsoft.com/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.705.50#add_processfailed) event so they can react accordingly when a process failure occurs. However, this event does not currently provide the process id of the failed process. This is particularly problematic when running multiple renderers, it becomes difficult for the application to determine which process to address. | |
| In this document we describe an extended version of the [ProcessFailedEventArgs](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2processfailedeventargs?view=webview2-1.0.2151.40), which includes the process id. This enables the host application to collect additional information about the process failure whether a renderer, GPU, or even the browser process. | |
| WebView2 provides applications with the [ProcessFailed](https://learn.microsoft.com/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.705.50#add_processfailed) event so they can react accordingly when a process failure occurs. However, this event does not currently provide the process ID of the failed process. This is particularly problematic when running multiple renderers, it becomes difficult for the application to determine which process to address. | |
| In this document we describe an extended version of the [ProcessFailedEventArgs](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2processfailedeventargs?view=webview2-1.0.2151.40), which includes the process ID. This enables the host application to collect additional information about the process failure whether a renderer, GPU, or even the browser process. |
| WebView2 provides applications with the [ProcessFailed](https://learn.microsoft.com/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.705.50#add_processfailed) event so they can react accordingly when a process failure occurs. However, this event does not currently provide the process id of the failed process. This is particularly problematic when running multiple renderers, it becomes difficult for the application to determine which process to address. | ||
|
|
||
| In this document we describe an extended version of the [ProcessFailedEventArgs](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2processfailedeventargs?view=webview2-1.0.2151.40), which includes the process id. This enables the host application to collect additional information about the process failure whether a renderer, GPU, or even the browser process. |
Copilot
AI
Oct 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected 'process id' to 'process ID' for consistency with industry standard capitalization.
| WebView2 provides applications with the [ProcessFailed](https://learn.microsoft.com/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.705.50#add_processfailed) event so they can react accordingly when a process failure occurs. However, this event does not currently provide the process id of the failed process. This is particularly problematic when running multiple renderers, it becomes difficult for the application to determine which process to address. | |
| In this document we describe an extended version of the [ProcessFailedEventArgs](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2processfailedeventargs?view=webview2-1.0.2151.40), which includes the process id. This enables the host application to collect additional information about the process failure whether a renderer, GPU, or even the browser process. | |
| WebView2 provides applications with the [ProcessFailed](https://learn.microsoft.com/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.705.50#add_processfailed) event so they can react accordingly when a process failure occurs. However, this event does not currently provide the process ID of the failed process. This is particularly problematic when running multiple renderers, it becomes difficult for the application to determine which process to address. | |
| In this document we describe an extended version of the [ProcessFailedEventArgs](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2processfailedeventargs?view=webview2-1.0.2151.40), which includes the process ID. This enables the host application to collect additional information about the process failure whether a renderer, GPU, or even the browser process. |
| /// | ||
| [interface_name("Microsoft.Web.WebView2.Core.ICoreWebView2ProcessFailedEventArgs4")] | ||
| { | ||
| Int32 ProcessId { get; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have an existing CoreWebView2ProcessInfo type and a CoreWebView2ProcessExtendedInfo type. Can we use one of those instead? Preferably the CoreWebView2ProcessExtendedInfo if you have the required info in the implementation, or the CoreWebView2ProcessInfo otherwise. If you don't have info for either one then a Int32 ProcessId is OK.
| Int32 ProcessId { get; }; | |
| CoreWebView2ProcessExtendedInfo ProcessExtendedInfo { get; }; |
|
|
||
| # Background | ||
|
|
||
| WebView2 provides applications with the [ProcessFailed](https://learn.microsoft.com/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.705.50#add_processfailed) event so they can react accordingly when a process failure occurs. However, this event does not currently provide the process id of the failed process. This is particularly problematic when running multiple renderers, it becomes difficult for the application to determine which process to address. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please limit line lengths to 80 or 100 characters
| - Analyze crash dumps for specific processes | ||
| - Better track and respond to failures in multi-renderer scenarios | ||
|
|
||
| The process ID is only available if the process has started and ended unexpectedly. For other failure types where the process was never successfully started, the process ID value will be `0`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to just list the process failure kinds where the process ID will be valid and where it won't.
| The process ID is only available if the process has started and ended unexpectedly. For other failure types where the process was never successfully started, the process ID value will be `0`. | |
| The process ID is only available if the process has started successfully and ended unexpectedly for the failure types X, Y, and Z. For other failure types, the process ID value will be `0`. |
|
|
||
| The `ProcessId` property returns the process ID of the failed process, which matches the `ProcessId` property in the `CoreWebView2ProcessInfo` interface from the ProcessInfo API. This allows you to correlate process failures with process information collected during normal operation. | ||
|
|
||
| The process ID is only available if the process has started and ended unexpectedly. For other failure types where the process was never successfully started or in scenarios where the process ID is not available, the `ProcessId` value will be `0`. Applications should check for this value before attempting to use the process ID. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is sort of duplicate info as above but stated in a different way. Please remove or make sure they match.
| /// The process ID of the failed process. It will match the `ProcessId` | ||
| /// property in `ICoreWebView2ProcessInfo` interface, which can be used to | ||
| /// correlate the failing process with the running process data or to | ||
| /// analyze crash dumps for that process. The process ID is only available |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please state which failure kinds specifically we will have the process ID
Add ProcessId property to CoreWebView2ProcessFailedEventArgs4
This API extends ProcessFailedEventArgs to include the process ID of the failed process, enabling applications to:
The process ID is only available if the process has started and ended unexpectedly. For other failure types, the process ID value will be 0.