Skip to content

Commit c2ecf8c

Browse files
authored
Update UpdateRuntime.md
1 parent d91874a commit c2ecf8c

1 file changed

Lines changed: 13 additions & 16 deletions

File tree

specs/UpdateRuntime.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ async protected bool EnsureWebView2RuntimeVersion(string minimalVersionRequired)
2323
{
2424
auto environment = await CoreWebView2Environment.CreateAsync();
2525
auto updateResult = await environment.UpdateRuntimeAsync();
26-
if (updateResult.UpdateRuntimeStatus != CoreWebView2RuntimeUpdateStatus.Updated)
26+
if (updateResult.UpdateRuntimeStatus != CoreWebView2RuntimeUpdateStatus.LatestVersionInstalled)
2727
return false;
2828
// check runtime version again
2929
currentRuntimeVersion = CoreWebView2Environment.GetAvailableBrowserVersionString();
@@ -75,8 +75,7 @@ void EnsureWebView2RuntimeVersion(std::function<void(bool)> const& callback, std
7575
Callback<ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler>(
7676
[callback, minimalVersionRequired](HRESULT result, ICoreWebView2Environment* environment) -> HRESULT {
7777
wil::com_ptr<ICoreWebView2Environment> webViewEnvironment = environment;
78-
auto experimentalEnvironment3 =
79-
webViewEnvironment.try_query<ICoreWebView2ExperimentalEnvironment3>();
78+
auto experimentalEnvironment3 = webViewEnvironment.try_query<ICoreWebView2ExperimentalEnvironment3>();
8079
HRESULT hr = experimentalEnvironment3->UpdateRuntime(
8180
Callback<ICoreWebView2ExperimentalUpdateRuntimeCompletedHandler>(
8281
[callback, minimalVersionRequired, experimentalEnvironment3](HRESULT errorCode,
@@ -87,7 +86,7 @@ void EnsureWebView2RuntimeVersion(std::function<void(bool)> const& callback, std
8786
{
8887
CHECK_FAILURE(result->get_UpdateRuntimeStatus(&updateStatus));
8988
}
90-
if (updateStatus != COREWEBVIEW2_RUNTIME_UPDATE_STATUS_UPDATED)
89+
if (updateStatus != COREWEBVIEW2_UPDATE_RUNTIME_STATUS_LATEST_VERSION_INSTALLED)
9190
{
9291
callback(false);
9392
}
@@ -118,12 +117,10 @@ See [API Details](#api-details) section below for API reference.
118117
/// Status of UpdateRuntime operation result.
119118
[v1_enum] typedef enum COREWEBVIEW2_UPDATE_RUNTIME_STATUS {
120119
121-
/// No update for Edge WebView2 Runtime is available.
122-
/// Latest version of Edge WebView2 Runtime is already installed.
123-
COREWEBVIEW2_UPDATE_RUNTIME_STATUS_NO_UPDATE,
124-
125-
/// Edge WebView2 Runtime is updated successfully.
126-
COREWEBVIEW2_UPDATE_RUNTIME_STATUS_UPDATED,
120+
/// Latest version of Edge WebView2 Runtime is installed.
121+
/// No update for Edge WebView2 Runtime is available, or Edge WebView2
122+
/// Runtime is updated successfully and latest version is now installed.
123+
COREWEBVIEW2_UPDATE_RUNTIME_STATUS_LATEST_VERSION_INSTALLED,
127124
128125
/// Edge WebView2 Runtime update is blocked by group policy.
129126
COREWEBVIEW2_UPDATE_RUNTIME_STATUS_BLOCKED_BY_POLICY,
@@ -184,8 +181,9 @@ interface ICoreWebView2ExperimentalEnvironment3 : IUnknown {
184181
/// before completed handler for previous call is invoked will fail with
185182
/// `HRESULT_FROM_WIN32(ERROR_BUSY)`.
186183
/// Calling this API repeatedly in a short period of time, will also fail with
187-
/// `HRESULT_FROM_WIN32(ERROR_BUSY)`. Don't call the API more than 3 times
188-
/// within 5 minutes.
184+
/// `HRESULT_FROM_WIN32(ERROR_BUSY)`. To protect accidental abuse of the update
185+
/// service, the implementation throttles the calls of this API to 3 times within
186+
/// 5 minutes in a process.
189187
/// The UpdateRuntime operation is associated with the CoreWebView2Environment
190188
/// object and any ongoing UpdateRuntime operation will be aborted when the
191189
/// associated CoreWebView2Environment along with the CoreWebView2 objects that
@@ -206,10 +204,9 @@ namespace Microsoft.Web.WebView2.Core
206204
{
207205
public enum CoreWebView2UpdateRuntimeStatus
208206
{
209-
NoUpdate = 0,
210-
Updated = 1,
211-
BlockedByPolicy = 2,
212-
Failed = 3,
207+
LatestVersionInstalled = 0,
208+
BlockedByPolicy = 1,
209+
Failed = 2,
213210
}
214211

215212
public partial class CoreWebView2UpdateRuntimeResult

0 commit comments

Comments
 (0)