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

Issue 2660673002: [Sync] Not having an autocomplete ModelTypeState is valid. (Closed)

Created:
3 years, 10 months ago by skym
Modified:
3 years, 10 months ago
Reviewers:
Mathieu, Patrick Noland
CC:
chromium-reviews, rouslan+autofill_chromium.org, rogerm+autofillwatch_chromium.org, sebsg+autofillwatch_chromium.org, browser-components-watch_chromium.org, mathp+autofillwatch_chromium.org, vabr+watchlistautofill_chromium.org, estade+watch_chromium.org, sync-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

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
Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -48 lines) Patch
M components/autofill/core/browser/webdata/autocomplete_sync_bridge_unittest.cc View 1 3 chunks +26 lines, -11 lines 0 comments Download
M components/autofill/core/browser/webdata/autofill_table.h View 1 2 chunks +1 line, -5 lines 0 comments Download
M components/autofill/core/browser/webdata/autofill_table.cc View 1 5 chunks +4 lines, -6 lines 0 comments Download
M components/autofill/core/browser/webdata/autofill_table_unittest.cc View 1 8 chunks +37 lines, -25 lines 0 comments Download
M components/sync/model/recording_model_type_change_processor.h View 1 2 chunks +6 lines, -1 line 2 comments Download
M components/sync/model/recording_model_type_change_processor.cc View 1 1 chunk +2 lines, -0 lines 2 comments Download
M components/sync/model_impl/shared_model_type_processor.cc View 1 chunk +1 line, -0 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 21 (13 generated)
skym
PTAL
3 years, 10 months ago (2017-01-27 20:41:53 UTC) #8
Patrick Noland
https://codereview.chromium.org/2660673002/diff/20001/components/sync/model/recording_model_type_change_processor.cc File components/sync/model/recording_model_type_change_processor.cc (right): https://codereview.chromium.org/2660673002/diff/20001/components/sync/model/recording_model_type_change_processor.cc#newcode7 components/sync/model/recording_model_type_change_processor.cc:7: #include <utility> is this for lint reasons? https://codereview.chromium.org/2660673002/diff/20001/components/sync/model/recording_model_type_change_processor.h File ...
3 years, 10 months ago (2017-01-27 20:50:00 UTC) #9
skym
https://codereview.chromium.org/2660673002/diff/20001/components/sync/model/recording_model_type_change_processor.cc File components/sync/model/recording_model_type_change_processor.cc (right): https://codereview.chromium.org/2660673002/diff/20001/components/sync/model/recording_model_type_change_processor.cc#newcode7 components/sync/model/recording_model_type_change_processor.cc:7: #include <utility> On 2017/01/27 20:49:59, Patrick Noland wrote: > ...
3 years, 10 months ago (2017-01-27 20:55:56 UTC) #10
Patrick Noland
lgtm
3 years, 10 months ago (2017-01-27 20:56:15 UTC) #11
skym
Adding mathp@ for owners approval, PTAL
3 years, 10 months ago (2017-01-30 22:34:48 UTC) #15
Mathieu
autofill lgtm
3 years, 10 months ago (2017-01-31 15:43:17 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2660673002/20001
3 years, 10 months ago (2017-01-31 22:07:33 UTC) #18
commit-bot: I haz the power
3 years, 10 months ago (2017-01-31 23:14:42 UTC) #21
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/5f42ef10335277c152f30782723a...

Powered by Google App Engine
This is Rietveld 408576698