Skip to content

Commit e25b1a9

Browse files
authored
Update SingleAppHost.md
1 parent 8d9477d commit e25b1a9

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

specs/SingleAppHost.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
# Background
22
While WebViews from different app processes normally don't share the same WebView browser process instance, app processes from the same product suite may share the same webview browser process
33
instance by specifying the same user data folder when creating WebView2Environment object.
4-
The `IsForSingleAppHost` property is for the developer to express the sharing intent, so that we could provide optimized security and performance according expected usage.
4+
The `AreMultipleHostProcessesAllowed` property is for the developer to express the sharing intent, so that we could provide optimized security and performance according expected usage.
55

66
# Description
7-
The `IsForSingleAppHost` property indicates whether other processes can create WebView2 sharing the same WebView browser process instance by using WebView2Environment created with the same user data folder.
8-
Default is FALSE, meaning that other processes can create WebView objects sharing the same browser process instance.
7+
The `AreMultipleHostProcessesAllowed` property indicates whether other processes can create WebView2 sharing the same WebView browser process instance by using WebView2Environment created with the same user data folder.
8+
Default is TRUE.
99

1010
# Examples
1111
## Win32 C++
1212
```cpp
1313
auto options = Microsoft::WRL::Make<CoreWebView2EnvironmentOptions>();
14-
CHECK_FAILURE(options->put_IsForSingleAppHost(TRUE);
14+
// Don't expect any other process to share the WebView browser process instance.
15+
CHECK_FAILURE(options->put_AreMultipleHostProcessesAllowed(FALSE);
1516
HRESULT hr = CreateCoreWebView2EnvironmentWithOptions(
1617
nullptr, m_userDataFolder.c_str(), options.Get(),
1718
Callback<ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler>(
@@ -20,7 +21,7 @@ Default is FALSE, meaning that other processes can create WebView objects sharin
2021
## WinRT and .NET
2122
```c#
2223
auto options = new CoreWebView2EnvironmentOptions();
23-
options.IsForSingleAppHost = true;
24+
options.AreMultipleHostProcessesAllowed = false;
2425
auto environment = await CoreWebView2Environment.CreateAsync(BrowserExecutableFolder, UserDataFolder, options);
2526
```
2627

@@ -34,16 +35,15 @@ interface ICoreWebView2EnvironmentOptions_2 : IUnknown {
3435

3536
/// Whether other processes can create WebView2 sharing the same WebView browser
3637
/// process instance by using WebView2Environment created with the same user data folder.
37-
/// Default is FALSE, meaning that other processes can create WebView objects
38-
/// sharing the same browser process instance.
39-
[propget] HRESULT IsForSingleAppHost([out, retval] BOOL* value);
38+
/// Default is TRUE.
39+
[propget] HRESULT AreMultipleHostProcessesAllowed([out, retval] BOOL* value);
4040

41-
/// Sets the `ForSingleAppHost` property.
42-
/// When set as TRUE, no other process can create WebView sharing the same browser
41+
/// Sets the `AreMultipleHostProcessesAllowed` property.
42+
/// When set as FALSE, no other process can create WebView sharing the same browser
4343
/// process instance. When another process tries to create WebView2Controller from
4444
/// an WebView2Environment objct created with the same user data folder, it will fail
4545
/// with `HRESULT_FROM_WIN32(ERROR_INVALID_STATE)`.
46-
/// When set to TRUE, `TrySuspend` could potentially do more optimization on reducing
46+
/// When set to FALSE, `TrySuspend` could potentially do more optimization on reducing
4747
/// CPU usage for suspended WebViews.
4848
[propput] HRESULT IsForSingleAppHost([in] BOOL value);
4949

@@ -55,6 +55,6 @@ interface ICoreWebView2EnvironmentOptions_2 : IUnknown {
5555
unsealed runtimeclass CoreWebView2EnvironmentOptions
5656
{
5757
// ..
58-
bool IsForSingleAppHost { get; set; };
58+
bool AreMultipleHostProcessesAllowed { get; set; };
5959
}
6060
```

0 commit comments

Comments
 (0)