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

Side by Side Diff: components/password_manager/core/browser/login_database.h

Issue 2126713006: Refactor LoginDatabase migration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix some tests Created 4 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
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 static EncryptionResult EncryptedString(const base::string16& plain_text, 163 static EncryptionResult EncryptedString(const base::string16& plain_text,
164 std::string* cipher_text); 164 std::string* cipher_text);
165 165
166 // Decrypts cipher_text, setting the value of plain_text and returning true if 166 // Decrypts cipher_text, setting the value of plain_text and returning true if
167 // successful, or returning false and leaving plain_text unchanged if 167 // successful, or returning false and leaving plain_text unchanged if
168 // decryption fails (e.g., if the underlying OS encryption system is 168 // decryption fails (e.g., if the underlying OS encryption system is
169 // temporarily unavailable). 169 // temporarily unavailable).
170 static EncryptionResult DecryptedString(const std::string& cipher_text, 170 static EncryptionResult DecryptedString(const std::string& cipher_text,
171 base::string16* plain_text); 171 base::string16* plain_text);
172 172
173 bool InitLoginsTable();
174 bool MigrateOldVersionsAsNeeded();
175
176 // Fills |form| from the values in the given statement (which is assumed to 173 // Fills |form| from the values in the given statement (which is assumed to
177 // be of the form used by the Get*Logins methods). 174 // be of the form used by the Get*Logins methods).
178 // Returns the EncryptionResult from decrypting the password in |s|; if not 175 // Returns the EncryptionResult from decrypting the password in |s|; if not
179 // ENCRYPTION_RESULT_SUCCESS, |form| is not filled. 176 // ENCRYPTION_RESULT_SUCCESS, |form| is not filled.
180 static EncryptionResult InitPasswordFormFromStatement( 177 static EncryptionResult InitPasswordFormFromStatement(
181 autofill::PasswordForm* form, 178 autofill::PasswordForm* form,
182 sql::Statement* s); 179 sql::Statement* s);
183 180
184 // Gets all blacklisted or all non-blacklisted (depending on |blacklisted|) 181 // Gets all blacklisted or all non-blacklisted (depending on |blacklisted|)
185 // credentials. On success returns true and overwrites |forms| with the 182 // credentials. On success returns true and overwrites |forms| with the
(...skipping 14 matching lines...) Expand all
200 sql::MetaTable meta_table_; 197 sql::MetaTable meta_table_;
201 StatisticsTable stats_table_; 198 StatisticsTable stats_table_;
202 199
203 // If set to 'true', then the password values are cleared before encrypting 200 // If set to 'true', then the password values are cleared before encrypting
204 // and storing in the database. At the same time AddLogin/UpdateLogin return 201 // and storing in the database. At the same time AddLogin/UpdateLogin return
205 // PasswordStoreChangeList containing the real password. 202 // PasswordStoreChangeList containing the real password.
206 // This is a temporary measure for migration the Keychain on Mac. 203 // This is a temporary measure for migration the Keychain on Mac.
207 // crbug.com/466638 204 // crbug.com/466638
208 bool clear_password_values_; 205 bool clear_password_values_;
209 206
207 // These cached strings are used to build SQL statements.
208 std::string add_statement_;
209 std::string add_replace_statement_;
210 std::string update_statement_;
211 std::string delete_statement_;
212 std::string autosignin_statement_;
213 std::string get_statement_;
214 std::string get_statement_psl_;
215 std::string get_statement_federated_;
216 std::string get_statement_psl_federated_;
217 std::string created_statement_;
218 std::string synced_statement_;
219 std::string blacklisted_statement_;
220 std::string encrypted_statement_;
221
210 DISALLOW_COPY_AND_ASSIGN(LoginDatabase); 222 DISALLOW_COPY_AND_ASSIGN(LoginDatabase);
211 }; 223 };
212 224
213 } // namespace password_manager 225 } // namespace password_manager
214 226
215 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ 227 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698