| OLD | NEW |
| 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 #include "components/password_manager/core/browser/login_database.h" | 5 #include "components/password_manager/core/browser/login_database.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 form->password_value = decrypted_password; | 1013 form->password_value = decrypted_password; |
| 1014 form->submit_element = s.ColumnString16(COLUMN_SUBMIT_ELEMENT); | 1014 form->submit_element = s.ColumnString16(COLUMN_SUBMIT_ELEMENT); |
| 1015 tmp = s.ColumnString(COLUMN_SIGNON_REALM); | 1015 tmp = s.ColumnString(COLUMN_SIGNON_REALM); |
| 1016 form->signon_realm = tmp; | 1016 form->signon_realm = tmp; |
| 1017 form->ssl_valid = (s.ColumnInt(COLUMN_SSL_VALID) > 0); | 1017 form->ssl_valid = (s.ColumnInt(COLUMN_SSL_VALID) > 0); |
| 1018 form->preferred = (s.ColumnInt(COLUMN_PREFERRED) > 0); | 1018 form->preferred = (s.ColumnInt(COLUMN_PREFERRED) > 0); |
| 1019 form->date_created = | 1019 form->date_created = |
| 1020 base::Time::FromInternalValue(s.ColumnInt64(COLUMN_DATE_CREATED)); | 1020 base::Time::FromInternalValue(s.ColumnInt64(COLUMN_DATE_CREATED)); |
| 1021 form->blacklisted_by_user = (s.ColumnInt(COLUMN_BLACKLISTED_BY_USER) > 0); | 1021 form->blacklisted_by_user = (s.ColumnInt(COLUMN_BLACKLISTED_BY_USER) > 0); |
| 1022 int scheme_int = s.ColumnInt(COLUMN_SCHEME); | 1022 int scheme_int = s.ColumnInt(COLUMN_SCHEME); |
| 1023 DCHECK((scheme_int >= 0) && (scheme_int <= PasswordForm::SCHEME_OTHER)); | 1023 DCHECK_LE(0, scheme_int); |
| 1024 DCHECK_GE(PasswordForm::SCHEME_LAST, scheme_int); |
| 1024 form->scheme = static_cast<PasswordForm::Scheme>(scheme_int); | 1025 form->scheme = static_cast<PasswordForm::Scheme>(scheme_int); |
| 1025 int type_int = s.ColumnInt(COLUMN_PASSWORD_TYPE); | 1026 int type_int = s.ColumnInt(COLUMN_PASSWORD_TYPE); |
| 1026 DCHECK(type_int >= 0 && type_int <= PasswordForm::TYPE_GENERATED); | 1027 DCHECK(type_int >= 0 && type_int <= PasswordForm::TYPE_GENERATED); |
| 1027 form->type = static_cast<PasswordForm::Type>(type_int); | 1028 form->type = static_cast<PasswordForm::Type>(type_int); |
| 1028 if (s.ColumnByteLength(COLUMN_POSSIBLE_USERNAMES)) { | 1029 if (s.ColumnByteLength(COLUMN_POSSIBLE_USERNAMES)) { |
| 1029 base::Pickle pickle( | 1030 base::Pickle pickle( |
| 1030 static_cast<const char*>(s.ColumnBlob(COLUMN_POSSIBLE_USERNAMES)), | 1031 static_cast<const char*>(s.ColumnBlob(COLUMN_POSSIBLE_USERNAMES)), |
| 1031 s.ColumnByteLength(COLUMN_POSSIBLE_USERNAMES)); | 1032 s.ColumnByteLength(COLUMN_POSSIBLE_USERNAMES)); |
| 1032 form->other_possible_usernames = DeserializeVector(pickle); | 1033 form->other_possible_usernames = DeserializeVector(pickle); |
| 1033 } | 1034 } |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1242 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering", | 1243 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering", |
| 1243 psl_domain_match_metric, PSL_DOMAIN_MATCH_COUNT); | 1244 psl_domain_match_metric, PSL_DOMAIN_MATCH_COUNT); |
| 1244 } | 1245 } |
| 1245 | 1246 |
| 1246 if (!statement->Succeeded()) | 1247 if (!statement->Succeeded()) |
| 1247 return false; | 1248 return false; |
| 1248 return true; | 1249 return true; |
| 1249 } | 1250 } |
| 1250 | 1251 |
| 1251 } // namespace password_manager | 1252 } // namespace password_manager |
| OLD | NEW |