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

Issue 2618483003: [Sync] Introduce ModelError for USS error handling. (Closed)

Created:
3 years, 11 months ago by maxbogue
Modified:
3 years, 11 months ago
Reviewers:
Mathieu, skym, Olivier
CC:
chromium-reviews, sync-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Sync] Introduce ModelError for USS error handling. SyncError is confusing to use in model code, because it has features (error type and model type) that are only needed for inner sync machinery. This change introduces the simplified ModelError, which only has a location and a message. If the need arises, it could also get an error type/desired recovery action value as well, but I'm doubtful that's necessary and I'm sure we can make something clearer than SyncError's. - SyncError replaced by ModelError everywhere below the processor. - SMTP no longer implements SyncErrorFactory and now just has a ReportError method (with one convenience overload). - SMTP now expects ReportError to be called instead of having error objects as callback parameters. This streamlines error handling quite a bit. - Added error handling for Get(All)Data in AutocompleteSyncBridge. I plan to convert everything between the processor and the controller to use ModelError in a followup CL. BUG=673883 Review-Url: https://codereview.chromium.org/2618483003 Cr-Commit-Position: refs/heads/master@{#442401} Committed: https://chromium.googlesource.com/chromium/src/+/04ada5a89fbd87369e96d434aa39aee90d20809c

Patch Set 1 #

Patch Set 2 : Fix iOS reading list. #

Total comments: 8

Patch Set 3 : Switch to ModelError approach. #

Patch Set 4 : Hopefully fix iOS. #

Patch Set 5 : Rebase. #

Patch Set 6 : Fix iOS test file. #

Patch Set 7 : Fix other iOS test file that I thought was the first one. #

Total comments: 32

