Commit 56917239 authored by Alex Ilin's avatar Alex Ilin Committed by Commit Bot

Revert "Don't call restoreTabs(false) on background thread"

This reverts commit e9391ceb.

Reason for revert: causes failures on Lollipop Phone Tester https://crbug.com/1151882

Original change's description:
> Don't call restoreTabs(false) on background thread
>
> The TabState replacement CriticalPersistedTabData makes the assumption
> that it is called from the UI thread. This is not the case in for
> restoreTabs(false) which is explicitly called on the background thread
> and causes the new Tab persistence system to crash. After a deep dive, I
> determined that restoreTabs(false) is equivalent to loadNextTab()
> because all the code in restoreTabs is skipped except for loadNextTab()
> (since setActiveTab is false). After studying loadNextTab() I found that
> the 'heavy lifting code' (e.g saving, deletion) is explicitly called
> on the background thread so calling loadNextTab() or restoreTabs(false)
> from the background thread is not necessary. Calling loadNextTab or
> restoreTabs(false) from the UI thread will not cause a performance
> regression as the 'heavy lifting' code is already delegated to the
> background thread and in doing so will result in the correct consumption
> of CriticalPersistedTabData.
>
> Bug: 1148972
> Change-Id: I15cfd90125039cf957b88148881765a59fda4556
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2548503
> Reviewed-by: David Trainor <dtrainor@chromium.org>
> Reviewed-by: Mark Pearson <mpearson@chromium.org>
> Commit-Queue: David Maunder <davidjm@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#829318}

TBR=mpearson@chromium.org,nyquist@chromium.org,dtrainor@chromium.org,davidjm@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1148972
Change-Id: I0542f6655a1e592d3d070462d5a02734b660a299
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2553425Reviewed-by: default avatarAlex Ilin <alexilin@chromium.org>
Commit-Queue: Alex Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830159}
parent 6f50027c
...@@ -459,7 +459,9 @@ public class TabPersistentStore extends TabPersister { ...@@ -459,7 +459,9 @@ public class TabPersistentStore extends TabPersister {
} }
// Restore the tabs from the second activity asynchronously. // Restore the tabs from the second activity asynchronously.
loadNextTab(); PostTask.postTask(TaskTraits.BEST_EFFORT_MAY_BLOCK, () -> {
restoreTabs(false);
});
} }
/** /**
......
...@@ -1956,21 +1956,6 @@ ...@@ -1956,21 +1956,6 @@
] ]
} }
], ],
"CriticalPersistedTabData": [
{
"platforms": [
"android"
],
"experiments": [
{
"name": "Enabled",
"enable_features": [
"CriticalPersistedTabData"
]
}
]
}
],
"CrosSchedulerCore": [ "CrosSchedulerCore": [
{ {
"platforms": [ "platforms": [
......
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