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

Issue 10804039: Make SyncBackendRegistrar aware of loaded data (Closed)

Created:
8 years, 5 months ago by rlarocque
Modified:
8 years, 4 months ago
CC:
chromium-reviews, Raghu Simha, ncarter (slow), akalin
Visibility:
Public.

Description

Make SyncBackendRegistrar aware of loaded data Adds a parameter to the SyncManager::Initialize() callback to inform the caller which sync data types were successfully loaded from disk. This allows the SyncBackendHost and related classes make better decisions during initialization. If necessary, the SyncBackendHost will send a configure request to the syncer during early initialization asking it to download the nigori node. Now we can guarantee that the node will be available by the type ProfileSyncService::OnBackendInitialized() is called. The SyncBackendHost test expectations had to be amended to account for this test. Most of the changes are related to the fact that our behaviour no longer depends on the SyncPrefs. The ProfileSyncService*Tests were very much affected by this change. Those tests are parameterized with a callback that is used to initialize the sync DB and pretend that it had been loaded from disk. Previously, this callback would be executed later on during initialization, around the time of ProfileSyncService::OnBackendInitialize(). That approach was incompatible with this change, which requires that we have access to the fully initialized database around the time we return from SyncBackendHost::Initialize(). The callback had to be moved, which meant that it now required an explicit UserShare parameter, which meant that a lot of call sites had to be updated. BUG=129825 TEST= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=148926

Patch Set 1 #

Total comments: 38

Patch Set 2 : Rebase #

Patch Set 3 : Address some comments #

Patch Set 4 : Fix sync_client #

Patch Set 5 : Comments and Indents #

Total comments: 2

Patch Set 6 : Better comments #

Total comments: 12

Patch Set 7 : Another update #

Patch Set 8 : Reduce tests diffs #

Patch Set 9 : Inline SignIn and UpdateCredentials #

Total comments: 11

Patch Set 10 : More init changes #

Total comments: 11

Patch Set 11 : Rebase #

Patch Set 12 : Address some comments #

