Commit abd4bd5f authored by Kuo-Hsin Yang's avatar Kuo-Hsin Yang Committed by Commit Bot

Discard protected tabs when all remaining tabs are protected

The protected tabs (tabs that CanDiscard() returns false) have lower
discard priority. When system is in low memory and all remaining tabs
are protected, some protected tab shall be discarded to avoid OOM.

Bug: 885087
Change-Id: I073a4946e82898a7f16c2ef11441e342c58b99e8
Reviewed-on: https://chromium-review.googlesource.com/c/1250823Reviewed-by: default avatarFrançois Doray <fdoray@chromium.org>
Reviewed-by: default avatarCheng-Yu Lee <cylee@chromium.org>
Commit-Queue: Vovo Yang <vovoy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596085}
parent 5d7cf189
...@@ -536,9 +536,6 @@ bool TabManagerDelegate::KillArcProcess(const int nspid) { ...@@ -536,9 +536,6 @@ bool TabManagerDelegate::KillArcProcess(const int nspid) {
bool TabManagerDelegate::KillTab(LifecycleUnit* lifecycle_unit, bool TabManagerDelegate::KillTab(LifecycleUnit* lifecycle_unit,
::mojom::LifecycleUnitDiscardReason reason) { ::mojom::LifecycleUnitDiscardReason reason) {
DecisionDetails decision_details;
if (!lifecycle_unit->CanDiscard(reason, &decision_details))
return false;
bool did_discard = lifecycle_unit->Discard(reason); bool did_discard = lifecycle_unit->Discard(reason);
return did_discard; return did_discard;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment