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

Side by Side Diff: chrome/browser/password_manager/password_store_win.h

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: Fix nits, rework unittests. 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 unified diff | Download patch
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 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_ 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_ 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "components/password_manager/core/browser/password_store_default.h" 9 #include "components/password_manager/core/browser/password_store_default.h"
10 10
11 class PasswordWebDataService; 11 class PasswordWebDataService;
12 12
13 namespace autofill { 13 namespace autofill {
14 struct PasswordForm; 14 struct PasswordForm;
15 } 15 }
16 16
17 namespace password_manager { 17 namespace password_manager {
18 class LoginDatabase; 18 class LoginDatabase;
19 } 19 }
20 20
21 // Windows PasswordStore implementation that uses the default implementation, 21 // Windows PasswordStore implementation that uses the default implementation,
22 // but also uses IE7 passwords if no others found. 22 // but also uses IE7 passwords if no others found.
23 class PasswordStoreWin : public password_manager::PasswordStoreDefault { 23 class PasswordStoreWin : public password_manager::PasswordStoreDefault {
24 public: 24 public:
25 // PasswordWebDataService is only used for IE7 password fetching. 25 // The |login_db| must not have been Init()-ed yet. It will be initialized in
26 // a deferred manner on the DB thread. The |web_data_service| is only used for
27 // IE7 password fetching.
26 PasswordStoreWin( 28 PasswordStoreWin(
27 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, 29 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner,
28 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner, 30 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner,
29 password_manager::LoginDatabase* login_database, 31 scoped_ptr<password_manager::LoginDatabase> login_db,
30 const scoped_refptr<PasswordWebDataService>& web_data_service); 32 const scoped_refptr<PasswordWebDataService>& web_data_service);
31 33
32 // PasswordStore: 34 // PasswordStore:
33 virtual void Shutdown() override; 35 virtual void Shutdown() override;
34 36
35 private: 37 private:
36 class DBHandler; 38 class DBHandler;
37 39
38 virtual ~PasswordStoreWin(); 40 virtual ~PasswordStoreWin();
39 41
40 // Invoked from Shutdown, but run on the DB thread. 42 // Invoked from Shutdown, but run on the DB thread.
41 void ShutdownOnDBThread(); 43 void ShutdownOnDBThread();
42 44
43 virtual void GetLoginsImpl( 45 virtual void GetLoginsImpl(
44 const autofill::PasswordForm& form, 46 const autofill::PasswordForm& form,
45 AuthorizationPromptPolicy prompt_policy, 47 AuthorizationPromptPolicy prompt_policy,
46 const ConsumerCallbackRunner& callback_runner) override; 48 const ConsumerCallbackRunner& callback_runner) override;
47 49
48 void GetIE7LoginIfNecessary( 50 void GetIE7LoginIfNecessary(
49 const autofill::PasswordForm& form, 51 const autofill::PasswordForm& form,
50 const ConsumerCallbackRunner& callback_runner, 52 const ConsumerCallbackRunner& callback_runner,
51 const std::vector<autofill::PasswordForm*>& matched_forms); 53 const std::vector<autofill::PasswordForm*>& matched_forms);
52 54
53 scoped_ptr<DBHandler> db_handler_; 55 scoped_ptr<DBHandler> db_handler_;
54 56
55 DISALLOW_COPY_AND_ASSIGN(PasswordStoreWin); 57 DISALLOW_COPY_AND_ASSIGN(PasswordStoreWin);
56 }; 58 };
57 59
58 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_ 60 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698