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

Side by Side Diff: chrome/browser/password_manager/password_store_factory.cc

Issue 10824008: Annotate calls to SQLite functions - they have to be executed on a thread allowing IO access. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/net/sqlite_server_bound_cert_store.cc ('k') | sql/connection.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/password_manager/password_store_factory.h" 5 #include "chrome/browser/password_manager/password_store_factory.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "chrome/browser/password_manager/login_database.h" 9 #include "chrome/browser/password_manager/login_database.h"
10 #include "chrome/browser/password_manager/password_store.h" 10 #include "chrome/browser/password_manager/password_store.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 return id; 92 return id;
93 } 93 }
94 #endif 94 #endif
95 95
96 scoped_refptr<RefcountedProfileKeyedService> 96 scoped_refptr<RefcountedProfileKeyedService>
97 PasswordStoreFactory::BuildServiceInstanceFor(Profile* profile) const { 97 PasswordStoreFactory::BuildServiceInstanceFor(Profile* profile) const {
98 scoped_refptr<PasswordStore> ps; 98 scoped_refptr<PasswordStore> ps;
99 FilePath login_db_file_path = profile->GetPath(); 99 FilePath login_db_file_path = profile->GetPath();
100 login_db_file_path = login_db_file_path.Append(chrome::kLoginDataFileName); 100 login_db_file_path = login_db_file_path.Append(chrome::kLoginDataFileName);
101 LoginDatabase* login_db = new LoginDatabase(); 101 LoginDatabase* login_db = new LoginDatabase();
102 if (!login_db->Init(login_db_file_path)) { 102 {
103 LOG(ERROR) << "Could not initialize login database."; 103 // TODO(paivanof@gmail.com): execution of login_db->Init() should go
104 delete login_db; 104 // to DB thread. http://crbug.com/138903
105 return NULL; 105 base::ThreadRestrictions::ScopedAllowIO allow_io;
106 if (!login_db->Init(login_db_file_path)) {
107 LOG(ERROR) << "Could not initialize login database.";
108 delete login_db;
109 return NULL;
110 }
106 } 111 }
107 #if defined(OS_WIN) 112 #if defined(OS_WIN)
108 ps = new PasswordStoreWin( 113 ps = new PasswordStoreWin(
109 login_db, profile, 114 login_db, profile,
110 WebDataServiceFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS)); 115 WebDataServiceFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS));
111 #elif defined(OS_MACOSX) 116 #elif defined(OS_MACOSX)
112 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseMockKeychain)) { 117 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseMockKeychain)) {
113 ps = new PasswordStoreMac(new crypto::MockKeychain(), login_db); 118 ps = new PasswordStoreMac(new crypto::MockKeychain(), login_db);
114 } else { 119 } else {
115 ps = new PasswordStoreMac(new crypto::MacKeychain(), login_db); 120 ps = new PasswordStoreMac(new crypto::MacKeychain(), login_db);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 #endif 205 #endif
201 } 206 }
202 207
203 bool PasswordStoreFactory::ServiceRedirectedInIncognito() { 208 bool PasswordStoreFactory::ServiceRedirectedInIncognito() {
204 return true; 209 return true;
205 } 210 }
206 211
207 bool PasswordStoreFactory::ServiceIsNULLWhileTesting() { 212 bool PasswordStoreFactory::ServiceIsNULLWhileTesting() {
208 return true; 213 return true;
209 } 214 }
OLDNEW
« no previous file with comments | « chrome/browser/net/sqlite_server_bound_cert_store.cc ('k') | sql/connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698