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

Issue 7453014: [Sync] Refactor sync datatype error handling. (Closed)

Created:
9 years, 5 months ago by Nicolas Zea
Modified:
9 years, 5 months ago
Reviewers:
akalin
CC:
chromium-reviews, GeorgeY, ncarter (slow), idana, Raghu Simha, Erik does not do reviews, Aaron Boodman, Paweł Hajdan Jr., Ilya Sherman, tim (not reviewing), dhollowa
Visibility:
Public.

Description

[Sync] Refactor sync datatype error handling. This introduces SyncError's, which are a convenient way of passing around an error location, type, and message. All datatypes have been refactored to use this, including in the AssociateModels code. A future change will use this to add support for continuing sync even when a datatype fails to start. In addition, eventually a future change will convert the UnrecoverableError handler to use SyncError's as well as have the datatype controller's and datatype manager surface SyncError's to the PSS. BUG=87645 TEST= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=94128

Patch Set 1 #

Patch Set 2 : Self review #

Patch Set 3 : fix #

Patch Set 4 : fix windows #

Patch Set 5 : Fix unit test #

Total comments: 14

Patch Set 6 : Comments #

Patch Set 7 : Fix link error #

Patch Set 8 : Really fix compile #

Total comments: 17

Patch Set 9 : Rebase and really really fix compile #

Total comments: 4

Patch Set 10 : Comments addressed #

Patch Set 11 : Add operator= #

Total comments: 18

Patch Set 12 : Return SyncErrors + comments #

Patch Set 13 : Comments/lint #

Patch Set 14 : Rebase #

Total comments: 14

Patch Set 15 : comments #

Total comments: 2

Patch Set 16 : Avoid stringprintf/c_str #

