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

Issue 12847003: Separate invalidator and sync client ID (part 2/2) (Closed)

Created:
7 years, 9 months ago by rlarocque
Modified:
7 years, 9 months ago
Reviewers:
Nicolas Zea
CC:
chromium-reviews, Raghu Simha, haitaol1, akalin, tim (not reviewing)
Visibility:
Public.

Description

Separate invalidator and sync client ID (part 2/2) In r180907, we started saving the sync ID to a pref. By now, many clients will have exercised that code path and copied their sync ID into that preference. Prior to this commit, we never read from that preference. Most pre-existing clients will now have two copies of their sync ID: one in the sync DB, and one in their preferences. Meanwhile, in r185721 (part 1 of this set of patches), we extended the protocol to support separate notifier and sync client IDs. Prior to that patch, we always used a single ID for both the invalidation client and sync client. In that patch, we made sure that the value of both IDs were identical. This commit takes advantage of that prior work to create an invalidator ID that is separate from the sync ID. It's important that the invalidator client ID never change once it has been initialized, so this commit tries to use the old client ID (which is equal to the sync ID at the time of this migration) on existing clients. New clients have no such requirement, so their sync and invalidator IDs will be different. This is implemented by using the preference (which may have been initialized earlier, thanks to r180907) as the source of the invalidator ID. If the invalidator ID was not previously set, the code that initializes the invalidator will create a new one. This process is entirely independent from the sync code. The syncer will continue to report the sync client ID as before, but it will now be provided with the invalidator ID during its construction. It no longer has any control over this ID. As part of this change, the many invalidator implementations have been modified to accept a 'notifier_client_id' parameter in their constructor. This API change better reflects the fact that the client ID may not be changed at runtime, and is made possible by the fact that the notifier client ID is now available before the notifier is constructed. Finally, this code removes the hacks that were used to help support this migration. This includes the logic to forward the invalidator ID to the preferences store when it was initialized on the sync thread, and the code that sets the invalidator ID to be equal to the sync ID. BUG=124142 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=191087

Patch Set 1 #

Total comments: 4

Patch Set 2 : Rebase #

Patch Set 3 : Review fixes #

Patch Set 4 : Fix stand-alone sync client #

Patch Set 5 : Rebase #

Patch Set 6 : Fix sync_listen_notifications utility #

