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

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: 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 cc2fa43c2985c94ef2264342e628f73671f51484..a4b4894892847771a7d5383fd2983266f9372f3d 100644
--- a/chrome/browser/password_manager/password_store_factory.cc
+++ b/chrome/browser/password_manager/password_store_factory.cc
@@ -17,7 +17,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"
@@ -147,17 +146,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());
@@ -169,7 +157,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, Profile::EXPLICIT_ACCESS));
#elif defined(OS_MACOSX)
@@ -241,7 +229,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