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

Unified Diff: chrome/browser/password_manager/password_store_factory.cc

Issue 152683002: Passwords: Remove references to BrowserThread from PasswordStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 10 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/password_manager/password_store_factory.cc
diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc
index c7b50a1bdcd2b81322531cec1ca8881a0bdabdab..0281e61b6a3e6ca0e7d1bff20dfc19eb8f91467c 100644
--- a/chrome/browser/password_manager/password_store_factory.cc
+++ b/chrome/browser/password_manager/password_store_factory.cc
@@ -112,20 +112,30 @@ PasswordStoreFactory::BuildServiceInstanceFor(
return NULL;
}
}
+
+ scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner(
+ base::MessageLoopProxy::current());
+ scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner(
+ content::BrowserThread::GetMessageLoopProxyForThread(
+ content::BrowserThread::DB));
+
#if defined(OS_WIN)
- ps = new PasswordStoreWin(
- login_db, profile,
- WebDataService::FromBrowserContext(profile));
+ ps = new PasswordStoreWin(main_thread_runner,
+ db_thread_runner,
+ login_db,
+ profile,
+ WebDataService::FromBrowserContext(profile));
#elif defined(OS_MACOSX)
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseMockKeychain)) {
- ps = new PasswordStoreMac(new crypto::MockAppleKeychain(), login_db);
- } else {
- ps = new PasswordStoreMac(new crypto::AppleKeychain(), login_db);
- }
+ crypto::AppleKeychain* keychain =
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseMockKeychain) ?
+ new crypto::MockAppleKeychain() : new crypto::AppleKeychain();
+ ps = new PasswordStoreMac(
+ main_thread_runner, db_thread_runner, keychain, login_db);
#elif defined(OS_CHROMEOS) || defined(OS_ANDROID)
// For now, we use PasswordStoreDefault. We might want to make a native
// backend for PasswordStoreX (see below) in the future though.
- ps = new PasswordStoreDefault(login_db, profile);
+ ps = new PasswordStoreDefault(
+ main_thread_runner, db_thread_runner, login_db, profile);
#elif defined(USE_X11)
// On POSIX systems, we try to use the "native" password management system of
// the desktop environment currently running, allowing GNOME Keyring in XFCE.
@@ -180,12 +190,18 @@ PasswordStoreFactory::BuildServiceInstanceFor(
"more information about password storage options.";
}
- ps = new PasswordStoreX(login_db, profile, backend.release());
+ ps = new PasswordStoreX(main_thread_runner,
+ db_thread_runner,
+ login_db,
+ profile,
+ backend.release());
#elif defined(USE_OZONE)
- ps = new PasswordStoreDefault(login_db, profile);
+ ps = new PasswordStoreDefault(
+ main_thread_runner, db_thread_runner, login_db, profile);
#else
NOTIMPLEMENTED();
#endif
+
if (!ps.get())
delete login_db;

Powered by Google App Engine
This is Rietveld 408576698