Skip to content

Commit

Permalink
[M103][Android Tab Restore] Ensure state is saved for background rest…
Browse files Browse the repository at this point in the history
…ored tabs

Mark tabs as needing to be saved by adding them to the save queue for
frozen tabs launched in the background [1].

Tests in separate CL:
https://chromium-review.googlesource.com/c/chromium/src/+/3669171

[1]
https://source.chromium.org/chromium/chromium/src/+/main:chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java;bpv=1;bpt=1;l=148?q=TabPersistentStore&ss=chromium%2Fchromium%2Fsrc&gsn=onNewTabCreated&gs=kythe%3A%2F%2Fchromium.googlesource.com%2Fchromium%2Fsrc%3Flang%3Djava%3Fpath%3D%253Canonymous%2520org.chromium.chrome.browser.tabmodel.TabPersistentStore%25241%253E%23d7a8bad45bf80f06599d409db4667df9d47c90c10ea6b7cdce6b87e457bd4791

(cherry picked from commit e9de4f3)

Bug: 1328828
Change-Id: Ic500b1958cf182f76279b4c0379c5aa01418617e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3669753
Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Reviewed-by: Fred Mello <fredmello@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1007922}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3679819
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Calder Kitagawa <ckitagawa@chromium.org>
Cr-Commit-Position: refs/branch-heads/5060@{#411}
Cr-Branched-From: b83393d-refs/heads/main@{#1002911}
  • Loading branch information
ckitagawa-work authored and Chromium LUCI CQ committed May 31, 2022
1 parent 3547524 commit 3843729
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,10 @@ public boolean createTabWithWebContents(
.setInitiallyHidden(!openInForeground)
.build();
@TabCreationState
int creationState = openInForeground ? TabCreationState.LIVE_IN_FOREGROUND
: TabCreationState.LIVE_IN_BACKGROUND;
int creationState = openInForeground
? TabCreationState.LIVE_IN_FOREGROUND
: ((type == TabLaunchType.FROM_RECENT_TABS) ? TabCreationState.FROZEN_FOR_LAZY_LOAD
: TabCreationState.LIVE_IN_BACKGROUND);
mTabModel.addTab(tab, position, type, creationState);
return true;
}
Expand Down

0 comments on commit 3843729

Please sign in to comment.