Unified diffs Side-by-side diffs Delta from patch set Stats (+120 lines, -124 lines) Patch
M chrome/browser/sync/glue/android_invalidator_bridge.h View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/android_invalidator_bridge.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/android_invalidator_bridge_proxy.h View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/android_invalidator_bridge_proxy.cc View 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/sync/invalidations/invalidator_storage.h View 2 chunks +1 line, -3 lines 0 comments Download
M chrome/browser/sync/invalidations/invalidator_storage.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_unittest.cc View 2 chunks +1 line, -4 lines 0 comments Download
M sync/internal_api/public/sync_manager.h View 2 chunks +3 lines, -0 lines 0 comments Download
M sync/internal_api/public/test/fake_sync_manager.h View 1 chunk +1 line, -0 lines 0 comments Download
M sync/internal_api/sync_manager_impl.h View 1 chunk +1 line, -0 lines 0 comments Download
M sync/internal_api/sync_manager_impl.cc View 1 2 chunks +1 line, -5 lines 0 comments Download
M sync/internal_api/sync_manager_impl_unittest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M sync/internal_api/test/fake_sync_manager.cc View 1 chunk +1 line, -0 lines 0 comments Download
M sync/notifier/fake_invalidation_state_tracker.h View 1 chunk +1 line, -0 lines 0 comments Download
M sync/notifier/fake_invalidation_state_tracker.cc View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M sync/notifier/fake_invalidator.h View 2 chunks +0 lines, -2 lines 0 comments Download
M sync/notifier/fake_invalidator.cc View 2 chunks +0 lines, -8 lines 0 comments Download
M sync/notifier/fake_invalidator_unittest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M sync/notifier/invalidation_notifier.h View 3 chunks +2 lines, -2 lines 0 comments Download
M sync/notifier/invalidation_notifier.cc View 3 chunks +3 lines, -8 lines 0 comments Download
M sync/notifier/invalidation_notifier_unittest.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M sync/notifier/invalidation_state_tracker.h View 1 chunk +3 lines, -0 lines 0 comments Download
M sync/notifier/invalidator.h View 1 chunk +0 lines, -5 lines 0 comments Download
M sync/notifier/invalidator_factory.h View 1 chunk +9 lines, -4 lines 0 comments Download
M sync/notifier/invalidator_factory.cc View 1 2 5 chunks +42 lines, -11 lines 0 comments Download
M sync/notifier/invalidator_registrar_unittest.cc View 2 chunks +1 line, -4 lines 0 comments Download
M sync/notifier/invalidator_test_template.h View 1 chunk +2 lines, -2 lines 0 comments Download
M sync/notifier/non_blocking_invalidator.h View 1 2 2 chunks +1 line, -1 line 0 comments Download
M sync/notifier/non_blocking_invalidator.cc View 1 2 8 chunks +5 lines, -16 lines 0 comments Download
M sync/notifier/non_blocking_invalidator_unittest.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M sync/notifier/p2p_invalidator.h View 3 chunks +2 lines, -2 lines 0 comments Download
M sync/notifier/p2p_invalidator.cc View 6 chunks +8 lines, -10 lines 0 comments Download
M sync/notifier/p2p_invalidator_unittest.cc View 5 chunks +4 lines, -4 lines 0 comments Download
M sync/notifier/sync_invalidation_listener.cc View 1 chunk +0 lines, -10 lines 0 comments Download
M sync/notifier/sync_invalidation_listener_unittest.cc View 2 chunks +0 lines, -13 lines 0 comments Download
M sync/tools/null_invalidation_state_tracker.h View 1 chunk +2 lines, -0 lines 0 comments Download
M sync/tools/null_invalidation_state_tracker.cc View 1 2 3 4 5 2 chunks +10 lines, -0 lines 0 comments Download
M sync/tools/sync_client.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M sync/tools/sync_listen_notifications.cc View 1 2 3 4 5 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
rlarocque
I can't commit this change until the server adds support for the separate sync and ...
7 years, 9 months ago (2013-03-15 21:08:30 UTC) #1
rlarocque
I think the server support has been pushed. PTAL.
7 years, 9 months ago (2013-03-20 20:27:54 UTC) #2
Nicolas Zea
LGTM with some some nits https://codereview.chromium.org/12847003/diff/1/sync/notifier/invalidator_factory.cc File sync/notifier/invalidator_factory.cc (right): https://codereview.chromium.org/12847003/diff/1/sync/notifier/invalidator_factory.cc#newcode72 sync/notifier/invalidator_factory.cc:72: invalidation_state_tracker->SetInvalidatorClientId( why not have ...
7 years, 9 months ago (2013-03-20 21:17:33 UTC) #3
rlarocque
New patch uploaded. I might have to upload yet another patch after this one. I ...
7 years, 9 months ago (2013-03-20 23:25:33 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/12847003/12001
7 years, 9 months ago (2013-03-20 23:49:01 UTC) #5
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 9 months ago (2013-03-21 00:24:31 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/12847003/23001
7 years, 9 months ago (2013-03-21 18:16:09 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/12847003/23001
7 years, 9 months ago (2013-03-22 18:50:49 UTC) #8
rlarocque
I was working on a local branch with this patch applied and found that reflection ...
7 years, 9 months ago (2013-03-22 22:58:41 UTC) #9
rlarocque
On 2013/03/22 22:58:41, rlarocque wrote: > I was working on a local branch with this ...
7 years, 9 months ago (2013-03-27 18:41:20 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/12847003/23001
7 years, 9 months ago (2013-03-27 18:44:19 UTC) #11
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=128271
7 years, 9 months ago (2013-03-27 23:00:08 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/12847003/23001
7 years, 9 months ago (2013-03-27 23:05:21 UTC) #13
commit-bot: I haz the power
7 years, 9 months ago (2013-03-28 01:34:57 UTC) #14
Message was sent while issue was closed.
Change committed as 191087

Powered by Google App Engine
This is Rietveld 408576698