Patch Set 13 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+385 lines, -337 lines) Patch
M chrome/browser/sync/glue/sync_backend_host.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +8 lines, -5 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.cc View 1 2 3 4 5 6 7 8 9 10 10 chunks +73 lines, -60 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 13 chunks +42 lines, -47 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_registrar.h View 1 chunk +8 lines, -6 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_registrar.cc View 1 2 2 chunks +26 lines, -15 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_registrar_unittest.cc View 5 chunks +10 lines, -5 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 2 chunks +0 lines, -9 lines 0 comments Download
M chrome/browser/sync/test_profile_sync_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +23 lines, -8 lines 0 comments Download
M chrome/browser/sync/test_profile_sync_service.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +59 lines, -44 lines 0 comments Download
M sync/engine/sync_scheduler_unittest.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M sync/engine/sync_scheduler_whitebox_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M sync/engine/syncer_unittest.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M sync/internal_api/debug_info_event_listener.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M sync/internal_api/debug_info_event_listener.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M sync/internal_api/internal_components_factory_impl.cc View 1 2 chunks +4 lines, -4 lines 0 comments Download
M sync/internal_api/js_sync_manager_observer.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M sync/internal_api/js_sync_manager_observer.cc View 1 1 chunk +6 lines, -2 lines 0 comments Download
M sync/internal_api/js_sync_manager_observer_unittest.cc View 1 1 chunk +16 lines, -5 lines 0 comments Download
M sync/internal_api/public/internal_components_factory.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M sync/internal_api/public/internal_components_factory_impl.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M sync/internal_api/public/sync_manager.h View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download
M sync/internal_api/public/test/fake_sync_manager.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -1 line 0 comments Download
M sync/internal_api/public/test/test_internal_components_factory.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M sync/internal_api/sync_manager_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -6 lines 0 comments Download
M sync/internal_api/sync_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 9 chunks +64 lines, -80 lines 0 comments Download
M sync/internal_api/syncapi_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +5 lines, -5 lines 0 comments Download
M sync/internal_api/test/fake_sync_manager.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +3 lines, -3 lines 0 comments Download
M sync/internal_api/test/test_internal_components_factory.cc View 1 2 chunks +4 lines, -4 lines 0 comments Download
M sync/sessions/sync_session_context.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M sync/sessions/sync_session_context.cc View 1 2 chunks +0 lines, -2 lines 0 comments Download
M sync/sessions/sync_session_unittest.cc View 1 2 3 4 5 6 2 chunks +16 lines, -11 lines 0 comments Download
M sync/test/engine/syncer_command_test.h View 1 1 chunk +1 line, -1 line 0 comments Download
M sync/tools/sync_client.cc View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 29 (0 generated)
rlarocque
This is a big patch, so let's split it up. Tim: Please review the tests. ...
8 years, 5 months ago (2012-07-20 17:28:40 UTC) #1
tim (not reviewing)
Cool patch! Preliminary comment. http://codereview.chromium.org/10804039/diff/1/chrome/browser/sync/test_profile_sync_service.cc File chrome/browser/sync/test_profile_sync_service.cc (right): http://codereview.chromium.org/10804039/diff/1/chrome/browser/sync/test_profile_sync_service.cc#newcode104 chrome/browser/sync/test_profile_sync_service.cc:104: callback_.Run(GetUserShareForTest()); Plumbing the UserShare* around ...
8 years, 5 months ago (2012-07-20 21:00:57 UTC) #2
rlarocque
http://codereview.chromium.org/10804039/diff/1/chrome/browser/sync/test_profile_sync_service.cc File chrome/browser/sync/test_profile_sync_service.cc (right): http://codereview.chromium.org/10804039/diff/1/chrome/browser/sync/test_profile_sync_service.cc#newcode104 chrome/browser/sync/test_profile_sync_service.cc:104: callback_.Run(GetUserShareForTest()); On 2012/07/20 21:00:57, timsteele wrote: > Plumbing the ...
8 years, 5 months ago (2012-07-20 21:17:59 UTC) #3
Nicolas Zea
http://codereview.chromium.org/10804039/diff/1/chrome/browser/sync/glue/sync_backend_host.cc File chrome/browser/sync/glue/sync_backend_host.cc (right): http://codereview.chromium.org/10804039/diff/1/chrome/browser/sync/glue/sync_backend_host.cc#newcode592 chrome/browser/sync/glue/sync_backend_host.cc:592: // never send a new configure request until the ...
8 years, 5 months ago (2012-07-20 21:35:39 UTC) #4
rlarocque
http://codereview.chromium.org/10804039/diff/1/chrome/browser/sync/glue/sync_backend_host.cc File chrome/browser/sync/glue/sync_backend_host.cc (right): http://codereview.chromium.org/10804039/diff/1/chrome/browser/sync/glue/sync_backend_host.cc#newcode592 chrome/browser/sync/glue/sync_backend_host.cc:592: // never send a new configure request until the ...
8 years, 5 months ago (2012-07-20 23:20:05 UTC) #5
Nicolas Zea
On 2012/07/20 23:20:05, rlarocque wrote: > http://codereview.chromium.org/10804039/diff/1/chrome/browser/sync/glue/sync_backend_host.cc > File chrome/browser/sync/glue/sync_backend_host.cc (right): > > http://codereview.chromium.org/10804039/diff/1/chrome/browser/sync/glue/sync_backend_host.cc#newcode592 > ...
8 years, 5 months ago (2012-07-21 00:17:35 UTC) #6
rlarocque
On 2012/07/21 00:17:35, nzea wrote: > On 2012/07/20 23:20:05, rlarocque wrote: > > > http://codereview.chromium.org/10804039/diff/1/chrome/browser/sync/glue/sync_backend_host.cc ...
8 years, 5 months ago (2012-07-21 01:42:50 UTC) #7
Nicolas Zea
By the way, I don't think you addressed all my comments from the first review ...
8 years, 5 months ago (2012-07-23 19:12:16 UTC) #8
rlarocque
Patch updated. I think we should talk offline about the GetUserShareForTest()/TestProfileSyncService init issues. On 2012/07/23 ...
8 years, 5 months ago (2012-07-23 20:05:16 UTC) #9
tim (not reviewing)
http://codereview.chromium.org/10804039/diff/1/chrome/browser/sync/test_profile_sync_service.cc File chrome/browser/sync/test_profile_sync_service.cc (right): http://codereview.chromium.org/10804039/diff/1/chrome/browser/sync/test_profile_sync_service.cc#newcode104 chrome/browser/sync/test_profile_sync_service.cc:104: callback_.Run(GetUserShareForTest()); On 2012/07/20 21:17:59, rlarocque wrote: > On 2012/07/20 ...
8 years, 5 months ago (2012-07-23 20:33:19 UTC) #10
Nicolas Zea
Mostly nits http://codereview.chromium.org/10804039/diff/16001/chrome/browser/sync/glue/sync_backend_host.cc File chrome/browser/sync/glue/sync_backend_host.cc (right): http://codereview.chromium.org/10804039/diff/16001/chrome/browser/sync/glue/sync_backend_host.cc#newcode614 chrome/browser/sync/glue/sync_backend_host.cc:614: // types_to_remove_with_nigori from the list then adding ...
8 years, 5 months ago (2012-07-23 20:47:15 UTC) #11
rlarocque
http://codereview.chromium.org/10804039/diff/1/chrome/browser/sync/glue/sync_backend_host.cc File chrome/browser/sync/glue/sync_backend_host.cc (right): http://codereview.chromium.org/10804039/diff/1/chrome/browser/sync/glue/sync_backend_host.cc#newcode607 chrome/browser/sync/glue/sync_backend_host.cc:607: // types_to_remove_with_nigori from the list then adding On 2012/07/20 ...
8 years, 5 months ago (2012-07-23 20:50:29 UTC) #12
tim (not reviewing)
http://codereview.chromium.org/10804039/diff/1/chrome/browser/sync/test_profile_sync_service.cc File chrome/browser/sync/test_profile_sync_service.cc (right): http://codereview.chromium.org/10804039/diff/1/chrome/browser/sync/test_profile_sync_service.cc#newcode104 chrome/browser/sync/test_profile_sync_service.cc:104: callback_.Run(GetUserShareForTest()); On 2012/07/23 20:50:30, rlarocque wrote: > On 2012/07/23 ...
8 years, 5 months ago (2012-07-23 21:01:58 UTC) #13
rlarocque
Responding to Nicolas' comments. http://codereview.chromium.org/10804039/diff/16001/chrome/browser/sync/glue/sync_backend_host.cc File chrome/browser/sync/glue/sync_backend_host.cc (right): http://codereview.chromium.org/10804039/diff/16001/chrome/browser/sync/glue/sync_backend_host.cc#newcode614 chrome/browser/sync/glue/sync_backend_host.cc:614: // types_to_remove_with_nigori from the list ...
8 years, 5 months ago (2012-07-23 23:16:10 UTC) #14
Nicolas Zea
my part LGTM http://codereview.chromium.org/10804039/diff/1/sync/internal_api/sync_manager_impl.cc File sync/internal_api/sync_manager_impl.cc (left): http://codereview.chromium.org/10804039/diff/1/sync/internal_api/sync_manager_impl.cc#oldcode940 sync/internal_api/sync_manager_impl.cc:940: model_safe_routing_info, On 2012/07/23 20:50:30, rlarocque wrote: ...
8 years, 5 months ago (2012-07-23 23:54:55 UTC) #15
rlarocque
Removed the UserShare callback changes. PTAL.
8 years, 5 months ago (2012-07-24 00:35:18 UTC) #16
tim (not reviewing)
On 2012/07/24 00:35:18, rlarocque wrote: > Removed the UserShare callback changes. PTAL. Getting back to ...
8 years, 5 months ago (2012-07-24 01:01:39 UTC) #17
rlarocque
On 2012/07/24 01:01:39, timsteele wrote: > On 2012/07/24 00:35:18, rlarocque wrote: > > Removed the ...
8 years, 5 months ago (2012-07-25 18:44:51 UTC) #18
rlarocque
http://codereview.chromium.org/10804039/diff/18001/sync/internal_api/sync_manager_impl.cc File sync/internal_api/sync_manager_impl.cc (right): http://codereview.chromium.org/10804039/diff/18001/sync/internal_api/sync_manager_impl.cc#newcode415 sync/internal_api/sync_manager_impl.cc:415: share_.name = credentials.email; Formerly part of SignIn() http://codereview.chromium.org/10804039/diff/18001/sync/internal_api/sync_manager_impl.cc#newcode430 sync/internal_api/sync_manager_impl.cc:430: ...
8 years, 5 months ago (2012-07-25 18:45:08 UTC) #19
tim (not reviewing)
On 2012/07/25 18:44:51, rlarocque wrote: > On 2012/07/24 01:01:39, timsteele wrote: > > On 2012/07/24 ...
8 years, 5 months ago (2012-07-26 18:18:31 UTC) #20
tim (not reviewing)
https://chromiumcodereview.appspot.com/10804039/diff/18001/sync/internal_api/sync_manager_impl.cc File sync/internal_api/sync_manager_impl.cc (right): https://chromiumcodereview.appspot.com/10804039/diff/18001/sync/internal_api/sync_manager_impl.cc#newcode432 sync/internal_api/sync_manager_impl.cc:432: if (success) { I know this code did if ...
8 years, 5 months ago (2012-07-26 18:48:05 UTC) #21
rlarocque
Uploaded two new patches. The first one implements Tim's suggestion to re-arrange the failure path ...
8 years, 5 months ago (2012-07-26 21:59:54 UTC) #22
tim (not reviewing)
still looking at s_b_h test changes https://chromiumcodereview.appspot.com/10804039/diff/23002/sync/internal_api/sync_manager_impl.cc File sync/internal_api/sync_manager_impl.cc (left): https://chromiumcodereview.appspot.com/10804039/diff/23002/sync/internal_api/sync_manager_impl.cc#oldcode295 sync/internal_api/sync_manager_impl.cc:295: DCHECK(initialized_); It still ...
8 years, 5 months ago (2012-07-26 22:33:48 UTC) #23
rlarocque
https://chromiumcodereview.appspot.com/10804039/diff/23002/sync/internal_api/sync_manager_impl.cc File sync/internal_api/sync_manager_impl.cc (left): https://chromiumcodereview.appspot.com/10804039/diff/23002/sync/internal_api/sync_manager_impl.cc#oldcode295 sync/internal_api/sync_manager_impl.cc:295: DCHECK(initialized_); On 2012/07/26 22:33:48, timsteele wrote: > It still ...
8 years, 5 months ago (2012-07-26 22:52:20 UTC) #24
tim (not reviewing)
https://chromiumcodereview.appspot.com/10804039/diff/23002/sync/internal_api/sync_manager_impl.cc File sync/internal_api/sync_manager_impl.cc (left): https://chromiumcodereview.appspot.com/10804039/diff/23002/sync/internal_api/sync_manager_impl.cc#oldcode295 sync/internal_api/sync_manager_impl.cc:295: DCHECK(initialized_); On 2012/07/26 22:52:20, rlarocque wrote: > On 2012/07/26 ...
8 years, 5 months ago (2012-07-27 01:54:32 UTC) #25
tim (not reviewing)
LGTM! 3 cheers!
8 years, 4 months ago (2012-07-27 17:35:26 UTC) #26
rlarocque
https://chromiumcodereview.appspot.com/10804039/diff/23002/sync/internal_api/sync_manager_impl.cc File sync/internal_api/sync_manager_impl.cc (left): https://chromiumcodereview.appspot.com/10804039/diff/23002/sync/internal_api/sync_manager_impl.cc#oldcode295 sync/internal_api/sync_manager_impl.cc:295: DCHECK(initialized_); On 2012/07/27 01:54:32, timsteele wrote: > On 2012/07/26 ...
8 years, 4 months ago (2012-07-27 17:47:19 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/10804039/29003
8 years, 4 months ago (2012-07-30 01:54:29 UTC) #28
commit-bot: I haz the power
8 years, 4 months ago (2012-07-30 04:37:50 UTC) #29
Change committed as 148926

Powered by Google App Engine
This is Rietveld 408576698