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 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 form->password_value = decrypted_password; | 1007 form->password_value = decrypted_password; |
1008 form->submit_element = s.ColumnString16(COLUMN_SUBMIT_ELEMENT); | 1008 form->submit_element = s.ColumnString16(COLUMN_SUBMIT_ELEMENT); |
1009 tmp = s.ColumnString(COLUMN_SIGNON_REALM); | 1009 tmp = s.ColumnString(COLUMN_SIGNON_REALM); |
1010 form->signon_realm = tmp; | 1010 form->signon_realm = tmp; |
1011 form->ssl_valid = (s.ColumnInt(COLUMN_SSL_VALID) > 0); | 1011 form->ssl_valid = (s.ColumnInt(COLUMN_SSL_VALID) > 0); |
1012 form->preferred = (s.ColumnInt(COLUMN_PREFERRED) > 0); | 1012 form->preferred = (s.ColumnInt(COLUMN_PREFERRED) > 0); |
1013 form->date_created = | 1013 form->date_created = |
1014 base::Time::FromInternalValue(s.ColumnInt64(COLUMN_DATE_CREATED)); | 1014 base::Time::FromInternalValue(s.ColumnInt64(COLUMN_DATE_CREATED)); |
1015 form->blacklisted_by_user = (s.ColumnInt(COLUMN_BLACKLISTED_BY_USER) > 0); | 1015 form->blacklisted_by_user = (s.ColumnInt(COLUMN_BLACKLISTED_BY_USER) > 0); |
1016 int scheme_int = s.ColumnInt(COLUMN_SCHEME); | 1016 int scheme_int = s.ColumnInt(COLUMN_SCHEME); |
1017 DCHECK((scheme_int >= 0) && (scheme_int <= PasswordForm::SCHEME_OTHER)); | 1017 DCHECK_LE(0, scheme_int); |
| 1018 DCHECK_GE(PasswordForm::SCHEME_LAST, scheme_int); |
1018 form->scheme = static_cast<PasswordForm::Scheme>(scheme_int); | 1019 form->scheme = static_cast<PasswordForm::Scheme>(scheme_int); |
1019 int type_int = s.ColumnInt(COLUMN_PASSWORD_TYPE); | 1020 int type_int = s.ColumnInt(COLUMN_PASSWORD_TYPE); |
1020 DCHECK(type_int >= 0 && type_int <= PasswordForm::TYPE_GENERATED); | 1021 DCHECK(type_int >= 0 && type_int <= PasswordForm::TYPE_GENERATED); |
1021 form->type = static_cast<PasswordForm::Type>(type_int); | 1022 form->type = static_cast<PasswordForm::Type>(type_int); |
1022 if (s.ColumnByteLength(COLUMN_POSSIBLE_USERNAMES)) { | 1023 if (s.ColumnByteLength(COLUMN_POSSIBLE_USERNAMES)) { |
1023 base::Pickle pickle( | 1024 base::Pickle pickle( |
1024 static_cast<const char*>(s.ColumnBlob(COLUMN_POSSIBLE_USERNAMES)), | 1025 static_cast<const char*>(s.ColumnBlob(COLUMN_POSSIBLE_USERNAMES)), |
1025 s.ColumnByteLength(COLUMN_POSSIBLE_USERNAMES)); | 1026 s.ColumnByteLength(COLUMN_POSSIBLE_USERNAMES)); |
1026 form->other_possible_usernames = DeserializeVector(pickle); | 1027 form->other_possible_usernames = DeserializeVector(pickle); |
1027 } | 1028 } |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering", | 1246 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering", |
1246 psl_domain_match_metric, PSL_DOMAIN_MATCH_COUNT); | 1247 psl_domain_match_metric, PSL_DOMAIN_MATCH_COUNT); |
1247 } | 1248 } |
1248 | 1249 |
1249 if (!statement->Succeeded()) | 1250 if (!statement->Succeeded()) |
1250 return false; | 1251 return false; |
1251 return true; | 1252 return true; |
1252 } | 1253 } |
1253 | 1254 |
1254 } // namespace password_manager | 1255 } // namespace password_manager |
OLD | NEW |