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

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

Issue 2829853008: Stores server card as a full server card when upload to server succeeds. (Closed)
Patch Set: Renames AddServerCreditCard to AddFullServerCreditCard. Adds DCHECK to verify that we are in a tran… Created 3 years, 8 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_webdata_backend_impl.cc
diff --git a/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc b/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc
index 2129da0abddab02f59536141351ea0ee3fd779c4..85bc2f308de368145900a3dc8f73c586ddd9768e 100644
--- a/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc
+++ b/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc
@@ -329,6 +329,23 @@ WebDatabase::State AutofillWebDataBackendImpl::RemoveCreditCard(
return WebDatabase::COMMIT_NEEDED;
}
+WebDatabase::State AutofillWebDataBackendImpl::AddFullServerCreditCard(
+ const CreditCard& credit_card,
+ WebDatabase* db) {
+ DCHECK(db_thread_->BelongsToCurrentThread());
+ if (!AutofillTable::FromWebDatabase(db)->AddFullServerCreditCard(
+ credit_card)) {
+ NOTREACHED();
+ return WebDatabase::COMMIT_NOT_NEEDED;
+ }
+
+ for (auto& db_observer : db_observer_list_) {
+ db_observer.CreditCardChanged(CreditCardChange(
+ CreditCardChange::ADD, credit_card.guid(), &credit_card));
+ }
+ return WebDatabase::COMMIT_NEEDED;
+}
+
std::unique_ptr<WDTypedResult> AutofillWebDataBackendImpl::GetCreditCards(
WebDatabase* db) {
DCHECK(db_thread_->BelongsToCurrentThread());

Powered by Google App Engine
This is Rietveld 408576698