chromium/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/autofill/core/browser/webdata/autofill_webdata_backend_impl.h"

#include <memory>

#include "base/check_is_test.h"
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/metrics/histogram_functions.h"
#include "base/observer_list.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/types/cxx23_to_underlying.h"
#include "components/autofill/core/browser/data_model/autofill_offer_data.h"
#include "components/autofill/core/browser/data_model/autofill_wallet_usage_data.h"
#include "components/autofill/core/browser/data_model/bank_account.h"
#include "components/autofill/core/browser/data_model/credit_card.h"
#include "components/autofill/core/browser/data_model/credit_card_benefit.h"
#include "components/autofill/core/browser/data_model/credit_card_cloud_token_data.h"
#include "components/autofill/core/browser/data_model/iban.h"
#include "components/autofill/core/browser/data_model/payments_metadata.h"
#include "components/autofill/core/browser/geo/autofill_country.h"
#include "components/autofill/core/browser/payments/payments_customer_data.h"
#include "components/autofill/core/browser/webdata/addresses/address_autofill_table.h"
#include "components/autofill/core/browser/webdata/autocomplete/autocomplete_entry.h"
#include "components/autofill/core/browser/webdata/autocomplete/autocomplete_table.h"
#include "components/autofill/core/browser/webdata/autofill_change.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service_observer.h"
#include "components/autofill/core/browser/webdata/payments/payments_autofill_table.h"
#include "components/autofill/core/common/autofill_clock.h"
#include "components/autofill/core/common/form_field_data.h"
#include "components/sync/base/data_type.h"
#include "components/webdata/common/web_database_backend.h"

