Commit d0e00cfe authored by ssid's avatar ssid Committed by Commit Bot

Do not post task to delete obsolete databases.

The delayed task causes crash if shared db is deleted at shutdown before
the task gets executed. This is temporary fix to avoid crashes.

BUG=1014088

Change-Id: Idacdac48b3cccd8265ed8542a251710b0fc5dce9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1935494Reviewed-by: default avataroysteine <oysteine@chromium.org>
Commit-Queue: ssid <ssid@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718966}
parent ab2fcdc2
...@@ -435,23 +435,6 @@ void SharedProtoDatabase::OnDatabaseInit(bool create_if_missing, ...@@ -435,23 +435,6 @@ void SharedProtoDatabase::OnDatabaseInit(bool create_if_missing,
} }
ProcessInitRequests(status); ProcessInitRequests(status);
if (init_state_ == InitState::kSuccess) {
// Create a ProtoLevelDBWrapper just like we create for each client, for
// deleting data from obsolete clients. It is fine to use the same wrapper
// to clear data from all clients. This object will be destroyed after
// clearing data for all these clients.
auto db_wrapper =
std::make_unique<ProtoLevelDBWrapper>(task_runner_, db_.get());
Callbacks::UpdateCallback obsolete_cleared_callback = base::DoNothing();
base::SequencedTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE,
base::BindOnce(&SharedProtoDatabaseClient::
DestroyObsoleteSharedProtoDatabaseClients,
std::move(db_wrapper),
std::move(obsolete_cleared_callback)),
kDelayToClearObsoleteDatabase);
}
} }
void SharedProtoDatabase::OnUpdateCorruptionCountAtInit(bool success) { void SharedProtoDatabase::OnUpdateCorruptionCountAtInit(bool success) {
......
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