Patch Set 17 : Rebase and fix final unit test <3 c++ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+777 lines, -273 lines) Patch
M chrome/browser/prefs/pref_model_associator.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -3 lines 0 comments Download
M chrome/browser/prefs/pref_model_associator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +21 lines, -7 lines 0 comments Download
M chrome/browser/sync/api/sync_change_processor.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +11 lines, -2 lines 0 comments Download
A chrome/browser/sync/api/sync_error.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +77 lines, -0 lines 0 comments Download
A chrome/browser/sync/api/sync_error.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +89 lines, -0 lines 0 comments Download
A chrome/browser/sync/api/sync_error_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +114 lines, -0 lines 0 comments Download
M chrome/browser/sync/api/syncable_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +9 lines, -2 lines 0 comments Download
M chrome/browser/sync/api/syncable_service_mock.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +7 lines, -5 lines 0 comments Download
M chrome/browser/sync/backend_migrator.cc View 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/sync/backend_migrator_unittest.cc View 1 chunk +18 lines, -8 lines 0 comments Download
M chrome/browser/sync/glue/app_model_associator.h View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/app_model_associator.cc View 1 2 3 4 5 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/sync/glue/autofill_model_associator.h View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/autofill_model_associator.cc View 1 2 3 4 5 7 chunks +13 lines, -6 lines 0 comments Download
M chrome/browser/sync/glue/autofill_profile_model_associator.h View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/autofill_profile_model_associator.cc View 1 2 3 4 5 6 chunks +14 lines, -6 lines 0 comments Download
M chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/sync/glue/bookmark_model_associator.h View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/sync/glue/bookmark_model_associator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 8 chunks +14 lines, -11 lines 0 comments Download
M chrome/browser/sync/glue/data_type_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +17 lines, -25 lines 0 comments Download
M chrome/browser/sync/glue/data_type_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +35 lines, -5 lines 0 comments Download
M chrome/browser/sync/glue/data_type_manager_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/sync/glue/data_type_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 10 chunks +39 lines, -21 lines 0 comments Download
M chrome/browser/sync/glue/data_type_manager_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/sync/glue/data_type_manager_mock.h View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/data_type_manager_mock.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/extension_data_type_controller_unittest.cc View 3 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/sync/glue/extension_model_associator.h View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/extension_model_associator.cc View 1 2 3 4 5 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/frontend_data_type_controller.h View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/frontend_data_type_controller.cc View 5 chunks +13 lines, -6 lines 0 comments Download
M chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc View 4 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/sync/glue/generic_change_processor.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +5 lines, -4 lines 0 comments Download
M chrome/browser/sync/glue/generic_change_processor.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +52 lines, -26 lines 0 comments Download
M chrome/browser/sync/glue/model_associator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/model_associator_mock.h View 1 2 3 4 5 1 chunk +8 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/non_frontend_data_type_controller.cc View 5 chunks +12 lines, -6 lines 0 comments Download
M chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc View 6 chunks +8 lines, -7 lines 0 comments Download
M chrome/browser/sync/glue/password_model_associator.h View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/password_model_associator.cc View 1 2 3 4 5 6 7 8 9 chunks +21 lines, -10 lines 0 comments Download
M chrome/browser/sync/glue/preference_data_type_controller_unittest.cc View 3 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/sync/glue/session_model_associator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/session_model_associator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/sync/glue/syncable_service_adapter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/syncable_service_adapter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +14 lines, -6 lines 0 comments Download
M chrome/browser/sync/glue/theme_data_type_controller_unittest.cc View 3 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/sync/glue/theme_model_associator.h View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/theme_model_associator.cc View 1 2 3 4 5 4 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/sync/glue/typed_url_model_associator.h View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/typed_url_model_associator.cc View 1 2 3 4 5 9 chunks +21 lines, -10 lines 0 comments Download
M chrome/browser/sync/profile_sync_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +11 lines, -10 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_bookmark_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_startup_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +6 lines, -3 lines 0 comments Download
M chrome/browser/sync/syncable/model_type.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/sync/syncable/model_type.cc View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/sync/syncable/model_type_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/chrome.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 12 (0 generated)
Nicolas Zea
It's not as bad as it looks, I swear! Nearly all of these files have ...
9 years, 5 months ago (2011-07-20 01:19:47 UTC) #1
akalin
http://codereview.chromium.org/7453014/diff/8001/chrome/browser/sync/api/sync_error.cc File chrome/browser/sync/api/sync_error.cc (right): http://codereview.chromium.org/7453014/diff/8001/chrome/browser/sync/api/sync_error.cc#newcode25 chrome/browser/sync/api/sync_error.cc:25: print_log_error(); Hmm so an error message will be logged ...
9 years, 5 months ago (2011-07-20 23:43:05 UTC) #2
akalin
http://codereview.chromium.org/7453014/diff/8001/chrome/browser/sync/syncable/model_type.cc File chrome/browser/sync/syncable/model_type.cc (right): http://codereview.chromium.org/7453014/diff/8001/chrome/browser/sync/syncable/model_type.cc#newcode250 chrome/browser/sync/syncable/model_type.cc:250: if (*iter >= FIRST_REAL_MODEL_TYPE && *iter < MODEL_TYPE_COUNT) Hmm. ...
9 years, 5 months ago (2011-07-20 23:43:59 UTC) #3
Nicolas Zea
Comments addressed, PTAL http://codereview.chromium.org/7453014/diff/8001/chrome/browser/sync/api/sync_error.cc File chrome/browser/sync/api/sync_error.cc (right): http://codereview.chromium.org/7453014/diff/8001/chrome/browser/sync/api/sync_error.cc#newcode25 chrome/browser/sync/api/sync_error.cc:25: print_log_error(); On 2011/07/20 23:43:05, akalin wrote: ...
9 years, 5 months ago (2011-07-21 20:09:50 UTC) #4
akalin
Few more http://codereview.chromium.org/7453014/diff/16001/chrome/browser/sync/api/sync_error.cc File chrome/browser/sync/api/sync_error.cc (right): http://codereview.chromium.org/7453014/diff/16001/chrome/browser/sync/api/sync_error.cc#newcode46 chrome/browser/sync/api/sync_error.cc:46: DCHECK(IsInitialized()); should probably be a CHECK, too, ...
9 years, 5 months ago (2011-07-21 23:03:53 UTC) #5
Nicolas Zea
PTAL http://codereview.chromium.org/7453014/diff/16001/chrome/browser/sync/api/sync_error.cc File chrome/browser/sync/api/sync_error.cc (right): http://codereview.chromium.org/7453014/diff/16001/chrome/browser/sync/api/sync_error.cc#newcode46 chrome/browser/sync/api/sync_error.cc:46: DCHECK(IsInitialized()); On 2011/07/21 23:03:53, akalin wrote: > should ...
9 years, 5 months ago (2011-07-21 23:43:26 UTC) #6
akalin
http://codereview.chromium.org/7453014/diff/16001/chrome/browser/sync/api/sync_error.h File chrome/browser/sync/api/sync_error.h (right): http://codereview.chromium.org/7453014/diff/16001/chrome/browser/sync/api/sync_error.h#newcode33 chrome/browser/sync/api/sync_error.h:33: On 2011/07/21 23:43:26, nzea wrote: > On 2011/07/21 23:03:53, ...
9 years, 5 months ago (2011-07-22 00:10:04 UTC) #7
Nicolas Zea
Comments addressed. As discussed, I've also switched back to IsSet(), instead of HasError. http://codereview.chromium.org/7453014/diff/14004/chrome/browser/sync/api/sync_error.cc File ...
9 years, 5 months ago (2011-07-25 20:57:27 UTC) #8
akalin
More comments http://codereview.chromium.org/7453014/diff/5063/chrome/browser/prefs/pref_model_associator.cc File chrome/browser/prefs/pref_model_associator.cc (right): http://codereview.chromium.org/7453014/diff/5063/chrome/browser/prefs/pref_model_associator.cc#newcode165 chrome/browser/prefs/pref_model_associator.cc:165: } else { i think it's cleaner ...
9 years, 5 months ago (2011-07-25 22:43:13 UTC) #9
Nicolas Zea
PTAL http://codereview.chromium.org/7453014/diff/5063/chrome/browser/prefs/pref_model_associator.cc File chrome/browser/prefs/pref_model_associator.cc (right): http://codereview.chromium.org/7453014/diff/5063/chrome/browser/prefs/pref_model_associator.cc#newcode165 chrome/browser/prefs/pref_model_associator.cc:165: } else { On 2011/07/25 22:43:13, akalin wrote: ...
9 years, 5 months ago (2011-07-25 23:08:19 UTC) #10
akalin
LGTM http://codereview.chromium.org/7453014/diff/5063/chrome/browser/sync/api/sync_error.cc File chrome/browser/sync/api/sync_error.cc (right): http://codereview.chromium.org/7453014/diff/5063/chrome/browser/sync/api/sync_error.cc#newcode25 chrome/browser/sync/api/sync_error.cc:25: if (this == &other) { On 2011/07/25 23:08:19, ...
9 years, 5 months ago (2011-07-25 23:49:32 UTC) #11
Nicolas Zea
9 years, 5 months ago (2011-07-26 00:23:46 UTC) #12
Committing once trybots go green.

http://codereview.chromium.org/7453014/diff/8007/chrome/browser/sync/profile_...
File chrome/browser/sync/profile_sync_service.cc (right):

http://codereview.chromium.org/7453014/diff/8007/chrome/browser/sync/profile_...
chrome/browser/sync/profile_sync_service.cc:1281: std::string message =
On 2011/07/25 23:49:32, akalin wrote:
> I get nervous with type-unsafe APIs like Stringprintf and c_str().  Can you
use
> stringstreams here instead?

Style guide discourages streams when not used directly for logs. Gone ahead and
worked around the stringprintf/c_str usage though by adding a helper util for
converting ConfigureStatus to string.

Powered by Google App Engine
This is Rietveld 408576698