namespace autofill {

namespace {

// Do not modify the order or values of these elements as they are reported
// as metrics. This is represented as AutofillWebDataBackendImplOperationResult
// in enums.xml.
// The ID space is a bit stretched out to enable adding new failure testing
// inside functions where needed without destroying the order of elements.
enum class Result {};

// Reports the success or failure of various operations on the database via UMA.
//
// Unit tests live in web_data_service_unittest.cc.
void ReportResult(Result result) {}

}  // namespace

AutofillWebDataBackendImpl::AutofillWebDataBackendImpl(
    scoped_refptr<WebDatabaseBackend> web_database_backend,
    scoped_refptr<base::SequencedTaskRunner> ui_task_runner,
    scoped_refptr<base::SequencedTaskRunner> db_task_runner,
    const base::RepeatingCallback<void(syncer::DataType)>&
        on_autofill_changed_by_sync_callback)
    :{}

void AutofillWebDataBackendImpl::AddObserver(
    AutofillWebDataServiceObserverOnDBSequence* observer) {}

void AutofillWebDataBackendImpl::RemoveObserver(
    AutofillWebDataServiceObserverOnDBSequence* observer) {}

AutofillWebDataBackendImpl::~AutofillWebDataBackendImpl() {}

void AutofillWebDataBackendImpl::SetAutofillProfileChangedCallback(
    base::RepeatingCallback<void(const AutofillProfileChange&)> change_cb) {}

WebDatabase* AutofillWebDataBackendImpl::GetDatabase() {}

void AutofillWebDataBackendImpl::CommitChanges() {}

std::unique_ptr<WDTypedResult>
AutofillWebDataBackendImpl::RemoveExpiredAutocompleteEntries(WebDatabase* db) {}
void AutofillWebDataBackendImpl::NotifyOfAutofillProfileChanged(
    const AutofillProfileChange& change) {}

void AutofillWebDataBackendImpl::NotifyOfCreditCardChanged(
    const CreditCardChange& change) {}

void AutofillWebDataBackendImpl::NotifyOfIbanChanged(const IbanChange& change) {}

void AutofillWebDataBackendImpl::NotifyOnAutofillChangedBySync(
    syncer::DataType data_type) {}

void AutofillWebDataBackendImpl::NotifyOnServerCvcChanged(
    const ServerCvcChange& change) {}

base::SupportsUserData* AutofillWebDataBackendImpl::GetDBUserData() {}

void AutofillWebDataBackendImpl::ResetUserData() {}

WebDatabase::State AutofillWebDataBackendImpl::AddFormElements(
    const std::vector<FormFieldData>& fields,
    WebDatabase* db) {}

std::unique_ptr<WDTypedResult>
AutofillWebDataBackendImpl::GetFormValuesForElementName(
    const std::u16string& name,
    const std::u16string& prefix,
    int limit,
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::RemoveFormElementsAddedBetween(
    base::Time delete_begin,
    base::Time delete_end,
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::RemoveFormValueForElementName(
    const std::u16string& name,
    const std::u16string& value,
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::AddAutofillProfile(
    const AutofillProfile& profile,
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::UpdateAutofillProfile(
    const AutofillProfile& profile,
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::RemoveAutofillProfile(
    const std::string& guid,
    AutofillProfile::RecordType record_type,
    WebDatabase* db) {}

std::unique_ptr<WDTypedResult> AutofillWebDataBackendImpl::GetAutofillProfiles(
    AutofillProfile::RecordType record_type,
    WebDatabase* db) {}

std::unique_ptr<WDTypedResult>
AutofillWebDataBackendImpl::GetCountOfValuesContainedBetween(base::Time begin,
                                                             base::Time end,
                                                             WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::UpdateAutocompleteEntries(
    const std::vector<AutocompleteEntry>& autocomplete_entries,
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::AddCreditCard(
    const CreditCard& credit_card,
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::UpdateCreditCard(
    const CreditCard& credit_card,
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::UpdateLocalCvc(
    const std::string& guid,
    const std::u16string& cvc,
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::RemoveCreditCard(
    const std::string& guid,
    WebDatabase* db) {}

std::unique_ptr<WDTypedResult> AutofillWebDataBackendImpl::GetCreditCards(
    WebDatabase* db) {}

std::unique_ptr<WDTypedResult> AutofillWebDataBackendImpl::GetServerCreditCards(
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::UpdateServerCardMetadata(
    const CreditCard& card,
    WebDatabase* db) {}

std::unique_ptr<WDTypedResult> AutofillWebDataBackendImpl::GetLocalIbans(
    WebDatabase* db) {}

std::unique_ptr<WDTypedResult> AutofillWebDataBackendImpl::GetServerIbans(
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::AddLocalIban(const Iban& iban,
                                                            WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::UpdateLocalIban(
    const Iban& iban,
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::RemoveLocalIban(
    const std::string& guid,
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::UpdateServerIbanMetadata(
    const Iban& iban,
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::AddServerCvc(
    int64_t instrument_id,
    const std::u16string& cvc,
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::UpdateServerCvc(
    int64_t instrument_id,
    const std::u16string& cvc,
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::RemoveServerCvc(
    int64_t instrument_id,
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::ClearServerCvcs(
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::ClearLocalCvcs(WebDatabase* db) {}

std::unique_ptr<WDTypedResult>
AutofillWebDataBackendImpl::GetPaymentsCustomerData(WebDatabase* db) {}

std::unique_ptr<WDTypedResult>
AutofillWebDataBackendImpl::GetCreditCardCloudTokenData(WebDatabase* db) {}

std::unique_ptr<WDTypedResult> AutofillWebDataBackendImpl::GetAutofillOffers(
    WebDatabase* db) {}

std::unique_ptr<WDTypedResult>
AutofillWebDataBackendImpl::GetAutofillVirtualCardUsageData(WebDatabase* db) {}

std::unique_ptr<WDTypedResult>
AutofillWebDataBackendImpl::GetCreditCardBenefits(WebDatabase* db) {}

std::unique_ptr<WDTypedResult>
AutofillWebDataBackendImpl::GetMaskedBankAccounts(WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::ClearAllServerData(
    WebDatabase* db) {}

WebDatabase::State
AutofillWebDataBackendImpl::RemoveAutofillDataModifiedBetween(
    base::Time delete_begin,
    base::Time delete_end,
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::RemoveOriginURLsModifiedBetween(
    base::Time delete_begin,
    base::Time delete_end,
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::ClearAllCreditCardBenefits(
    WebDatabase* db) {}

WebDatabase::State AutofillWebDataBackendImpl::AddServerCreditCardForTesting(
    const CreditCard& credit_card,
    WebDatabase* db) {}

}  // namespace autofill