Commit 43b1143f authored by Nicolas Ouellet-Payeur's avatar Nicolas Ouellet-Payeur Committed by Commit Bot

Destroy AccessContextAuditDatabase on an IO thread

This objects holds an sql::Database, so its destructor can do IO. But
it was destroyed on the UI thread.

Bug: 1141999, 88586
Change-Id: I5ad15deaf7eb3ab5c234d1d4b629dc65216d780b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2495351Reviewed-by: default avatarChristian Dullweber <dullweber@chromium.org>
Commit-Queue: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820754}
parent 2ab00641
......@@ -54,7 +54,11 @@ void AccessContextAuditService::CookieAccessHelper::FlushCookieRecords() {
AccessContextAuditService::AccessContextAuditService(Profile* profile)
: clock_(base::DefaultClock::GetInstance()), profile_(profile) {}
AccessContextAuditService::~AccessContextAuditService() = default;
AccessContextAuditService::~AccessContextAuditService() {
// This destructor may do I/O, so destroy it on the database task runner.
database_task_runner_->ReleaseSoon(FROM_HERE, std::move(database_));
}
bool AccessContextAuditService::Init(
const base::FilePath& database_dir,
......
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