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

Side by Side Diff: components/password_manager/core/browser/login_database.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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 bool GetBlacklistLogins( 95 bool GetBlacklistLogins(
96 std::vector<autofill::PasswordForm*>* forms) const; 96 std::vector<autofill::PasswordForm*>* forms) const;
97 97
98 // Deletes the login database file on disk, and creates a new, empty database. 98 // Deletes the login database file on disk, and creates a new, empty database.
99 // This can be used after migrating passwords to some other store, to ensure 99 // This can be used after migrating passwords to some other store, to ensure
100 // that SQLite doesn't leave fragments of passwords in the database file. 100 // that SQLite doesn't leave fragments of passwords in the database file.
101 // Returns true on success; otherwise, whether the file was deleted and 101 // Returns true on success; otherwise, whether the file was deleted and
102 // whether further use of this login database will succeed is unspecified. 102 // whether further use of this login database will succeed is unspecified.
103 bool DeleteAndRecreateDatabaseFile(); 103 bool DeleteAndRecreateDatabaseFile();
104 104
105 // Simulates a failure in the Init() method of any instance. Used for testing.
106 static void set_simulate_init_failure_for_testing(bool fail);
Garrett Casto 2015/01/14 08:50:22 What do you think of instead of adding this field,
engedy 2015/01/14 14:36:54 Sounds great, actually, I did not like the current
107
105 private: 108 private:
106 // Result values for encryption/decryption actions. 109 // Result values for encryption/decryption actions.
107 enum EncryptionResult { 110 enum EncryptionResult {
108 // Success. 111 // Success.
109 ENCRYPTION_RESULT_SUCCESS, 112 ENCRYPTION_RESULT_SUCCESS,
110 // Failure for a specific item (e.g., the encrypted value was manually 113 // Failure for a specific item (e.g., the encrypted value was manually
111 // moved from another machine, and can't be decrypted on this machine). 114 // moved from another machine, and can't be decrypted on this machine).
112 // This is presumed to be a permanent failure. 115 // This is presumed to be a permanent failure.
113 ENCRYPTION_RESULT_ITEM_FAILURE, 116 ENCRYPTION_RESULT_ITEM_FAILURE,
114 // A service-level failure (e.g., on a platform using a keyring, the keyring 117 // A service-level failure (e.g., on a platform using a keyring, the keyring
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 base::FilePath db_path_; 152 base::FilePath db_path_;
150 mutable sql::Connection db_; 153 mutable sql::Connection db_;
151 sql::MetaTable meta_table_; 154 sql::MetaTable meta_table_;
152 155
153 DISALLOW_COPY_AND_ASSIGN(LoginDatabase); 156 DISALLOW_COPY_AND_ASSIGN(LoginDatabase);
154 }; 157 };
155 158
156 } // namespace password_manager 159 } // namespace password_manager
157 160
158 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ 161 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698