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

Issue 2672493002: [Sync] Switch bots to run integ tests for autofill as USS. (Closed)

Created:
3 years, 10 months ago by skym
Modified:
3 years, 10 months ago
Reviewers:
Mathieu, Gang Wu, rkaplow, pavely
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Sync] Switch bots to run integ tests for autofill as USS. ModelTypeControllers are responsible for posting to the model thread. They also typically grab the bridge or the processor through the bridge when doing this. UI thread based controllers can simply go through their SyncClient to do this, and all is well. However, for autofill, and any WebDataService backed type, they cannot, they can only grab the weak ref to their bridge on their model thread. Initially, we were simply posting a task to the model thread that contained a SyncClient pointer. This turns out to not be safe. During shutdown, autofill would consistently crash here by posting a task to the model thread, and before that gets resolved, the SyncClient is destroyed. Presumably all the other posts to model thread were unsafe as well, though hitting the race condition was more unlikely. To get around this we now post a task with a ref counted WebDataService. This required an ability to override the default handling of the ModelTypeController, and any WebDataService backed controller should use the new class created here. While I was in there, some slight refactoring to ModelTypeController and ModelTypeDebugInfo to make the other code changes as clean as possible. BUG=686172 Review-Url: https://codereview.chromium.org/2672493002 Cr-Commit-Position: refs/heads/master@{#450736} Committed: https://chromium.googlesource.com/chromium/src/+/6261bc1e8181556af9c67ad860cca8ebfc3469e0

Patch Set 1 : [Sync] Switch bots to run integ tests for autofill as USS. #

Patch Set 2 : Self review. #

Total comments: 2

Patch Set 3 : Updated for Gang's comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+202 lines, -88 lines) Patch
M chrome/browser/sync/chrome_sync_client.cc View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/sync/test/integration/enable_disable_test.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M components/autofill/core/browser/BUILD.gn View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M components/autofill/core/browser/webdata/autocomplete_sync_bridge.h View 2 chunks +2 lines, -1 line 0 comments Download
M components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc View 2 chunks +4 lines, -2 lines 0 comments Download
A components/autofill/core/browser/webdata/web_data_model_type_controller.h View 1 chunk +49 lines, -0 lines 0 comments Download
A components/autofill/core/browser/webdata/web_data_model_type_controller.cc View 1 chunk +36 lines, -0 lines 0 comments Download
M components/browser_sync/profile_sync_components_factory_impl.cc View 2 chunks +6 lines, -2 lines 0 comments Download
M components/sync/driver/model_type_controller.h View 3 chunks +14 lines, -0 lines 0 comments Download
M components/sync/driver/model_type_controller.cc View 1 2 7 chunks +42 lines, -50 lines 0 comments Download
M components/sync/model/model_type_debug_info.h View 2 chunks +4 lines, -5 lines 0 comments Download
M components/sync/model/model_type_debug_info.cc View 4 chunks +19 lines, -26 lines 0 comments Download
M testing/variations/fieldtrial_testing_config.json View 1 2 1 chunk +20 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 45 (30 generated)
skym
Looks like all the tests are passing, PTAL.
3 years, 10 months ago (2017-02-10 18:46:42 UTC) #19
skym
ping
3 years, 10 months ago (2017-02-13 21:12:45 UTC) #22
pavely
lgtm
3 years, 10 months ago (2017-02-14 01:36:50 UTC) #23
Gang Wu
lgtm https://codereview.chromium.org/2672493002/diff/60001/components/sync/driver/model_type_controller.cc File components/sync/driver/model_type_controller.cc (right): https://codereview.chromium.org/2672493002/diff/60001/components/sync/driver/model_type_controller.cc#newcode48 components/sync/driver/model_type_controller.cc:48: base::WeakPtr<ModelTypeSyncBridge> ReturnCapturedBridge( can you add a comment about ...
3 years, 10 months ago (2017-02-14 17:59:44 UTC) #24
skym
https://codereview.chromium.org/2672493002/diff/60001/components/sync/driver/model_type_controller.cc File components/sync/driver/model_type_controller.cc (right): https://codereview.chromium.org/2672493002/diff/60001/components/sync/driver/model_type_controller.cc#newcode48 components/sync/driver/model_type_controller.cc:48: base::WeakPtr<ModelTypeSyncBridge> ReturnCapturedBridge( On 2017/02/14 17:59:44, Gang Wu wrote: > ...
3 years, 10 months ago (2017-02-14 18:24:33 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/2672493002/80001
3 years, 10 months ago (2017-02-14 18:25:07 UTC) #28
skym
Adding mathp@ for components/autofill/ PTAL
3 years, 10 months ago (2017-02-14 18:30:44 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/364061)
3 years, 10 months ago (2017-02-14 18:36:53 UTC) #32
Mathieu
autofill lgtm
3 years, 10 months ago (2017-02-14 18:59:30 UTC) #33
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/2672493002/80001
3 years, 10 months ago (2017-02-14 19:00:44 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/364112)
3 years, 10 months ago (2017-02-14 19:07:33 UTC) #37
skym
Adding rkaplow@ for testing/variations/ PTAL
3 years, 10 months ago (2017-02-14 19:08:49 UTC) #39
rkaplow
lgtm field trial test config lg
3 years, 10 months ago (2017-02-15 15:24:35 UTC) #40
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/2672493002/80001
3 years, 10 months ago (2017-02-15 16:44:08 UTC) #42
commit-bot: I haz the power
3 years, 10 months ago (2017-02-15 17:27:41 UTC) #45
Message was sent while issue was closed.
Committed patchset #3 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/6261bc1e8181556af9c67ad860cc...

Powered by Google App Engine
This is Rietveld 408576698