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

Issue 2624883002: [Sync] ApplySyncChanges autofill implementation. (Closed)

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

Description

[Sync] ApplySyncChanges autofill implementation. Updates autofill USS implementation to accept incoming sync changes. The previous implementation can be found at AutocompleteSyncableService::ProcessSyncChanges, which was used to base the behavior off of for this CL. I've tried to setup the code in such a way that allows apply and merge to share as much code as possible. I tried to keep the overhead/complexity to a minimum, not quite sure how successful I have been. Some of the odd/gnarly pieces of logic that were (or not) copied over that I think may be worth calling out: 1. AutofillTable::GetAllAutofillEntries is only called if needed. While the processor shouldn't call us with no changes for ApplySyncChanges, it's up to us to avoid this when we're only receiving deletes. This is the previous behavior. 2. AutofillSpecifics should be ignored when .has_value() returns false. These are dropped on the floor with no attempt to delete. As far back as I could find, like over 5 years ago, this has been the case. No special handling exists for .has_name(), which can return false and we'll treat it as normal. This is the previous behavior. 3. Don't trust the incoming time stamps from Sync. This is a change from how AutocompleteSyncableService was implemented. In an attempt to be conservative in what we send, and liberal in what we accept, I've tried to add the ability to handle incorrectly ordered timestamps, and correct them locally. The cost of this should be negligible since typically there should be 1 or 2 timestmaps on any given remote specifics. 4. Converting from an AutofillSpecifics with no timestamps is kind of invalid, we end up setting our creation timestamp to time 0. We explicitly avoid this scenario when updating existing data, but when the sync change is the first time we've seen this data, we don't have quite as reasonable of an option, so we set creation and last use time to time 0. This is going to result in an immediate eviction by RemoveExpiredFormElements, but this the previous behavior, so I kept it. BUG=672619 Review-Url: https://codereview.chromium.org/2624883002 Cr-Commit-Position: refs/heads/master@{#443601} Committed: https://chromium.googlesource.com/chromium/src/+/0299ea23ebf462d0bec0d9571711b8d6c437cb8c

Patch Set 1 #

Patch Set 2 : Increased state tracking and logic in sub-class. #

Patch Set 3 : Cleaned up a few things, added missing checks to unittests. #

Patch Set 4 : Rebasing and removed a few useless autos. #

Total comments: 30

Patch Set 5 : Updates for Max. #

Total comments: 8

Patch Set 6 : More updates for Max's comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+501 lines, -100 lines) Patch
M components/autofill/core/browser/webdata/autocomplete_sync_bridge.h View 1 3 chunks +3 lines, -3 lines 0 comments Download
M components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc View 1 2 3 4 5 12 chunks +254 lines, -42 lines 0 comments Download
M components/autofill/core/browser/webdata/autocomplete_sync_bridge_unittest.cc View 1 2 3 4 10 chunks +217 lines, -35 lines 0 comments Download
M components/autofill/core/browser/webdata/autofill_entry.h View 2 chunks +2 lines, -0 lines 0 comments Download
M components/autofill/core/browser/webdata/autofill_entry.cc View 2 chunks +6 lines, -0 lines 0 comments Download
M components/autofill/core/browser/webdata/autofill_metadata_change_list.h View 1 3 chunks +4 lines, -2 lines 0 comments Download
M components/autofill/core/browser/webdata/autofill_metadata_change_list.cc View 1 2 3 4 2 chunks +15 lines, -18 lines 0 comments Download

Messages

Total messages: 31 (23 generated)
skym
PTAL
3 years, 11 months ago (2017-01-11 20:10:57 UTC) #9
maxbogue
Mostly looks good! Just a few things to address. https://codereview.chromium.org/2624883002/diff/60001/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc File components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc (right): https://codereview.chromium.org/2624883002/diff/60001/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc#newcode46 components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc:46: ...
3 years, 11 months ago (2017-01-12 00:15:17 UTC) #13
skym
Adding mathp@ as autofill owner. https://codereview.chromium.org/2624883002/diff/60001/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc File components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc (right): https://codereview.chromium.org/2624883002/diff/60001/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc#newcode46 components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc:46: #define RETURN_IF(x) \ On ...
3 years, 11 months ago (2017-01-12 17:44:01 UTC) #18
maxbogue
lgtm https://codereview.chromium.org/2624883002/diff/80001/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc File components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc (right): https://codereview.chromium.org/2624883002/diff/80001/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc#newcode117 components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc:117: // to lazily load local data, and then ...
3 years, 11 months ago (2017-01-12 22:54:08 UTC) #23
Mathieu
Hi, I don't really have the background to read this so this is mostly a ...
3 years, 11 months ago (2017-01-13 00:48:16 UTC) #24
skym
https://codereview.chromium.org/2624883002/diff/80001/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc File components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc (right): https://codereview.chromium.org/2624883002/diff/80001/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc#newcode117 components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc:117: // to lazily load local data, and then react ...
3 years, 11 months ago (2017-01-13 16:46:44 UTC) #25
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/2624883002/100001
3 years, 11 months ago (2017-01-13 16:47:30 UTC) #28
commit-bot: I haz the power
3 years, 11 months ago (2017-01-13 17:49:27 UTC) #31
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/0299ea23ebf462d0bec0d9571711...

Powered by Google App Engine
This is Rietveld 408576698