Skip to content

Commit 8abd7a5

Browse files
committed
Add API review doc base
1 parent f2abacd commit 8abd7a5

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

specs/ExtendedProcessFailed.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Background
2+
WebView2 provides applications with the [ProcessFailed](https://docs.microsoft.com/en-us/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 additional information about the process failure, nor does it cover the cases in which only subframes within the CoreWebView2 are impacted by the failure, or the cases in which a process other than the browser/render process fails.
3+
4+
In this document we describe an extended version of the [PROCESS_FAILED_KIND](https://docs.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.705.50#corewebview2_process_failed_kind) enum, which covers the new scenarios in which the event is raised: frame-only render process failure, and process failures for processes other than the browser/render process. We also include a new version of the [ProcessFailedEventArgs](https://docs.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2processfailedeventargs?view=webview2-1.0.705.50) that enables the host application to collect additional information about the process failure for their logging and telemetry purposes.
5+
6+
The updated API is detailed below. We'd appreciate your feedback.
7+
8+
9+
# Description
10+
We propose to add new cases for which the `ProcessFailed` event is raised:
11+
1. When a frame-only render process fails. Only subframes within the `CoreWebView2` are impacted in this case (the content is gone and replaced with a "sad face" layer).
12+
2. When a WebView2 Runtime child process other than the browser process or a render process fails. The app can use these process failures for logging and telemetry purposes.
13+
14+
We also propose extending the `ProcessFailedEventArgs` to provide additional information about the process failure:
15+
* Reason of the failure.
16+
* Exit code.
17+
* Process description.
18+
* Impacted frames for (1) above.
19+
20+
21+
# Examples
22+
The following code snippets demonstrate how the `ProcessFailedEventArgs2` can be used by the host application:
23+
24+
## Win32 C++
25+
```cpp
26+
```
27+
28+
## .NET C#
29+
```xml
30+
```
31+
32+
```c#
33+
```
34+
35+
36+
# Remarks
37+
* `ProcessFailedKind` in the event args will be `RENDER_PROCESS_EXITED` if the failed process is the main frame's renderer, even if there were subframes rendered by such process. All frames are gone when this happens and `ImpactedFrames` will be `null` as the attribute is intended for frame-only renderer failures only.
38+
39+
* `Reason` in the event args is always `UNEXPECTED` when `ProcessFailedKind` is `BROWSER_PROCESS_EXITED`, and `UNRESPONSIVE` when `ProcessFailedKind` is `RENDER_PROCESS_UNRESPONSIVE`.
40+
41+
* `ExitCode` is always `1` when `ProcessFailedKind` is `BROWSER_PROCESS_EXITED`, and `STILL_ACTIVE` (`259`) when `ProcessFailedKind` is `RENDER_PROCESS_UNRESPONSIVE`.
42+
43+
44+
# API Notes
45+
See [API Details](#api-details) section below for API reference.
46+
47+
* Triple-slash (`///`) comments will appear in the public API documentation.
48+
* Double-slash (`//`) comments are notes for this review only and will not show in public documentation.
49+
50+
51+
# API Details
52+
## COM
53+
```cpp
54+
```
55+
56+
## .NET and WinRT
57+
```c#
58+
```

0 commit comments

Comments
 (0)