Patch Set 8 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+402 lines, -300 lines) Patch
M chrome/browser/sync/test/integration/two_client_uss_sync_test.cc View 1 2 3 4 5 6 7 3 chunks +5 lines, -5 lines 0 comments Download
M components/autofill/core/browser/webdata/autocomplete_sync_bridge.h View 1 2 3 4 5 6 7 2 chunks +3 lines, -6 lines 0 comments Download
M components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc View 1 2 3 4 5 6 7 2 chunks +21 lines, -11 lines 0 comments Download
M components/autofill/core/browser/webdata/autocomplete_sync_bridge_unittest.cc View 1 2 3 4 2 chunks +0 lines, -3 lines 0 comments Download
M components/reading_list/ios/reading_list_model_unittest.mm View 1 2 3 4 5 6 7 2 chunks +5 lines, -4 lines 0 comments Download
M components/reading_list/ios/reading_list_store.h View 1 2 3 4 4 chunks +4 lines, -3 lines 0 comments Download
M components/reading_list/ios/reading_list_store.cc View 1 2 3 4 8 chunks +14 lines, -12 lines 0 comments Download
M components/reading_list/ios/reading_list_store_unittest.mm View 1 2 3 4 5 5 chunks +5 lines, -5 lines 0 comments Download
M components/sync/BUILD.gn View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M components/sync/device_info/device_info_sync_bridge.h View 1 2 3 4 5 6 7 5 chunks +4 lines, -9 lines 0 comments Download
M components/sync/device_info/device_info_sync_bridge.cc View 1 2 13 chunks +23 lines, -23 lines 0 comments Download
M components/sync/device_info/device_info_sync_bridge_unittest.cc View 1 2 15 chunks +15 lines, -18 lines 0 comments Download
M components/sync/model/fake_model_type_change_processor.h View 1 2 3 4 5 6 7 2 chunks +12 lines, -4 lines 0 comments Download
M components/sync/model/fake_model_type_change_processor.cc View 1 2 3 4 5 6 7 4 chunks +18 lines, -5 lines 0 comments Download
M components/sync/model/fake_model_type_sync_bridge.h View 1 2 3 4 5 6 7 4 chunks +7 lines, -6 lines 0 comments Download
M components/sync/model/fake_model_type_sync_bridge.cc View 1 2 3 4 5 6 7 8 chunks +25 lines, -24 lines 0 comments Download
M components/sync/model/mock_model_type_store.cc View 1 2 3 4 5 6 7 2 chunks +5 lines, -4 lines 0 comments Download
A components/sync/model/model_error.h View 1 2 1 chunk +45 lines, -0 lines 0 comments Download
A components/sync/model/model_error.cc View 1 2 1 chunk +31 lines, -0 lines 0 comments Download
M components/sync/model/model_type_change_processor.h View 1 2 3 4 5 6 7 5 chunks +19 lines, -7 lines 0 comments Download
M components/sync/model/model_type_debug_info.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M components/sync/model/model_type_debug_info.cc View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M components/sync/model/model_type_store.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M components/sync/model/model_type_sync_bridge.h View 1 2 3 4 5 6 7 3 chunks +16 lines, -12 lines 0 comments Download
M components/sync/model/model_type_sync_bridge.cc View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M components/sync/model/model_type_sync_bridge_unittest.cc View 1 2 3 4 5 6 7 3 chunks +1 line, -9 lines 0 comments Download
M components/sync/model/stub_model_type_sync_bridge.h View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M components/sync/model/stub_model_type_sync_bridge.cc View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M components/sync/model_impl/model_type_store_impl.h View 1 2 1 chunk +0 lines, -6 lines 0 comments Download
M components/sync/model_impl/model_type_store_impl.cc View 1 2 3 4 5 6 7 6 chunks +11 lines, -13 lines 0 comments Download
M components/sync/model_impl/model_type_store_impl_unittest.cc View 1 2 6 chunks +15 lines, -14 lines 0 comments Download
M components/sync/model_impl/shared_model_type_processor.h View 1 2 3 4 5 6 7 6 chunks +18 lines, -12 lines 0 comments Download
M components/sync/model_impl/shared_model_type_processor.cc View 1 2 3 4 5 6 7 11 chunks +46 lines, -38 lines 0 comments Download
M components/sync/model_impl/shared_model_type_processor_unittest.cc View 1 2 3 4 5 6 7 11 chunks +23 lines, -35 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 51 (40 generated)
maxbogue
Sky, PTAL!
3 years, 11 months ago (2017-01-05 00:18:48 UTC) #10
skym
I don't see the actual benefit of implementing DataTypeErrorHandler, other than it does a kinda ...
3 years, 11 months ago (2017-01-05 17:03:49 UTC) #13
maxbogue
I changed basically everything, PTAL! Bots haven't run though so they may explode. https://codereview.chromium.org/2618483003/diff/20001/components/sync/device_info/device_info_sync_bridge.cc File ...
3 years, 11 months ago (2017-01-07 00:12:39 UTC) #17
skym
lgtm Love the changes! I'm really liking things. The only thing I really care about ...
3 years, 11 months ago (2017-01-09 18:20:29 UTC) #36
maxbogue
PTAnL at all the comment tweaks! https://codereview.chromium.org/2618483003/diff/120001/chrome/browser/sync/test/integration/two_client_uss_sync_test.cc File chrome/browser/sync/test/integration/two_client_uss_sync_test.cc (right): https://codereview.chromium.org/2618483003/diff/120001/chrome/browser/sync/test/integration/two_client_uss_sync_test.cc#newcode72 chrome/browser/sync/test/integration/two_client_uss_sync_test.cc:72: syncer::ModelError error = ...
3 years, 11 months ago (2017-01-09 21:29:33 UTC) #39
maxbogue
+olivierrobin for components/reading_list/ +mathp for components/autofill/
3 years, 11 months ago (2017-01-09 21:32:58 UTC) #41
skym
Still lgtm
3 years, 11 months ago (2017-01-09 21:45:50 UTC) #42
Mathieu
autofill lgtm
3 years, 11 months ago (2017-01-09 22:13:00 UTC) #43
Olivier
reading_list LGTM
3 years, 11 months ago (2017-01-09 22:14:24 UTC) #44
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/2618483003/140001
3 years, 11 months ago (2017-01-09 23:03:07 UTC) #48
commit-bot: I haz the power
3 years, 11 months ago (2017-01-09 23:35:58 UTC) #51
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/04ada5a89fbd87369e96d434aa39...

Powered by Google App Engine
This is Rietveld 408576698