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

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

Issue 2716583003: Rename Origin.unique() to opaque().
Patch Set: Mac fixes Created 3 years, 9 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 #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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 base::Pickle form_data_pickle; 140 base::Pickle form_data_pickle;
141 autofill::SerializeFormData(form.form_data, &form_data_pickle); 141 autofill::SerializeFormData(form.form_data, &form_data_pickle);
142 s->BindBlob(COLUMN_FORM_DATA, 142 s->BindBlob(COLUMN_FORM_DATA,
143 form_data_pickle.data(), 143 form_data_pickle.data(),
144 form_data_pickle.size()); 144 form_data_pickle.size());
145 s->BindInt64(COLUMN_DATE_SYNCED, form.date_synced.ToInternalValue()); 145 s->BindInt64(COLUMN_DATE_SYNCED, form.date_synced.ToInternalValue());
146 s->BindString16(COLUMN_DISPLAY_NAME, form.display_name); 146 s->BindString16(COLUMN_DISPLAY_NAME, form.display_name);
147 s->BindString(COLUMN_ICON_URL, form.icon_url.spec()); 147 s->BindString(COLUMN_ICON_URL, form.icon_url.spec());
148 // An empty Origin serializes as "null" which would be strange to store here. 148 // An empty Origin serializes as "null" which would be strange to store here.
149 s->BindString(COLUMN_FEDERATION_URL, 149 s->BindString(COLUMN_FEDERATION_URL,
150 form.federation_origin.unique() 150 form.federation_origin.opaque()
151 ? std::string() 151 ? std::string()
152 : form.federation_origin.Serialize()); 152 : form.federation_origin.Serialize());
153 s->BindInt(COLUMN_SKIP_ZERO_CLICK, form.skip_zero_click); 153 s->BindInt(COLUMN_SKIP_ZERO_CLICK, form.skip_zero_click);
154 s->BindInt(COLUMN_GENERATION_UPLOAD_STATUS, form.generation_upload_status); 154 s->BindInt(COLUMN_GENERATION_UPLOAD_STATUS, form.generation_upload_status);
155 } 155 }
156 156
157 void AddCallback(int err, sql::Statement* /*stmt*/) { 157 void AddCallback(int err, sql::Statement* /*stmt*/) {
158 if (err == 19 /*SQLITE_CONSTRAINT*/) 158 if (err == 19 /*SQLITE_CONSTRAINT*/)
159 DLOG(WARNING) << "LoginDatabase::AddLogin updated an existing form"; 159 DLOG(WARNING) << "LoginDatabase::AddLogin updated an existing form";
160 } 160 }
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 base::Pickle pickle = SerializeVector(form.other_possible_usernames); 856 base::Pickle pickle = SerializeVector(form.other_possible_usernames);
857 s.BindBlob(8, pickle.data(), pickle.size()); 857 s.BindBlob(8, pickle.data(), pickle.size());
858 s.BindInt(9, form.times_used); 858 s.BindInt(9, form.times_used);
859 base::Pickle form_data_pickle; 859 base::Pickle form_data_pickle;
860 autofill::SerializeFormData(form.form_data, &form_data_pickle); 860 autofill::SerializeFormData(form.form_data, &form_data_pickle);
861 s.BindBlob(10, form_data_pickle.data(), form_data_pickle.size()); 861 s.BindBlob(10, form_data_pickle.data(), form_data_pickle.size());
862 s.BindInt64(11, form.date_synced.ToInternalValue()); 862 s.BindInt64(11, form.date_synced.ToInternalValue());
863 s.BindString16(12, form.display_name); 863 s.BindString16(12, form.display_name);
864 s.BindString(13, form.icon_url.spec()); 864 s.BindString(13, form.icon_url.spec());
865 // An empty Origin serializes as "null" which would be strange to store here. 865 // An empty Origin serializes as "null" which would be strange to store here.
866 s.BindString(14, form.federation_origin.unique() 866 s.BindString(14, form.federation_origin.opaque()
867 ? std::string() 867 ? std::string()
868 : form.federation_origin.Serialize()); 868 : form.federation_origin.Serialize());
869 s.BindInt(15, form.skip_zero_click); 869 s.BindInt(15, form.skip_zero_click);
870 s.BindInt(16, form.generation_upload_status); 870 s.BindInt(16, form.generation_upload_status);
871 871
872 // WHERE starts here. 872 // WHERE starts here.
873 s.BindString(17, form.origin.spec()); 873 s.BindString(17, form.origin.spec());
874 s.BindString16(18, form.username_element); 874 s.BindString16(18, form.username_element);
875 s.BindString16(19, form.username_value); 875 s.BindString16(19, form.username_value);
876 s.BindString16(20, form.password_element); 876 s.BindString16(20, form.password_element);
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 DCHECK(blacklisted_statement_.empty()); 1310 DCHECK(blacklisted_statement_.empty());
1311 blacklisted_statement_ = 1311 blacklisted_statement_ =
1312 "SELECT " + all_column_names + 1312 "SELECT " + all_column_names +
1313 " FROM logins WHERE blacklisted_by_user == ? ORDER BY origin_url"; 1313 " FROM logins WHERE blacklisted_by_user == ? ORDER BY origin_url";
1314 DCHECK(encrypted_statement_.empty()); 1314 DCHECK(encrypted_statement_.empty());
1315 encrypted_statement_ = 1315 encrypted_statement_ =
1316 "SELECT password_value FROM logins WHERE " + all_unique_key_column_names; 1316 "SELECT password_value FROM logins WHERE " + all_unique_key_column_names;
1317 } 1317 }
1318 1318
1319 } // namespace password_manager 1319 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698