Skip to content

Commit 9288f89

Browse files
authored
Update MultiProfile.md
1 parent a38eba6 commit 9288f89

1 file changed

Lines changed: 29 additions & 22 deletions

File tree

specs/MultiProfile.md

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,21 @@ API spec for multiple profile support
33

44
# Background
55

6-
Currently, all WebView2s can only use one fixed Edge profile in the browser process, which is
6+
Previously, all WebView2s can only use one fixed Edge profile in the browser process, which is
77
normally the **Default** profile or the profile specified by the **--profile-directory** command
8-
line switch. Regarding this we have got a bunch of requests to support multiple profiles, so we're
9-
adding these new APIs.
8+
line switch. It means different WebView2s share a single profile directory on disk for data storage,
9+
which might bring security concerns over cookies, autofill data, and password management etc.. Also,
10+
they might also interfere with each other in terms of user preference settings.
1011

11-
With this you can have different WebView2s running with separate profiles under a given user data
12-
directory, which means separate cookies, user preference settings, and various data storage etc.,
13-
to enable you to build a more wonderful experience for your application.
12+
Although you can make your WebView2s use different user data directories to achieve data separation,
13+
in such way you'll have to be running multiple browser instances (each including a browser process
14+
and a bunch of child processes), which means much more consumption for system resources including
15+
memory, CPU footprint, disk space etc. so it is not desirable.
16+
17+
With all above, we're adding these new APIs to support multiple profiles, so that you can have
18+
multiple WebView2s running with separate profiles under a single user data directory (i.e. a single
19+
browser instance at runtime), which means separate cookies, user preference settings, and various
20+
data storage etc., to help you build a more wonderful experience for your application.
1421

1522
# Examples
1623
<!-- TEMPLATE
@@ -70,36 +77,36 @@ to enable you to build a more wonderful experience for your application.
7077
## Win32 C++
7178

7279
```IDL
73-
interface ICoreWebView2Staging6;
74-
interface ICoreWebView2StagingCreateControllerOptions;
75-
interface ICoreWebView2StagingEnvironment4;
76-
interface ICoreWebView2StagingProfile;
80+
interface ICoreWebView2_7;
81+
interface ICoreWebView2ControllerOptions;
82+
interface ICoreWebView2Environment5;
83+
interface ICoreWebView2Profile;
7784
7885
[uuid(57FD205C-39D5-4BA1-8E7B-3E53C323EA87), object, pointer_default(unique)]
79-
interface ICoreWebView2StagingEnvironment4 : IUnknown
86+
interface ICoreWebView2Environment5 : IUnknown
8087
{
81-
/// Create a new ICoreWebView2StagingCreateControllerOptions to be passed as a parameter of
88+
/// Create a new ICoreWebView2ControllerOptions to be passed as a parameter of
8289
/// CreateCoreWebView2ControllerWithOptions and CreateCoreWebView2CompositionControllerWithOptions.
8390
HRESULT CreateCoreWebView2ControllerOptions(
8491
[in] LPCWSTR profileName,
8592
[in] BOOL inPrivateModeEnabled,
86-
[out, retval] ICoreWebView2StagingCreateControllerOptions** options);
93+
[out, retval] ICoreWebView2ControllerOptions** options);
8794
8895
/// Create a new WebView with options.
8996
HRESULT CreateCoreWebView2ControllerWithOptions(
9097
[in] HWND parentWindow,
91-
[in] ICoreWebView2StagingCreateControllerOptions* options,
98+
[in] ICoreWebView2ControllerOptions* options,
9299
[in] ICoreWebView2CreateCoreWebView2ControllerCompletedHandler* handler);
93100
94101
/// Create a new WebView in visual hosting mode with options.
95102
HRESULT CreateCoreWebView2CompositionControllerWithOptions(
96103
[in] HWND parentWindow,
97-
[in] ICoreWebView2StagingCreateControllerOptions* options,
104+
[in] ICoreWebView2ControllerOptions* options,
98105
[in] ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler* handler);
99106
}
100107
101108
[uuid(C2669A3A-03A9-45E9-97EA-03CD55E5DC03), object, pointer_default(unique)]
102-
interface ICoreWebView2StagingCreateControllerOptions : IUnknown {
109+
interface ICoreWebView2ControllerOptions : IUnknown {
103110
/// `ProfileName` property is to specify a profile name, which is only allowed to contain
104111
/// the following ASCII characters with the maximum length as 64 and will be treated in a
105112
/// case insensitive way.
@@ -120,13 +127,13 @@ interface ICoreWebView2StagingCreateControllerOptions : IUnknown {
120127
}
121128
122129
[uuid(6E5CE5F0-16E6-4A05-97D8-4E256B3EB609), object, pointer_default(unique)]
123-
interface ICoreWebView2Staging6 : IUnknown {
124-
/// The associated `ICoreWebView2StagingProfile` object.
125-
[propget] HRESULT Profile([out, retval] ICoreWebView2StagingProfile** profile);
130+
interface ICoreWebView2_7 : IUnknown {
131+
/// The associated `ICoreWebView2Profile` object.
132+
[propget] HRESULT Profile([out, retval] ICoreWebView2Profile** profile);
126133
}
127134
128135
[uuid(3B9A2AF2-E703-4C81-9D25-FCE44312E960), object, pointer_default(unique)]
129-
interface ICoreWebView2StagingProfile : IUnknown {
136+
interface ICoreWebView2Profile : IUnknown {
130137
/// Name of the profile.
131138
[propget] HRESULT ProfileName([out, retval] LPWSTR* value);
132139
@@ -136,11 +143,11 @@ interface ICoreWebView2StagingProfile : IUnknown {
136143
/// Full path of the profile directory.
137144
[propget] HRESULT ProfilePath([out, retval] LPWSTR* value);
138145
139-
// TODO: All profile-wide operations/settings will be put below.
146+
// TODO: All profile-wide operations/settings will be put below in the future.
140147
}
141148
```
142149

143150
# Appendix
144151

145152
Next we'll consolidate all profile-wide operations/settings into the interface
146-
`ICoreWebView2StagingProfile`, and will also add support for erasing a profile completely.
153+
`ICoreWebView2Profile`, and will also add support for erasing a profile completely.

0 commit comments

Comments
 (0)