Skip to content

Commit 50abcf6

Browse files
authored
Update and rename SetMemoryUsageLevel.md to MemoryUsageTargetLevel.md
1 parent 669ba34 commit 50abcf6

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,16 @@ interface ICoreWebView2_6 : ICoreWebView2
124124
/// It is not neccesary to set CoreWebView2Controller's IsVisible property to false when calling the API.
125125
/// It is a best effort operation to change memory usage level, and the API will return before the operation completes.
126126
/// Setting the level to `COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL_LOW` could potentially cause
127-
/// memory for some WebView browser processes to be swapped out to disk when needed. Therefore,
128-
/// it is important for the app to set the level back to `COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL_NORMAL`
127+
/// memory for some WebView browser processes to be swapped out to disk when needed.
128+
/// It is a best effort to reduce memory usage as much as possible. If script runs after we swapped
129+
/// related memory out, we will swap the memory in to ensure script can still run. But performance might
130+
/// be impacted.
131+
/// Therefore, it is important for the app to set the level back to `COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL_NORMAL`
129132
/// when the app becomes active again to have a smooth user experience.
130133
/// Setting memory usage level back to normal will not happen automatically.
131134
/// An app should choose to use either the combination of `TrySuspend` and `Resume` or the combination
132-
/// of setting MemoryUsageTargetLevel to low and normal. It is not advisable to mix them.
135+
/// of setting `MemoryUsageTargetLevel` to low and normal. It is not advisable to mix them.
136+
/// Trying to set `MemoryUsageTargetLevel`while suspended will fail with `HRESULT_FROM_WIN32(ERROR_INVALID_STATE)`.
133137
/// The TrySuspend and Resume methods will change the MemoryUsageTargetLevel.
134138
/// TrySuspend will automatically set MemoryUsageTargetLevel to low while Resume on suspended WebView
135139
/// will automatically set MemoryUsageTargetLevel to normal.

0 commit comments

Comments
 (0)