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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 base::Pickle form_data_pickle; | 143 base::Pickle form_data_pickle; |
144 autofill::SerializeFormData(form.form_data, &form_data_pickle); | 144 autofill::SerializeFormData(form.form_data, &form_data_pickle); |
145 s->BindBlob(COLUMN_FORM_DATA, | 145 s->BindBlob(COLUMN_FORM_DATA, |
146 form_data_pickle.data(), | 146 form_data_pickle.data(), |
147 form_data_pickle.size()); | 147 form_data_pickle.size()); |
148 s->BindInt64(COLUMN_DATE_SYNCED, form.date_synced.ToInternalValue()); | 148 s->BindInt64(COLUMN_DATE_SYNCED, form.date_synced.ToInternalValue()); |
149 s->BindString16(COLUMN_DISPLAY_NAME, form.display_name); | 149 s->BindString16(COLUMN_DISPLAY_NAME, form.display_name); |
150 s->BindString(COLUMN_ICON_URL, form.icon_url.spec()); | 150 s->BindString(COLUMN_ICON_URL, form.icon_url.spec()); |
151 // An empty Origin serializes as "null" which would be strange to store here. | 151 // An empty Origin serializes as "null" which would be strange to store here. |
152 s->BindString(COLUMN_FEDERATION_URL, | 152 s->BindString(COLUMN_FEDERATION_URL, |
153 form.federation_origin.unique() | 153 form.federation_origin.opaque() |
154 ? std::string() | 154 ? std::string() |
155 : form.federation_origin.Serialize()); | 155 : form.federation_origin.Serialize()); |
156 s->BindInt(COLUMN_SKIP_ZERO_CLICK, form.skip_zero_click); | 156 s->BindInt(COLUMN_SKIP_ZERO_CLICK, form.skip_zero_click); |
157 s->BindInt(COLUMN_GENERATION_UPLOAD_STATUS, form.generation_upload_status); | 157 s->BindInt(COLUMN_GENERATION_UPLOAD_STATUS, form.generation_upload_status); |
158 base::Pickle usernames_pickle = | 158 base::Pickle usernames_pickle = |
159 SerializePossibleUsernamePairs(form.other_possible_usernames); | 159 SerializePossibleUsernamePairs(form.other_possible_usernames); |
160 s->BindBlob(COLUMN_POSSIBLE_USERNAME_PAIRS, usernames_pickle.data(), | 160 s->BindBlob(COLUMN_POSSIBLE_USERNAME_PAIRS, usernames_pickle.data(), |
161 usernames_pickle.size()); | 161 usernames_pickle.size()); |
162 } | 162 } |
163 | 163 |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 s.BindInt(next_param++, form.scheme); | 866 s.BindInt(next_param++, form.scheme); |
867 s.BindInt(next_param++, form.type); | 867 s.BindInt(next_param++, form.type); |
868 s.BindInt(next_param++, form.times_used); | 868 s.BindInt(next_param++, form.times_used); |
869 base::Pickle form_data_pickle; | 869 base::Pickle form_data_pickle; |
870 autofill::SerializeFormData(form.form_data, &form_data_pickle); | 870 autofill::SerializeFormData(form.form_data, &form_data_pickle); |
871 s.BindBlob(next_param++, form_data_pickle.data(), form_data_pickle.size()); | 871 s.BindBlob(next_param++, form_data_pickle.data(), form_data_pickle.size()); |
872 s.BindInt64(next_param++, form.date_synced.ToInternalValue()); | 872 s.BindInt64(next_param++, form.date_synced.ToInternalValue()); |
873 s.BindString16(next_param++, form.display_name); | 873 s.BindString16(next_param++, form.display_name); |
874 s.BindString(next_param++, form.icon_url.spec()); | 874 s.BindString(next_param++, form.icon_url.spec()); |
875 // An empty Origin serializes as "null" which would be strange to store here. | 875 // An empty Origin serializes as "null" which would be strange to store here. |
876 s.BindString(next_param++, form.federation_origin.unique() | 876 s.BindString(next_param++, form.federation_origin.opaque() |
877 ? std::string() | 877 ? std::string() |
878 : form.federation_origin.Serialize()); | 878 : form.federation_origin.Serialize()); |
879 s.BindInt(next_param++, form.skip_zero_click); | 879 s.BindInt(next_param++, form.skip_zero_click); |
880 s.BindInt(next_param++, form.generation_upload_status); | 880 s.BindInt(next_param++, form.generation_upload_status); |
881 base::Pickle username_pickle = | 881 base::Pickle username_pickle = |
882 SerializePossibleUsernamePairs(form.other_possible_usernames); | 882 SerializePossibleUsernamePairs(form.other_possible_usernames); |
883 s.BindBlob(next_param++, username_pickle.data(), username_pickle.size()); | 883 s.BindBlob(next_param++, username_pickle.data(), username_pickle.size()); |
884 // NOTE: Add new fields here unless the field is a part of the unique key. | 884 // NOTE: Add new fields here unless the field is a part of the unique key. |
885 // If so, add new field below. | 885 // If so, add new field below. |
886 | 886 |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1374 DCHECK(blacklisted_statement_.empty()); | 1374 DCHECK(blacklisted_statement_.empty()); |
1375 blacklisted_statement_ = | 1375 blacklisted_statement_ = |
1376 "SELECT " + all_column_names + | 1376 "SELECT " + all_column_names + |
1377 " FROM logins WHERE blacklisted_by_user == ? ORDER BY origin_url"; | 1377 " FROM logins WHERE blacklisted_by_user == ? ORDER BY origin_url"; |
1378 DCHECK(encrypted_statement_.empty()); | 1378 DCHECK(encrypted_statement_.empty()); |
1379 encrypted_statement_ = | 1379 encrypted_statement_ = |
1380 "SELECT password_value FROM logins WHERE " + all_unique_key_column_names; | 1380 "SELECT password_value FROM logins WHERE " + all_unique_key_column_names; |
1381 } | 1381 } |
1382 | 1382 |
1383 } // namespace password_manager | 1383 } // namespace password_manager |
OLD | NEW |