Commit e69fa8e8 authored by hashimoto's avatar hashimoto Committed by Commit bot

Stop deleting ShortcutsDatabase on the UI thread during shutdown

Deleting ShortcutsDatabase on the UI thread results in destructing sql::Connection.
This results in disk IO and slows down shutdown.

BUG=480822

Review URL: https://codereview.chromium.org/1105843002

Cr-Commit-Position: refs/heads/master@{#327231}
parent 0fc95e9d
...@@ -146,6 +146,13 @@ void ShortcutsBackend::AddOrUpdateShortcut(const base::string16& text, ...@@ -146,6 +146,13 @@ void ShortcutsBackend::AddOrUpdateShortcut(const base::string16& text,
} }
ShortcutsBackend::~ShortcutsBackend() { ShortcutsBackend::~ShortcutsBackend() {
if (db_) {
auto* db = db_.get();
db->AddRef();
db_ = nullptr;
if (!BrowserThread::ReleaseSoon(BrowserThread::DB, FROM_HERE, db))
db->Release();
}
} }
// static // static
......
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