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

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

Issue 10701043: Make ShortcutsBackend a ProfileKeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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
Index: chrome/browser/history/shortcuts_backend.cc
===================================================================
--- chrome/browser/history/shortcuts_backend.cc (revision 144929)
+++ chrome/browser/history/shortcuts_backend.cc (working copy)
@@ -81,11 +81,11 @@
// ShortcutsBackend -----------------------------------------------------------
-ShortcutsBackend::ShortcutsBackend(const FilePath& db_folder_path,
- Profile *profile)
+ShortcutsBackend::ShortcutsBackend(Profile* profile, bool suppress_db)
: current_state_(NOT_INITIALIZED),
- db_(new ShortcutsDatabase(db_folder_path)),
- no_db_access_(db_folder_path.empty()) {
+ no_db_access_(suppress_db) {
+ if (!suppress_db)
+ db_ = new ShortcutsDatabase(profile);
// |profile| can be NULL in tests.
if (profile) {
notification_registrar_.Add(this, chrome::NOTIFICATION_OMNIBOX_OPENED_URL,
@@ -264,4 +264,10 @@
match.description_class, base::Time::Now(), 1));
}
+void ShortcutsBackend::ShutdownOnUIThread() {
+ DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) ||
+ BrowserThread::CurrentlyOn(BrowserThread::UI));
+ notification_registrar_.RemoveAll();
+}
+
} // namespace history

Powered by Google App Engine
This is Rietveld 408576698