Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4888)

Unified Diff: chrome/browser/autocomplete/shortcuts_backend.cc

Issue 1105843002: Stop deleting ShortcutsDatabase on the UI thread during shutdown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix leak in test Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/shortcuts_backend.cc
diff --git a/chrome/browser/autocomplete/shortcuts_backend.cc b/chrome/browser/autocomplete/shortcuts_backend.cc
index 4da4f902022bc6628f85e69fe59a42c82048d8ce..003be7055b202d7f3f00ae55f62010fb16cee093 100644
--- a/chrome/browser/autocomplete/shortcuts_backend.cc
+++ b/chrome/browser/autocomplete/shortcuts_backend.cc
@@ -146,6 +146,13 @@ void ShortcutsBackend::AddOrUpdateShortcut(const base::string16& text,
}
ShortcutsBackend::~ShortcutsBackend() {
+ if (db_) {
+ auto* db = db_.get();
+ db->AddRef();
+ db_ = nullptr;
+ if (!BrowserThread::ReleaseSoon(BrowserThread::DB, FROM_HERE, db))
+ db->Release();
+ }
}
// static
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698