Commit 1112fab3 authored by Jan Krcal's avatar Jan Krcal Committed by Commit Bot

[AF Wallet] Strenghten valid sequence DCHECKs for metadata bridge

This CL introduces more DCHECKs before the feature hits Canary / Dev.

Bug: 853688
Change-Id: I39d7ef8451ade278a1c811e0d7c49598b10aac47
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1505506
Commit-Queue: Jan Krcal <jkrcal@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Auto-Submit: Jan Krcal <jkrcal@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638138}
parent 997868f7
......@@ -320,7 +320,9 @@ AutofillWalletMetadataSyncBridge::AutofillWalletMetadataSyncBridge(
LoadDataCacheAndMetadata();
}
AutofillWalletMetadataSyncBridge::~AutofillWalletMetadataSyncBridge() {}
AutofillWalletMetadataSyncBridge::~AutofillWalletMetadataSyncBridge() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}
void AutofillWalletMetadataSyncBridge::OnWalletDataTrackingStateChanged(
bool is_tracking) {
......@@ -338,6 +340,7 @@ base::Optional<syncer::ModelError>
AutofillWalletMetadataSyncBridge::MergeSyncData(
std::unique_ptr<syncer::MetadataChangeList> metadata_change_list,
syncer::EntityChangeList entity_data) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// First upload local entities that are not mentioned in |entity_data|.
UploadInitialLocalData(metadata_change_list.get(), entity_data);
......@@ -349,6 +352,7 @@ base::Optional<syncer::ModelError>
AutofillWalletMetadataSyncBridge::ApplySyncChanges(
std::unique_ptr<syncer::MetadataChangeList> metadata_change_list,
syncer::EntityChangeList entity_data) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return MergeRemoteChanges(std::move(metadata_change_list),
std::move(entity_data));
}
......@@ -369,6 +373,7 @@ void AutofillWalletMetadataSyncBridge::GetAllDataForDebugging(
std::string AutofillWalletMetadataSyncBridge::GetClientTag(
const syncer::EntityData& entity_data) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
const WalletMetadataSpecifics& remote_metadata =
entity_data.specifics.wallet_metadata();
return GetClientTagForSpecificsId(remote_metadata.type(),
......@@ -377,6 +382,7 @@ std::string AutofillWalletMetadataSyncBridge::GetClientTag(
std::string AutofillWalletMetadataSyncBridge::GetStorageKey(
const syncer::EntityData& entity_data) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return GetStorageKeyForWalletMetadataTypeAndSpecificsId(
entity_data.specifics.wallet_metadata().type(),
entity_data.specifics.wallet_metadata().id());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment