Skip to content

Commit 05d1bb4

Browse files
authored
Update SingleAppHost.md
1 parent d0b5940 commit 05d1bb4

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

specs/SingleAppHost.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +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 `AreMultipleHostProcessesAllowed` property is for the developer to express the sharing intent, so that we could provide optimized security and performance according expected usage.
4+
The `ExclusiveUserDataFolderAccess` 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 `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.
7+
The `ExclusiveUserDataFolderAccess` 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.
99

1010
# Examples
1111
## Win32 C++
1212
```cpp
1313
auto options = Microsoft::WRL::Make<CoreWebView2EnvironmentOptions>();
1414
// Don't expect any other process to share the WebView browser process instance.
15-
CHECK_FAILURE(options->put_AreMultipleHostProcessesAllowed(FALSE);
15+
CHECK_FAILURE(options->put_ExclusiveUserDataFolderAccess(TRUE);
1616
HRESULT hr = CreateCoreWebView2EnvironmentWithOptions(
1717
nullptr, m_userDataFolder.c_str(), options.Get(),
1818
Callback<ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler>(
@@ -21,7 +21,7 @@ Default is TRUE.
2121
## WinRT and .NET
2222
```c#
2323
auto options = new CoreWebView2EnvironmentOptions();
24-
options.AreMultipleHostProcessesAllowed = false;
24+
options.ExclusiveUserDataFolderAccess = true;
2525
auto environment = await CoreWebView2Environment.CreateAsync(BrowserExecutableFolder, UserDataFolder, options);
2626
```
2727

@@ -36,17 +36,21 @@ interface ICoreWebView2EnvironmentOptions_2 : IUnknown
3636

3737
/// Whether other processes can create WebView2 sharing the same WebView browser
3838
/// process instance by using WebView2Environment created with the same user data folder.
39-
/// Default is TRUE.
40-
[propget] HRESULT AreMultipleHostProcessesAllowed([out, retval] BOOL* value);
39+
/// Default is FALSE.
40+
[propget] HRESULT ExclusiveUserDataFolderAccess([out, retval] BOOL* value);
4141

42-
/// Sets the `AreMultipleHostProcessesAllowed` property.
43-
/// When set as FALSE, no other process can create WebView sharing the same browser
42+
/// Sets the `ExclusiveUserDataFolderAccess` property.
43+
/// When set as TRUE, no other process can create WebView sharing the same browser
4444
/// process instance. When another process tries to create WebView2Controller from
4545
/// an WebView2Environment objct created with the same user data folder, it will fail
4646
/// with `HRESULT_FROM_WIN32(ERROR_INVALID_STATE)`.
47-
/// When set to FALSE, `TrySuspend` could potentially do more optimization on reducing
47+
/// When the same user data folder is used, if there is already a WebView running,
48+
/// creating a WebView using WebView2Environment object with a different value for
49+
/// this property from that of the WebView2Environment object of the existing WebView
50+
/// will fail with `HRESULT_FROM_WIN32(ERROR_INVALID_STATE)`.
51+
/// When set to TRUE, `TrySuspend` could potentially do more optimization on reducing
4852
/// CPU usage for suspended WebViews.
49-
[propput] HRESULT AreMultipleHostProcessesAllowed([in] BOOL value);
53+
[propput] HRESULT ExclusiveUserDataFolderAccess([in] BOOL value);
5054

5155
}
5256

@@ -56,6 +60,6 @@ interface ICoreWebView2EnvironmentOptions_2 : IUnknown
5660
unsealed runtimeclass CoreWebView2EnvironmentOptions
5761
{
5862
// ..
59-
bool AreMultipleHostProcessesAllowed { get; set; };
63+
bool ExclusiveUserDataFolderAccess { get; set; };
6064
}
6165
```

0 commit comments

Comments
 (0)