Chromium Code Reviews
Description[Sync] Not having an autocomplete ModelTypeState is valid.
Previously, when there was no row for a ModelTypeState in
AutofillTable, it was returning false on its GetAllSyncMetadata call.
This then caused the AutocompleteSyncBridge to report a ModelError to
the processor. This caused the model type the fail initialization on a
first time sync. The in this CL changes AutofillTable's table to return
true and provide a default valued ModelTypeState this case. The
processor is fully capable of inspecting the ModelTypeState object and
determining that a first time sync has no occurred, and taking the
appropriate steps.
This potentially introduces a scenario where there are rows for
EntityMetadata but none of ModelTypeState. This is an invalid state,
but AutofillTable will not recognize this (nor should it). The right
place for handling this scenario is the processor. It should be quite
unlikely/difficult to get into this scenario, and the damage should be
low, some invalid/not relevant metadata may hang around indefinitely.
Added a DCHECK for this unexpected and unhanded case for now.
Also updated several includes for lint.
BUG=686172
Review-Url: https://codereview.chromium.org/2660673002
Cr-Commit-Position: refs/heads/master@{#447355}
Committed: https://chromium.googlesource.com/chromium/src/+/5f42ef10335277c152f30782723af6ee893d3f55
Patch Set 1 #Patch Set 2 : Update AutocompleteSyncBridge unittests to not rely on initial metadata. #
Total comments: 4
Depends on Patchset: Dependent Patchsets: Messages
Total messages: 21 (13 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||