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

Unified Diff: components/autofill/core/browser/webdata/autofill_table.cc

Issue 1007003007: Clear wallet data from autofill when disabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/webdata/autofill_table.cc
diff --git a/components/autofill/core/browser/webdata/autofill_table.cc b/components/autofill/core/browser/webdata/autofill_table.cc
index 6175545cbc50f7eb630e044624fbc0d98f2325f2..5a3761b641c3cf73ce3332d54f905dc16ba55bf6 100644
--- a/components/autofill/core/browser/webdata/autofill_table.cc
+++ b/components/autofill/core/browser/webdata/autofill_table.cc
@@ -952,6 +952,10 @@ bool AutofillTable::GetServerProfiles(std::vector<AutofillProfile*>* profiles) {
void AutofillTable::SetServerProfiles(
const std::vector<AutofillProfile>& profiles) {
+ sql::Transaction transaction(db_);
+ if (!transaction.Begin())
+ return;
+
// Delete all old ones first.
sql::Statement delete_old(db_->GetUniqueStatement(
"DELETE FROM server_addresses"));
@@ -996,6 +1000,8 @@ void AutofillTable::SetServerProfiles(
insert.Run();
insert.Reset(true);
}
+
+ transaction.Commit();
}
bool AutofillTable::UpdateAutofillProfile(const AutofillProfile& profile) {

Powered by Google App Engine
This is Rietveld 408576698