From bbfee79501764582d9038ca4bb7c11e7cdfd305a Mon Sep 17 00:00:00 2001 From: Wangsong Jin Date: Fri, 9 Sep 2022 14:09:27 -0700 Subject: [PATCH 01/10] Create StartInBackgroundMode.md --- specs/StartInBackgroundMode.md | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 specs/StartInBackgroundMode.md diff --git a/specs/StartInBackgroundMode.md b/specs/StartInBackgroundMode.md new file mode 100644 index 000000000..23dad981e --- /dev/null +++ b/specs/StartInBackgroundMode.md @@ -0,0 +1,48 @@ +StartInBackgroundMode +=== + +# Background +By default, WebView2 instances get created with some priorities set higher, assuming the WV2 is being created in the foreground for an important purpose. However, not every developer wants to boost the WebView2 prelaunch phase at the cost of utilizing more system resources. The `StartInBackgroundMode` property specifies that whether WebView2 created with launch boost or not. + + +# Description +Setting `StartInBackgroundMode` to TRUE will signal WebView2 to start in a 'background mode' which will attempt to use less system resources during the creation and initial load. Default is FALSE. + +# Examples +## Win32 C++ +```cpp +auto options = Microsoft::WRL::Make(); +options->put_StartInBackgroundMode(TRUE)); +HRESULT hr = CreateCoreWebView2EnvironmentWithOptions( + nullptr, m_userDataFolder.c_str(), options.Get(), + Callback( + this, &AppWindow::OnCreateEnvironmentCompleted).Get()); +``` +## WinRT and .NET +```c# +auto options = new CoreWebView2EnvironmentOptions(); +options.StartInBackgroundMode = true; +auto environment = await CoreWebView2Environment.CreateAsync(BrowserExecutableFolder, UserDataFolder, options); +``` + + +# API Details +## Win32 C++ +```cpp +interface ICoreWebView2StagingEnvironmentOptions3 : IUnknown +{ + /// Setting `StartInBackgroundMode` to `TRUE` will signal WebView2 to start in a 'background mode' + /// which will attempt to use less system resources during the creation and initial load. + /// Default is FALSE. + [propget] HRESULT StartInBackgroundMode([out, retval] BOOL* value); + /// Sets the `StartInBackgroundMode` property. + [propput] HRESULT StartInBackgroundMode ([in] BOOL value); +} +``` +## WinRT and .NET +```c# +unsealed runtimeclass CoreWebView2EnvironmentOptions +{ + bool StartInBackgroundMode { get; set; }; +} +``` \ No newline at end of file From 172f88f8740f76d0820c98a36eeef265416e2554 Mon Sep 17 00:00:00 2001 From: Wangsong Jin Date: Thu, 15 Sep 2022 15:31:58 -0700 Subject: [PATCH 02/10] Update StartInBackgroundMode.md --- specs/StartInBackgroundMode.md | 56 +++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/specs/StartInBackgroundMode.md b/specs/StartInBackgroundMode.md index 23dad981e..ceb33ec51 100644 --- a/specs/StartInBackgroundMode.md +++ b/specs/StartInBackgroundMode.md @@ -1,18 +1,22 @@ -StartInBackgroundMode +CreationPriority === # Background -By default, WebView2 instances get created with some priorities set higher, assuming the WV2 is being created in the foreground for an important purpose. However, not every developer wants to boost the WebView2 prelaunch phase at the cost of utilizing more system resources. The `StartInBackgroundMode` property specifies that whether WebView2 created with launch boost or not. - +WebView2 has a functionality enabled by default which raises the launch priority of WV2 processes to ensure that WV2 processes are given higher CPU priority and access to resources while creation, and that can bring improvements on time spent creating a WV2 instance. Since this improvement is at the cost of taking higher CPU priority, we introduce `CreationPriority` property to give developers an option to decide by themselves. # Description -Setting `StartInBackgroundMode` to TRUE will signal WebView2 to start in a 'background mode' which will attempt to use less system resources during the creation and initial load. Default is FALSE. - +* Setting `CreationPriority` to `CreationPriority::NORMAL` will signal WebView2 to use less system resources during the creation. +* Setting `CreationPriority` to `CreationPriority::HIGH` will attempt to enable the launch time improvement functionality with raising the launch priority during creation. +* `CreationPriority::DEFAULT` is the default value, we treat it as same as `CreationPriority::HIGH`. +## Notes +* Your application needs to verify that the version of Edge is >=95 before applying the `CreationPriority`, it can cause issues if used on earlier versions of Edge. +* A prerequisitive for WebView2 applying the launch time improvement is the host app's priority is at least normal. Else, WebView2 still get created with normal priority even with `CreationPriority::HIGH`. +* Currently launch time improvement functionality is only enabled for WebView2 manager process, so the `CreationPriority` only effect the creation of manager process. `CreationPriority` can play the same role for other process types like render process if WebView2 opts in launch time improvement functionality for those types in the future. # Examples ## Win32 C++ ```cpp auto options = Microsoft::WRL::Make(); -options->put_StartInBackgroundMode(TRUE)); +options->put_CreationPriority(CreationPriority::NORMAL); HRESULT hr = CreateCoreWebView2EnvironmentWithOptions( nullptr, m_userDataFolder.c_str(), options.Get(), Callback( @@ -21,7 +25,7 @@ HRESULT hr = CreateCoreWebView2EnvironmentWithOptions( ## WinRT and .NET ```c# auto options = new CoreWebView2EnvironmentOptions(); -options.StartInBackgroundMode = true; +options.CreationPriority = CreationPriority::NORMAL; auto environment = await CoreWebView2Environment.CreateAsync(BrowserExecutableFolder, UserDataFolder, options); ``` @@ -29,20 +33,36 @@ auto environment = await CoreWebView2Environment.CreateAsync(BrowserExecutableFo # API Details ## Win32 C++ ```cpp -interface ICoreWebView2StagingEnvironmentOptions3 : IUnknown -{ - /// Setting `StartInBackgroundMode` to `TRUE` will signal WebView2 to start in a 'background mode' - /// which will attempt to use less system resources during the creation and initial load. - /// Default is FALSE. - [propget] HRESULT StartInBackgroundMode([out, retval] BOOL* value); - /// Sets the `StartInBackgroundMode` property. - [propput] HRESULT StartInBackgroundMode ([in] BOOL value); +[uuid(efb58776-32bd-11ed-a261-0242ac120002), object, pointer_default(unique)] +interface ICoreWebView2EnvironmentOptions3 : ICoreWebView2EnvironmentOptions2 { + + /// Gets the creation priority for webview2 creation. + // MSOWNERS: wangsongjin@microsoft.com + [propget] HRESULT CreationPriority([out, retval] CreationPriority* creationPriority); + + /// Sets the `CreationPriority` property. + /// The `CreationPriority` property` specifies that the creation priority WebView environment get created. + /// WebView2 currernt has a functionality enabled by deafult which raises the launch priority to + /// give improvements on the WebView2 creation time. Since this improvement is at the cost of occupying + /// higher CPU priority, we give developers options to decide by themselves. + /// Set `CreationPriority` to `CreationPriority::NORMAL` will create WebView2 instances with normal priority + /// which opts out this functionality. + /// Set `CreationPriority` to `CreationPriority::HIGH` will try to launch WebView2 with above normal priority + /// and opt in this functionality. + /// Set `CreationPriority` to `CreationPriority::DEFAULT` behaves the same way as `CreationPriority::HIGH`. + /// NOTE: A prerequisitive for WebView2 applying the launch time improvement is the host app's priority is + /// at least normal. Else, WebView2 still get created with normal priority even with `CreationPriority::HIGH`. + // MSOWNERS: wangsongjin@microsoft.com + [propput] HRESULT CreationPriority([in] CreationPriority creationPriority); } ``` ## WinRT and .NET ```c# -unsealed runtimeclass CoreWebView2EnvironmentOptions +namespace Microsoft.Web.WebView2.Core { - bool StartInBackgroundMode { get; set; }; -} + // ... + unsealed runtimeclass CoreWebView2EnvironmentOptions + { + enum CreationPriority { get; set; }; + } ``` \ No newline at end of file From ffb5062c298ce9725743cd276227dd6954dc07f3 Mon Sep 17 00:00:00 2001 From: Wangsong Jin Date: Fri, 16 Sep 2022 12:06:53 -0700 Subject: [PATCH 03/10] Update StartInBackgroundMode.md --- specs/StartInBackgroundMode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/StartInBackgroundMode.md b/specs/StartInBackgroundMode.md index ceb33ec51..45035b482 100644 --- a/specs/StartInBackgroundMode.md +++ b/specs/StartInBackgroundMode.md @@ -41,7 +41,7 @@ interface ICoreWebView2EnvironmentOptions3 : ICoreWebView2EnvironmentOptions2 { [propget] HRESULT CreationPriority([out, retval] CreationPriority* creationPriority); /// Sets the `CreationPriority` property. - /// The `CreationPriority` property` specifies that the creation priority WebView environment get created. + /// The `CreationPriority` property specifies that the creation priority WebView environment get created. /// WebView2 currernt has a functionality enabled by deafult which raises the launch priority to /// give improvements on the WebView2 creation time. Since this improvement is at the cost of occupying /// higher CPU priority, we give developers options to decide by themselves. From 04fd33d67e00f48fd53bd767a9e2f1f044ff172d Mon Sep 17 00:00:00 2001 From: Wangsong Jin Date: Thu, 22 Sep 2022 17:15:03 -0700 Subject: [PATCH 04/10] Update StartInBackgroundMode.md --- specs/StartInBackgroundMode.md | 93 +++++++++++++++++++++++----------- 1 file changed, 64 insertions(+), 29 deletions(-) diff --git a/specs/StartInBackgroundMode.md b/specs/StartInBackgroundMode.md index 45035b482..7c8f17faf 100644 --- a/specs/StartInBackgroundMode.md +++ b/specs/StartInBackgroundMode.md @@ -2,21 +2,35 @@ CreationPriority === # Background -WebView2 has a functionality enabled by default which raises the launch priority of WV2 processes to ensure that WV2 processes are given higher CPU priority and access to resources while creation, and that can bring improvements on time spent creating a WV2 instance. Since this improvement is at the cost of taking higher CPU priority, we introduce `CreationPriority` property to give developers an option to decide by themselves. +WebView2 has a functionality enabled by default which raises the launch priority of WV2 +processes to ensure that WV2 processes are given higher CPU priority and access to resources +while creation, and that can bring improvements on time spent creating a WV2 instance. Since +this improvement is at the cost of taking higher CPU priority, we introduce `CreationPriority` +property to give developers an option to decide by themselves. # Description -* Setting `CreationPriority` to `CreationPriority::NORMAL` will signal WebView2 to use less system resources during the creation. -* Setting `CreationPriority` to `CreationPriority::HIGH` will attempt to enable the launch time improvement functionality with raising the launch priority during creation. -* `CreationPriority::DEFAULT` is the default value, we treat it as same as `CreationPriority::HIGH`. +* Setting `CreationPriority` to `COREWEBVIEW2_CREATION_PRIORITY_NORMAL` will signal WebView2 +to use less system resources during the creation. +* Setting `CreationPriority` to `COREWEBVIEW2_CREATION_PRIORITY_HIGH` will attempt to enable +the launch time improvement functionality with raising the launch priority during the creation. +* Default value is `COREWEBVIEW2_CREATION_PRIORITY_HIGH`. ## Notes -* Your application needs to verify that the version of Edge is >=95 before applying the `CreationPriority`, it can cause issues if used on earlier versions of Edge. -* A prerequisitive for WebView2 applying the launch time improvement is the host app's priority is at least normal. Else, WebView2 still get created with normal priority even with `CreationPriority::HIGH`. -* Currently launch time improvement functionality is only enabled for WebView2 manager process, so the `CreationPriority` only effect the creation of manager process. `CreationPriority` can play the same role for other process types like render process if WebView2 opts in launch time improvement functionality for those types in the future. +* The version of Edge has to >=95 before applying the `CreationPriority`, this property will +be ingored from an ealier version. +* The host app's priority is at least normal before applying the launch time improvement functionality. +Else, WebView2 still get created with normal priority even with `COREWEBVIEW2_CREATION_PRIORITY_HIGH` +setting. +* Currently launch time improvement functionality is only enabled for WebView2 manager process, so the +`CreationPriority` only effects the creation of manager process. `CreationPriority` can play the same +role for other process types like render process if WebView2 opts in launch time improvement functionality +for those types in the future. # Examples ## Win32 C++ ```cpp auto options = Microsoft::WRL::Make(); -options->put_CreationPriority(CreationPriority::NORMAL); +// Set `CreationPriority` to `COREWEBVIEW2_CREATION_PRIORITY_NORMAL` if you don't want to boost the +// launch time at the cost of using higher CPU priority during the launch phase. +options->put_CreationPriority(COREWEBVIEW2_CREATION_PRIORITY_NORMAL); HRESULT hr = CreateCoreWebView2EnvironmentWithOptions( nullptr, m_userDataFolder.c_str(), options.Get(), Callback( @@ -24,45 +38,66 @@ HRESULT hr = CreateCoreWebView2EnvironmentWithOptions( ``` ## WinRT and .NET ```c# -auto options = new CoreWebView2EnvironmentOptions(); -options.CreationPriority = CreationPriority::NORMAL; -auto environment = await CoreWebView2Environment.CreateAsync(BrowserExecutableFolder, UserDataFolder, options); +CoreWebView2EnvironmentOptions options = new CoreWebView2EnvironmentOptions(); +options.CreationPriority = COREWEBVIEW2_CREATION_PRIORITY_NORMAL; +CoreWebView2Environment Environment = + await CoreWebView2Environment.CreateAsync( + BrowserExecutableFolder, UserDataFolder, options) ``` # API Details ## Win32 C++ ```cpp +/// Specifies the type of webview2 creation priority for the +/// `ICoreWebView2EnvironmentOptions3:CreationPriority` option. +[v1_enum] +typedef enum COREWEBVIEW2_CREATION_PRIORITY { + COREWEBVIEW2_CREATION_PRIORITY_NORMAL, + COREWEBVIEW2_CREATION_PRIORITY_HIGH, +} COREWEBVIEW2_CREATION_PRIORITY; + [uuid(efb58776-32bd-11ed-a261-0242ac120002), object, pointer_default(unique)] interface ICoreWebView2EnvironmentOptions3 : ICoreWebView2EnvironmentOptions2 { /// Gets the creation priority for webview2 creation. + /// + /// \snippet AppWindow.cpp CreateCoreWebView2EnvironmentWithOptions // MSOWNERS: wangsongjin@microsoft.com - [propget] HRESULT CreationPriority([out, retval] CreationPriority* creationPriority); + [propget] HRESULT CreationPriority([out, retval] COREWEBVIEW2_CREATION_PRIORITY* creationPriority); /// Sets the `CreationPriority` property. - /// The `CreationPriority` property specifies that the creation priority WebView environment get created. - /// WebView2 currernt has a functionality enabled by deafult which raises the launch priority to - /// give improvements on the WebView2 creation time. Since this improvement is at the cost of occupying - /// higher CPU priority, we give developers options to decide by themselves. - /// Set `CreationPriority` to `CreationPriority::NORMAL` will create WebView2 instances with normal priority - /// which opts out this functionality. - /// Set `CreationPriority` to `CreationPriority::HIGH` will try to launch WebView2 with above normal priority - /// and opt in this functionality. - /// Set `CreationPriority` to `CreationPriority::DEFAULT` behaves the same way as `CreationPriority::HIGH`. - /// NOTE: A prerequisitive for WebView2 applying the launch time improvement is the host app's priority is - /// at least normal. Else, WebView2 still get created with normal priority even with `CreationPriority::HIGH`. + /// The `CreationPriority` property specifies that the creation priority WebView + /// environment attempt to create. + /// Set `CreationPriority` to `COREWEBVIEW2_CREATION_PRIORITY_NORMAL` will create + /// WebView2 with normal priority. + /// Set `CreationPriority` to `COREWEBVIEW2_CREATION_PRIORITY_HIGH` will attempt + /// to create WebView2 with high priority. + /// Default is `COREWEBVIEW2_CREATION_PRIORITY_HIGH`. // MSOWNERS: wangsongjin@microsoft.com - [propput] HRESULT CreationPriority([in] CreationPriority creationPriority); + [propput] HRESULT CreationPriority([in] COREWEBVIEW2_CREATION_PRIORITY creationPriority); } ``` ## WinRT and .NET ```c# namespace Microsoft.Web.WebView2.Core { - // ... - unsealed runtimeclass CoreWebView2EnvironmentOptions - { - enum CreationPriority { get; set; }; - } + enum CoreWebView2CreationPriority + { + Normal = 0, + High = 1, + }; + + runtimeclass CoreWebView2EnvironmentOptions + { + + // ... + [interface_name("Microsoft.Web.WebView2.Core.ICoreWebView2EnvironmentOptions3")] + { + + CoreWebView2CreationPriority CreationPriority { get; set; }; + + } + } +} ``` \ No newline at end of file From e758267a970013c00c6c93017f6d6d060e4ffe6f Mon Sep 17 00:00:00 2001 From: Wangsong Jin Date: Mon, 26 Sep 2022 09:48:37 -0700 Subject: [PATCH 05/10] Update StartInBackgroundMode.md --- specs/StartInBackgroundMode.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/specs/StartInBackgroundMode.md b/specs/StartInBackgroundMode.md index 7c8f17faf..bfb94e1d4 100644 --- a/specs/StartInBackgroundMode.md +++ b/specs/StartInBackgroundMode.md @@ -15,8 +15,6 @@ to use less system resources during the creation. the launch time improvement functionality with raising the launch priority during the creation. * Default value is `COREWEBVIEW2_CREATION_PRIORITY_HIGH`. ## Notes -* The version of Edge has to >=95 before applying the `CreationPriority`, this property will -be ingored from an ealier version. * The host app's priority is at least normal before applying the launch time improvement functionality. Else, WebView2 still get created with normal priority even with `COREWEBVIEW2_CREATION_PRIORITY_HIGH` setting. From a9678800965226ab4fa027d1ede03af1c4dff8fb Mon Sep 17 00:00:00 2001 From: Wangsong Jin Date: Mon, 26 Sep 2022 13:46:57 -0700 Subject: [PATCH 06/10] Update StartInBackgroundMode.md --- specs/StartInBackgroundMode.md | 42 ++++++++++++++++------------------ 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/specs/StartInBackgroundMode.md b/specs/StartInBackgroundMode.md index bfb94e1d4..309a689a6 100644 --- a/specs/StartInBackgroundMode.md +++ b/specs/StartInBackgroundMode.md @@ -2,32 +2,25 @@ CreationPriority === # Background -WebView2 has a functionality enabled by default which raises the launch priority of WV2 -processes to ensure that WV2 processes are given higher CPU priority and access to resources -while creation, and that can bring improvements on time spent creating a WV2 instance. Since -this improvement is at the cost of taking higher CPU priority, we introduce `CreationPriority` +WebView2 has functionality enabled by default which raises the launch priority of WebView2 +processes to ensure that WebView2 processes are given higher CPU priority and access to resources +during creation, and that can bring improvements on time spent creating a WebView2 instance. Since +this improvement is at the cost of taking higher CPU priority, we introduce the `CreationPriority` property to give developers an option to decide by themselves. # Description * Setting `CreationPriority` to `COREWEBVIEW2_CREATION_PRIORITY_NORMAL` will signal WebView2 -to use less system resources during the creation. +to have normal priority compared to other processes during the creation of the WebView2 browser +process. * Setting `CreationPriority` to `COREWEBVIEW2_CREATION_PRIORITY_HIGH` will attempt to enable -the launch time improvement functionality with raising the launch priority during the creation. +raise the priority of the creation of the WebView2 browser process. * Default value is `COREWEBVIEW2_CREATION_PRIORITY_HIGH`. -## Notes -* The host app's priority is at least normal before applying the launch time improvement functionality. -Else, WebView2 still get created with normal priority even with `COREWEBVIEW2_CREATION_PRIORITY_HIGH` -setting. -* Currently launch time improvement functionality is only enabled for WebView2 manager process, so the -`CreationPriority` only effects the creation of manager process. `CreationPriority` can play the same -role for other process types like render process if WebView2 opts in launch time improvement functionality -for those types in the future. # Examples ## Win32 C++ ```cpp auto options = Microsoft::WRL::Make(); -// Set `CreationPriority` to `COREWEBVIEW2_CREATION_PRIORITY_NORMAL` if you don't want to boost the -// launch time at the cost of using higher CPU priority during the launch phase. +// Set CreationPriority` to COREWEBVIEW2_CREATION_PRIORITY_NORMAL to signal +// the WebView2 browser process to have normal priorty during creation". options->put_CreationPriority(COREWEBVIEW2_CREATION_PRIORITY_NORMAL); HRESULT hr = CreateCoreWebView2EnvironmentWithOptions( nullptr, m_userDataFolder.c_str(), options.Get(), @@ -65,13 +58,18 @@ interface ICoreWebView2EnvironmentOptions3 : ICoreWebView2EnvironmentOptions2 { [propget] HRESULT CreationPriority([out, retval] COREWEBVIEW2_CREATION_PRIORITY* creationPriority); /// Sets the `CreationPriority` property. - /// The `CreationPriority` property specifies that the creation priority WebView - /// environment attempt to create. - /// Set `CreationPriority` to `COREWEBVIEW2_CREATION_PRIORITY_NORMAL` will create - /// WebView2 with normal priority. - /// Set `CreationPriority` to `COREWEBVIEW2_CREATION_PRIORITY_HIGH` will attempt - /// to create WebView2 with high priority. + /// The `CreationPriority` property specifies the priority used during the WebView2 + /// browser process creation. + /// Set `CreationPriority` to `COREWEBVIEW2_CREATION_PRIORITY_NORMAL` will create the + /// WebView2 browser process with normal priority. + /// Set `CreationPriority` to `COREWEBVIEW2_CREATION_PRIORITY_HIGH` will attempt to + /// create the WebView2 browser process with high priority. /// Default is `COREWEBVIEW2_CREATION_PRIORITY_HIGH`. + /// Note that 1)The host app's priority must be at least normal for + /// COREWEBVIEW2_CREATION_PRIORITY_HIGH to be applied. Else, the WebView2 browser process + /// still get created with normal priority even with `COREWEBVIEW2_CREATION_PRIORITY_HIGH` setting. + /// 2)Currently `CreationPriority` only applies to the creation of the WebView2 browser process. + /// `CreationPriority` may be broadened to apply to other parts of WebView2 creation in the future. // MSOWNERS: wangsongjin@microsoft.com [propput] HRESULT CreationPriority([in] COREWEBVIEW2_CREATION_PRIORITY creationPriority); } From 79ddf258d05a5139d42edd403759a79cb7b66c84 Mon Sep 17 00:00:00 2001 From: Wangsong Jin Date: Mon, 26 Sep 2022 13:48:56 -0700 Subject: [PATCH 07/10] Update StartInBackgroundMode.md --- specs/StartInBackgroundMode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/StartInBackgroundMode.md b/specs/StartInBackgroundMode.md index 309a689a6..c59dfa927 100644 --- a/specs/StartInBackgroundMode.md +++ b/specs/StartInBackgroundMode.md @@ -19,7 +19,7 @@ raise the priority of the creation of the WebView2 browser process. ## Win32 C++ ```cpp auto options = Microsoft::WRL::Make(); -// Set CreationPriority` to COREWEBVIEW2_CREATION_PRIORITY_NORMAL to signal +// Set `CreationPriority` to `COREWEBVIEW2_CREATION_PRIORITY_NORMAL` to signal // the WebView2 browser process to have normal priorty during creation". options->put_CreationPriority(COREWEBVIEW2_CREATION_PRIORITY_NORMAL); HRESULT hr = CreateCoreWebView2EnvironmentWithOptions( From 897e7d62d200246a91046175505537836dbb1f88 Mon Sep 17 00:00:00 2001 From: Wangsong Jin Date: Mon, 26 Sep 2022 14:19:37 -0700 Subject: [PATCH 08/10] Update StartInBackgroundMode.md --- specs/StartInBackgroundMode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/StartInBackgroundMode.md b/specs/StartInBackgroundMode.md index c59dfa927..d6e8f522a 100644 --- a/specs/StartInBackgroundMode.md +++ b/specs/StartInBackgroundMode.md @@ -66,7 +66,7 @@ interface ICoreWebView2EnvironmentOptions3 : ICoreWebView2EnvironmentOptions2 { /// create the WebView2 browser process with high priority. /// Default is `COREWEBVIEW2_CREATION_PRIORITY_HIGH`. /// Note that 1)The host app's priority must be at least normal for - /// COREWEBVIEW2_CREATION_PRIORITY_HIGH to be applied. Else, the WebView2 browser process + /// `COREWEBVIEW2_CREATION_PRIORITY_HIGH` to be applied. Else, the WebView2 browser process /// still get created with normal priority even with `COREWEBVIEW2_CREATION_PRIORITY_HIGH` setting. /// 2)Currently `CreationPriority` only applies to the creation of the WebView2 browser process. /// `CreationPriority` may be broadened to apply to other parts of WebView2 creation in the future. From 7c01a45a3442e29214e2078e7063e5e79e075c13 Mon Sep 17 00:00:00 2001 From: Wangsong Jin Date: Wed, 28 Sep 2022 15:51:35 -0700 Subject: [PATCH 09/10] Update StartInBackgroundMode.md --- specs/StartInBackgroundMode.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/specs/StartInBackgroundMode.md b/specs/StartInBackgroundMode.md index d6e8f522a..a7541edd5 100644 --- a/specs/StartInBackgroundMode.md +++ b/specs/StartInBackgroundMode.md @@ -19,8 +19,9 @@ raise the priority of the creation of the WebView2 browser process. ## Win32 C++ ```cpp auto options = Microsoft::WRL::Make(); -// Set `CreationPriority` to `COREWEBVIEW2_CREATION_PRIORITY_NORMAL` to signal -// the WebView2 browser process to have normal priorty during creation". +/// Set webView2 browser process to have normal priority during creation, +/// which avoids to impact other host application processes acquiring +/// system resources. options->put_CreationPriority(COREWEBVIEW2_CREATION_PRIORITY_NORMAL); HRESULT hr = CreateCoreWebView2EnvironmentWithOptions( nullptr, m_userDataFolder.c_str(), options.Get(), From 018e4202b0ee8ec2fd421c56d8dc5388451d6a0c Mon Sep 17 00:00:00 2001 From: Wangsong Jin Date: Fri, 30 Sep 2022 11:34:52 -0700 Subject: [PATCH 10/10] StartInBackgroundMode.md --- specs/StartInBackgroundMode.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/specs/StartInBackgroundMode.md b/specs/StartInBackgroundMode.md index a7541edd5..42cb80540 100644 --- a/specs/StartInBackgroundMode.md +++ b/specs/StartInBackgroundMode.md @@ -19,9 +19,9 @@ raise the priority of the creation of the WebView2 browser process. ## Win32 C++ ```cpp auto options = Microsoft::WRL::Make(); -/// Set webView2 browser process to have normal priority during creation, -/// which avoids to impact other host application processes acquiring -/// system resources. +/// Set the WebView2 browser process to have normal priority during +/// creation, which avoids to impact other host application +/// processes acquiring system resources. options->put_CreationPriority(COREWEBVIEW2_CREATION_PRIORITY_NORMAL); HRESULT hr = CreateCoreWebView2EnvironmentWithOptions( nullptr, m_userDataFolder.c_str(), options.Get(), @@ -66,11 +66,12 @@ interface ICoreWebView2EnvironmentOptions3 : ICoreWebView2EnvironmentOptions2 { /// Set `CreationPriority` to `COREWEBVIEW2_CREATION_PRIORITY_HIGH` will attempt to /// create the WebView2 browser process with high priority. /// Default is `COREWEBVIEW2_CREATION_PRIORITY_HIGH`. - /// Note that 1)The host app's priority must be at least normal for - /// `COREWEBVIEW2_CREATION_PRIORITY_HIGH` to be applied. Else, the WebView2 browser process - /// still get created with normal priority even with `COREWEBVIEW2_CREATION_PRIORITY_HIGH` setting. - /// 2)Currently `CreationPriority` only applies to the creation of the WebView2 browser process. - /// `CreationPriority` may be broadened to apply to other parts of WebView2 creation in the future. + /// Note that the host app's priority must be at least normal for + /// `COREWEBVIEW2_CREATION_PRIORITY_HIGH` to be applied. Otherwise the WebView2 browser + /// process still get created with normal priority even with `COREWEBVIEW2_CREATION_PRIORITY_HIGH` + /// setting. Additionally, currently `CreationPriority` only applies to the creation of the + /// WebView2 browser process. `CreationPriority` may be broadened to apply to other parts of + /// WebView2 creation in the future. // MSOWNERS: wangsongjin@microsoft.com [propput] HRESULT CreationPriority([in] COREWEBVIEW2_CREATION_PRIORITY creationPriority); }