Commit e4948281 authored by Benoit Lize's avatar Benoit Lize Committed by Chromium LUCI CQ

[PartitionAlloc] Don't post several purge tasks at the same time.

ThreadCacheRegistry::StartPeriodicPurge() can be called several times,
triggering a DCHECK(), or posting multiple tasks on non-DCHECK()
builds. This happens in particular when the browser is first started in
minimal mode, then in regular mode on Android. Make sure that only one
task is posted.

Issue discovered by tasak@.

Bug: 998048
Change-Id: I7cea58fa0f49487504869f87fec8490e04616aee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2613840Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarTakashi Sakamoto <tasak@google.com>
Commit-Queue: Benoit L <lizeb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842471}
parent 107e1a65
......@@ -106,7 +106,9 @@ void ThreadCacheRegistry::PurgeAll() {
}
void ThreadCacheRegistry::StartPeriodicPurge() {
PostDelayedPurgeTask();
// Can be called several times, don't post multiple tasks.
if (!has_pending_purge_task_)
PostDelayedPurgeTask();
}
void ThreadCacheRegistry::PostDelayedPurgeTask() {
......
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