Skip to content

Commit 61ba25b

Browse files
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 0c87deb commit 61ba25b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

specs/api-get_ProcessId.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Process Info When a WebView2 Process Fails
1+
ProcessId for ProcessFailedEventArgs
22
===
33

44
# Background
@@ -7,21 +7,21 @@ WebView2 provides applications with the
77
[ProcessFailed](https://learn.microsoft.com/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.705.50#add_processfailed)
88
event so they can react accordingly when a process failure occurs. However,
99
this event does not currently provide the process ID of the failed process.
10-
This is particularly problematic when running multiple renderers, it becomes
10+
This is particularly problematic when running multiple renderers. It becomes
1111
difficult for the application to determine which process to address.
1212

1313
In this document we describe an extended version of the
1414
[ProcessFailedEventArgs](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2processfailedeventargs?view=webview2-1.0.2151.40),
15-
which includes the process ID and the process kind. This enables the host application to collect
16-
additional information about the process failure whether a renderer, GPU, or
15+
which provides access to an `ICoreWebView2ProcessInfo` object for the failed process. This object includes the process ID, process kind, and other relevant information. This enables the host application to collect
16+
additional information about the process failure, whether it is a renderer, GPU, or
1717
even the browser process.
1818

1919
The updated API is detailed below. We'd appreciate your feedback.
2020

2121
# Description
2222

2323
The `ICoreWebView2ProcessFailedEventArgs4` interface extends the existing
24-
`ProcessFailedEventArgs` to include the `ICoreWebView2ProcessInfo` of the failed process. This
24+
`ProcessFailedEventArgs` to include, when available, the `ICoreWebView2ProcessInfo` of the failed process. Note that `ProcessInfo` may be null or unavailable in certain scenarios. This
2525
enables applications to:
2626
- Correlate process failures with running process data from the ProcessInfo API
2727
- Collect process-specific diagnostic information for logging and telemetry
@@ -153,7 +153,7 @@ void WebView_ProcessFailed(object sender,
153153

154154
# Remarks
155155

156-
The `ICoreWebView2ProcessInfo` property contains the process ID of the failed process
156+
The `ProcessInfo` property returns an `ICoreWebView2ProcessInfo` object that contains the process ID of the failed process
157157
and the process kind (GPU, Renderer, Browser, Utility, etc.). When the failing
158158
process starts successfully (for example, GPU process hangs, browser process
159159
exits, utility process exits, renderer process hangs), the process ID is
@@ -183,7 +183,7 @@ interface ICoreWebView2ProcessFailedEventArgs4 :
183183
/// started or when the main frame renderer process is terminated externally
184184
/// (for example by Task Manager or taskkill), the process ID will be set to 0.
185185
// MSOWNERS: core (wvcore@microsoft.com)
186-
[propget] HRESULT ProcessInfo([out, retval] ICoreWebView2ProcessInfo* value);
186+
[propget] HRESULT ProcessInfo([out, retval] ICoreWebView2ProcessInfo** value);
187187
}
188188

189189
```
@@ -197,11 +197,11 @@ namespace Microsoft.Web.WebView2.Core
197197
{
198198
/// The process info of the failed process, which can be used to
199199
/// correlate the failing process with the running process data or to
200-
/// analyze crash dumps for that process. The process ID is available when the
201-
/// process starts successfully (GPU process hangs, browser process exits,
202-
/// utility process exits, renderer process hangs). If the process never
203-
/// started or when the main frame renderer process is terminated externally
204-
/// (for example by Task Manager or taskkill), the process ID will be set to 0.
200+
/// analyze crash dumps for that process.
201+
///
202+
/// This property may be <c>null</c> if the process never started or when the main frame renderer process
203+
/// is terminated externally (for example, by Task Manager or taskkill). In these cases, process information
204+
/// is not available. When available, the process ID is set to 0 if the process could not be identified.
205205
206206
[interface_name("Microsoft.Web.WebView2.Core.ICoreWebView2ProcessFailedEventArgs4")]
207207
{

0 commit comments

Comments
 (0)