@@ -38,12 +38,11 @@ The following code snippets demonstrate how the updated
3838``` cpp
3939// ! [ProcessFailed]
4040// Register a handler for the ProcessFailed event.
41- // This handler checks the failure kind and tries to:
42- // * Recreate the webview for browser failure and render unresponsive.
43- // * Reload the webview for render failure.
44- // * Reload the webview for frame-only render failure impacting app
45- // content.
46- // * Log information about the failure for other failures.
41+ // This handler collects extended diagnostics so the host can:
42+ // * Inspect the failure kind together with reason, description, and exit code.
43+ // * Retrieve the CoreWebView2ProcessInfo for the failed process (ID and kind).
44+ // * Log the gathered information for telemetry or later correlation and decide
45+ // how to react (reload/recreate) based on app policy outside of this sample.
4746CHECK_FAILURE (m_webView->add_ProcessFailed(
4847 Callback<ICoreWebView2ProcessFailedEventHandler >(
4948 [ this] (ICoreWebView2* sender,
@@ -135,7 +134,7 @@ void WebView_ProcessFailed(object sender,
135134 }
136135 else
137136 {
138- messageBuilder.AppendLine("Process Info: unavailable (process may be gone externally)");
137+ messageBuilder.AppendLine("Process Info: unavailable (process may have been terminated externally, e.g., via Task Manager )");
139138 }
140139
141140 // Log the failure or send to telemetry
@@ -155,7 +154,13 @@ void WebView_ProcessFailed(object sender,
155154# Remarks
156155
157156The ` ICoreWebView2ProcessInfo ` property contains the process ID of the failed process
158- and the process kind (GPU, Renderer, Browser, Utility, etc.)
157+ and the process kind (GPU, Renderer, Browser, Utility, etc.). When the failing
158+ process starts successfully (for example, GPU process hangs, browser process
159+ exits, utility process exits, renderer process hangs), the process ID is
160+ available so apps can correlate diagnostics. If the process never starts or if
161+ the main frame renderer process is terminated externally (for example, by Task
162+ Manager or taskkill) the associated process information is unavailable and the
163+ reported process ID is 0.
159164
160165# API Details
161166
@@ -172,11 +177,11 @@ interface ICoreWebView2ProcessFailedEventArgs4 :
172177 ICoreWebView2ProcessFailedEventArgs3 {
173178 /// The process info of the failed process, which can be used to
174179 /// correlate the failing process with the running process data or to
175- /// analyze crash dumps for that process. The process ID should be
176- /// available in all failure kinds e.g. when GPU process hangs ,
177- /// browser process exits, utility process exits or renderer process hangs.
178- /// If the main frame renderer process is gone externally, the process ID
179- /// will be set to 0.
180+ /// analyze crash dumps for that process. The process ID is available when the
181+ /// process starts successfully (GPU process hangs, browser process exits ,
182+ /// utility process exits, renderer process hangs). If the process never
183+ /// started or when the main frame renderer process is terminated externally
184+ /// (for example by Task Manager or taskkill), the process ID will be set to 0.
180185 // MSOWNERS: core (wvcore@microsoft.com )
181186 [ propget] HRESULT ProcessInfo([ out, retval] ICoreWebView2ProcessInfo* value);
182187}
@@ -192,11 +197,11 @@ namespace Microsoft.Web.WebView2.Core
192197 {
193198 /// The process info of the failed process, which can be used to
194199 /// correlate the failing process with the running process data or to
195- /// analyze crash dumps for that process. The process ID should be
196- /// available in all failure kinds e.g. when GPU process hangs ,
197- /// browser process exits, utility process exits or renderer process hangs.
198- /// If the main frame renderer process is gone externally, the process ID
199- /// will be set to 0.
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.
200205
201206 [interface_name("Microsoft.Web.WebView2.Core.ICoreWebView2ProcessFailedEventArgs4")]
202207 {
0 commit comments