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

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

Issue 838453003: Open the LoginDatabase on the DB thread, not the UI thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac namespace fixes. Created 5 years, 11 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 a23c2354530a4b302a5a4beb370ba698e8d5119f..1235604a11f9adf2ce9be31ee587261c3e6386bd 100644
--- a/chrome/browser/password_manager/password_store_factory.cc
+++ b/chrome/browser/password_manager/password_store_factory.cc
@@ -18,7 +18,6 @@
#include "chrome/common/chrome_switches.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/os_crypt/os_crypt_switches.h"
-#include "components/password_manager/core/browser/login_database.h"
#include "components/password_manager/core/browser/password_store.h"
#include "components/password_manager/core/browser/password_store_default.h"
#include "components/password_manager/core/common/password_manager_pref_names.h"
@@ -148,17 +147,6 @@ KeyedService* PasswordStoreFactory::BuildServiceInstanceFor(
base::FilePath login_db_file_path = profile->GetPath();
login_db_file_path = login_db_file_path.Append(chrome::kLoginDataFileName);
- scoped_ptr<password_manager::LoginDatabase> login_db(
- new password_manager::LoginDatabase());
- {
- // TODO(paivanof@gmail.com): execution of login_db->Init() should go
- // to DB thread. http://crbug.com/138903
- base::ThreadRestrictions::ScopedAllowIO allow_io;
- if (!login_db->Init(login_db_file_path)) {
- LOG(ERROR) << "Could not initialize login database.";
- return NULL;
- }
- }
scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner(
base::MessageLoopProxy::current());
@@ -170,7 +158,7 @@ KeyedService* PasswordStoreFactory::BuildServiceInstanceFor(
#if defined(OS_WIN)
ps = new PasswordStoreWin(main_thread_runner,
db_thread_runner,
- login_db.release(),
+ login_db_file_path,
WebDataServiceFactory::GetPasswordWebDataForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS));
#elif defined(OS_MACOSX)
@@ -180,12 +168,12 @@ KeyedService* PasswordStoreFactory::BuildServiceInstanceFor(
? new crypto::MockAppleKeychain()
: new crypto::AppleKeychain();
ps = new PasswordStoreMac(
- main_thread_runner, db_thread_runner, keychain, login_db.release());
+ main_thread_runner, db_thread_runner, keychain, login_db_file_path);
#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 password_manager::PasswordStoreDefault(
- main_thread_runner, db_thread_runner, login_db.release());
+ main_thread_runner, db_thread_runner, login_db_file_path);
#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.
@@ -242,7 +230,7 @@ KeyedService* PasswordStoreFactory::BuildServiceInstanceFor(
ps = new PasswordStoreX(main_thread_runner,
db_thread_runner,
- login_db.release(),
+ login_db_file_path,
backend.release());
#elif defined(USE_OZONE)
ps = new password_manager::PasswordStoreDefault(

Powered by Google App Engine
This is Rietveld 408576698