Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 usernames_pickle.size()); | 134 usernames_pickle.size()); |
| 135 s->BindInt(COLUMN_TIMES_USED, form.times_used); | 135 s->BindInt(COLUMN_TIMES_USED, form.times_used); |
| 136 base::Pickle form_data_pickle; | 136 base::Pickle form_data_pickle; |
| 137 autofill::SerializeFormData(form.form_data, &form_data_pickle); | 137 autofill::SerializeFormData(form.form_data, &form_data_pickle); |
| 138 s->BindBlob(COLUMN_FORM_DATA, | 138 s->BindBlob(COLUMN_FORM_DATA, |
| 139 form_data_pickle.data(), | 139 form_data_pickle.data(), |
| 140 form_data_pickle.size()); | 140 form_data_pickle.size()); |
| 141 s->BindInt64(COLUMN_DATE_SYNCED, form.date_synced.ToInternalValue()); | 141 s->BindInt64(COLUMN_DATE_SYNCED, form.date_synced.ToInternalValue()); |
| 142 s->BindString16(COLUMN_DISPLAY_NAME, form.display_name); | 142 s->BindString16(COLUMN_DISPLAY_NAME, form.display_name); |
| 143 s->BindString(COLUMN_ICON_URL, form.icon_url.spec()); | 143 s->BindString(COLUMN_ICON_URL, form.icon_url.spec()); |
| 144 s->BindString(COLUMN_FEDERATION_URL, form.federation_origin.Serialize()); | 144 s->BindString(COLUMN_FEDERATION_URL, |
| 145 form.federation_origin.unique() | |
|
markusheintz_
2016/03/09 18:02:59
opt: Add acomment describing why or simply referen
vasilii
2016/03/09 18:11:20
Done.
| |
| 146 ? std::string() | |
| 147 : form.federation_origin.Serialize()); | |
| 145 s->BindInt(COLUMN_SKIP_ZERO_CLICK, form.skip_zero_click); | 148 s->BindInt(COLUMN_SKIP_ZERO_CLICK, form.skip_zero_click); |
| 146 s->BindInt(COLUMN_GENERATION_UPLOAD_STATUS, form.generation_upload_status); | 149 s->BindInt(COLUMN_GENERATION_UPLOAD_STATUS, form.generation_upload_status); |
| 147 } | 150 } |
| 148 | 151 |
| 149 void AddCallback(int err, sql::Statement* /*stmt*/) { | 152 void AddCallback(int err, sql::Statement* /*stmt*/) { |
| 150 if (err == 19 /*SQLITE_CONSTRAINT*/) | 153 if (err == 19 /*SQLITE_CONSTRAINT*/) |
| 151 DLOG(WARNING) << "LoginDatabase::AddLogin updated an existing form"; | 154 DLOG(WARNING) << "LoginDatabase::AddLogin updated an existing form"; |
| 152 } | 155 } |
| 153 | 156 |
| 154 bool DoesMatchConstraints(const PasswordForm& form) { | 157 bool DoesMatchConstraints(const PasswordForm& form) { |
| (...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1345 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering", | 1348 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering", |
| 1346 psl_domain_match_metric, PSL_DOMAIN_MATCH_COUNT); | 1349 psl_domain_match_metric, PSL_DOMAIN_MATCH_COUNT); |
| 1347 } | 1350 } |
| 1348 | 1351 |
| 1349 if (!statement->Succeeded()) | 1352 if (!statement->Succeeded()) |
| 1350 return false; | 1353 return false; |
| 1351 return true; | 1354 return true; |
| 1352 } | 1355 } |
| 1353 | 1356 |
| 1354 } // namespace password_manager | 1357 } // namespace password_manager |
| OLD | NEW |