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

Issue 10832286: sync: Introduce control data types (Closed)

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

Description

sync: Introduce control data types The Nigori node has always been treated specially. It is downloaded during early sync initialization. It has custom encryption, update application, and conflict resolution logic. It is not user-selectable, but is instead always implicitly enabled. This patch replaces a lot of if (NIGORI)' code branches and creates the infrastructure we will need to support other data types that have these properties. These types will be used to store metadata required for the normal operation of the syncer. Notable changes include: - Introduce mutually exclusive lists of control types and user types in model_type.cc. - Create an ApplyControlDataUpdates() function, which will be used to apply changes and resolve conflicts for control data types. - Add some if statements to skip processing of control data updates in the regular conflict resolution code path. - Move around some code to accomodate the above changes. Introduce apply_control_data_updates_unittest.cc and conflict_util.cc - Have SyncBackendHost download all control types during init, not just the NIGORI. - Introduce a PurgeForMigration() function on the DataTypeManagerImpl class to support migration of control data types. This replaces ConfigureWithoutNigori(), which would not have scaled well as additional control data types were addded. - Modify the encryption logic so that only user types may be set to be encrypted. The Nigori is no longer expected to be in the set of encrypted types, though it is no less encrypted than it was before this change. - Use the list of user types to help calculate the list of registered sync prefs. BUG=122825, 111297 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=154522

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Remove redundant test_entry files #

Patch Set 4 : Minor fixes #

Patch Set 5 : Refactor migration #

Patch Set 6 : Fix unit tests #

Total comments: 13

Patch Set 7 : Address comments (never tried to compile, possibly broken) #

Total comments: 2

Patch Set 8 : Rebase #

Total comments: 10

Patch Set 9 : Respond to Nicolas' comments #

Patch Set 10 : Rebase (compiled; not tested) #

Patch Set 11 : Respond to Tim's comments #

Total comments: 1

Patch Set 12 : Big refactor #

Patch Set 13 : Refactor encryption and sync prefs #

Patch Set 14 : Add missing conflict_util files #

Patch Set 15 : Compile fix and diff cleanup #

Patch Set 16 : Small fixes #

Total comments: 12

Patch Set 17 : Update for review comments #

Patch Set 18 : Add ToFullModelTypeSet() function #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+910 lines, -673 lines) Patch
M chrome/browser/sync/backend_migrator.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -15 lines 0 comments Download
M chrome/browser/sync/backend_migrator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 9 chunks +33 lines, -15 lines 0 comments Download
M chrome/browser/sync/glue/data_type_manager.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 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 1 chunk +2 lines, -2 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 2 chunks +7 lines, -7 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 20 chunks +114 lines, -40 lines 0 comments Download
M chrome/browser/sync/glue/data_type_manager_mock.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/sync_backend_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +12 lines, -12 lines 0 comments Download
M chrome/browser/sync/sync_prefs.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +7 lines, -7 lines 0 comments Download
A sync/engine/apply_control_data_updates.h View 1 chunk +23 lines, -0 lines 0 comments Download
A sync/engine/apply_control_data_updates.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +138 lines, -0 lines 0 comments Download
A sync/engine/apply_control_data_updates_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +347 lines, -0 lines 0 comments Download
M sync/engine/apply_updates_command.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +8 lines, -0 lines 0 comments Download
M sync/engine/apply_updates_command_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 9 chunks +6 lines, -357 lines 0 comments Download
M sync/engine/conflict_resolver.h View 1 chunk +0 lines, -4 lines 0 comments Download
M sync/engine/conflict_resolver.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +15 lines, -85 lines 0 comments Download
A sync/engine/conflict_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +31 lines, -0 lines 0 comments Download
A sync/engine/conflict_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +51 lines, -0 lines 0 comments Download
M sync/engine/syncer.cc View 2 chunks +4 lines, -0 lines 0 comments Download
M sync/engine/syncer_util.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +0 lines, -48 lines 0 comments Download
M sync/internal_api/public/base/model_type.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 5 chunks +33 lines, -4 lines 2 comments Download
M sync/internal_api/public/sync_encryption_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -3 lines 0 comments Download
M sync/internal_api/sync_encryption_handler_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +11 lines, -7 lines 0 comments Download
M sync/internal_api/sync_encryption_handler_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 10 chunks +13 lines, -48 lines 0 comments Download
M sync/internal_api/sync_manager_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +9 lines, -9 lines 0 comments Download
M sync/sync.gyp View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +7 lines, -2 lines 0 comments Download
M sync/syncable/model_type.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +28 lines, -0 lines 0 comments Download
M sync/syncable/nigori_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
rlarocque
tim: Please review everything. zea: You might be interested in the changes related to the ...
8 years, 4 months ago (2012-08-14 22:28:49 UTC) #1
rlarocque
http://codereview.chromium.org/10832286/diff/7046/chrome/browser/sync/backend_migrator.cc File chrome/browser/sync/backend_migrator.cc (right): http://codereview.chromium.org/10832286/diff/7046/chrome/browser/sync/backend_migrator.cc#newcode107 chrome/browser/sync/backend_migrator.cc:107: manager_->Purge(to_migrate_, syncer::CONFIGURE_REASON_MIGRATION); This is a scary change. I'm pretty ...
8 years, 4 months ago (2012-08-14 22:33:06 UTC) #2
Nicolas Zea
You should probably rebase this, as it is going to conflict mightily with my recent ...
8 years, 4 months ago (2012-08-16 20:55:02 UTC) #3
rlarocque
Applied recommendations from comments then rebased. I had to resolve a few rebase conflicts by ...
8 years, 4 months ago (2012-08-17 19:47:18 UTC) #4
Nicolas Zea
http://codereview.chromium.org/10832286/diff/7046/sync/engine/apply_control_data_updates_unittest.cc File sync/engine/apply_control_data_updates_unittest.cc (right): http://codereview.chromium.org/10832286/diff/7046/sync/engine/apply_control_data_updates_unittest.cc#newcode124 sync/engine/apply_control_data_updates_unittest.cc:124: EXPECT_TRUE(cryptographer->GetEncryptedTypes().Equals(ModelTypeSet::All())); On 2012/08/17 19:47:18, rlarocque wrote: > On 2012/08/16 ...
8 years, 4 months ago (2012-08-20 20:44:28 UTC) #5
tim (not reviewing)
http://codereview.chromium.org/10832286/diff/10002/chrome/browser/sync/glue/data_type_manager_impl.h File chrome/browser/sync/glue/data_type_manager_impl.h (right): http://codereview.chromium.org/10832286/diff/10002/chrome/browser/sync/glue/data_type_manager_impl.h#newcode37 chrome/browser/sync/glue/data_type_manager_impl.h:37: virtual void Purge( Lets call this PurgeForMigration to back ...
8 years, 4 months ago (2012-08-22 22:42:28 UTC) #6
rlarocque
The responses to Nicolas' comments are in patch set 9. I'm still working on the ...
8 years, 4 months ago (2012-08-22 23:46:24 UTC) #7
rlarocque
Patch updated with responses to Tim's comments. I've also changed some of the logic in ...
8 years, 4 months ago (2012-08-23 20:11:23 UTC) #8
rlarocque
Here's the big refactor we discussed on Friday. Because we now have a solid definition ...
8 years, 3 months ago (2012-08-28 19:58:42 UTC) #9
tim (not reviewing)
Looking good, just a couple nits remaining on my end. http://codereview.chromium.org/10832286/diff/27001/chrome/browser/sync/glue/sync_backend_registrar.cc File chrome/browser/sync/glue/sync_backend_registrar.cc (right): http://codereview.chromium.org/10832286/diff/27001/chrome/browser/sync/glue/sync_backend_registrar.cc#newcode89 ...
8 years, 3 months ago (2012-08-30 20:18:33 UTC) #10
Nicolas Zea
encryption LGTM with some nits http://codereview.chromium.org/10832286/diff/34002/sync/engine/apply_control_data_updates.cc File sync/engine/apply_control_data_updates.cc (right): http://codereview.chromium.org/10832286/diff/34002/sync/engine/apply_control_data_updates.cc#newcode35 sync/engine/apply_control_data_updates.cc:35: // Update the cryptographer ...
8 years, 3 months ago (2012-08-30 20:37:02 UTC) #11
tim (not reviewing)
http://codereview.chromium.org/10832286/diff/34002/sync/engine/apply_updates_command.cc File sync/engine/apply_updates_command.cc (right): http://codereview.chromium.org/10832286/diff/34002/sync/engine/apply_updates_command.cc#newcode87 sync/engine/apply_updates_command.cc:87: if (!IsControlType(it.Get())) { On 2012/08/30 20:18:33, timsteele wrote: > ...
8 years, 3 months ago (2012-08-30 20:40:07 UTC) #12
rlarocque
Patch updated. Tim, we should discuss the ModelTypeSet::RemoveAll() issue offline. http://codereview.chromium.org/10832286/diff/34002/sync/engine/apply_control_data_updates.cc File sync/engine/apply_control_data_updates.cc (right): http://codereview.chromium.org/10832286/diff/34002/sync/engine/apply_control_data_updates.cc#newcode35 ...
8 years, 3 months ago (2012-08-30 21:01:48 UTC) #13
tim (not reviewing)
http://codereview.chromium.org/10832286/diff/34002/sync/engine/apply_updates_command.cc File sync/engine/apply_updates_command.cc (right): http://codereview.chromium.org/10832286/diff/34002/sync/engine/apply_updates_command.cc#newcode63 sync/engine/apply_updates_command.cc:63: server_type_restriction.Remove(i.Get()); On 2012/08/30 21:01:48, rlarocque wrote: > On 2012/08/30 ...
8 years, 3 months ago (2012-08-30 21:41:04 UTC) #14
akalin
On 2012/08/30 21:41:04, timsteele wrote: > Alternatively Fred mentioned we could likely have an EnumSet ...
8 years, 3 months ago (2012-08-30 21:45:59 UTC) #15
rlarocque
On 2012/08/30 21:41:04, timsteele wrote: > http://codereview.chromium.org/10832286/diff/34002/sync/engine/apply_updates_command.cc > File sync/engine/apply_updates_command.cc (right): > > http://codereview.chromium.org/10832286/diff/34002/sync/engine/apply_updates_command.cc#newcode63 > ...
8 years, 3 months ago (2012-08-30 21:53:59 UTC) #16
tim (not reviewing)
On 2012/08/30 21:53:59, rlarocque wrote: > On 2012/08/30 21:41:04, timsteele wrote: > > > http://codereview.chromium.org/10832286/diff/34002/sync/engine/apply_updates_command.cc ...
8 years, 3 months ago (2012-08-30 22:22:12 UTC) #17
akalin
> If we do it that way, then we end up having to explicitly convert ...
8 years, 3 months ago (2012-08-30 22:24:51 UTC) #18
rlarocque
On 2012/08/30 22:24:51, akalin wrote: > > If we do it that way, then we ...
8 years, 3 months ago (2012-08-30 22:35:20 UTC) #19
akalin
> I'm more concerned about what would happen if we were to make EnumSet > ...
8 years, 3 months ago (2012-08-30 22:53:30 UTC) #20
tim (not reviewing)
On 2012/08/30 22:35:20, rlarocque wrote: > On 2012/08/30 22:24:51, akalin wrote: > > > If ...
8 years, 3 months ago (2012-08-30 23:22:03 UTC) #21
rlarocque
Patch updated. I ended up doing it the easy way, as Tim suggested.
8 years, 3 months ago (2012-08-30 23:56:37 UTC) #22
tim (not reviewing)
LGTM with nit http://codereview.chromium.org/10832286/diff/52003/sync/internal_api/public/base/model_type.h File sync/internal_api/public/base/model_type.h (right): http://codereview.chromium.org/10832286/diff/52003/sync/internal_api/public/base/model_type.h#newcode165 sync/internal_api/public/base/model_type.h:165: FullModelTypeSet ToFullModelTypeSet(ModelTypeSet in); const ModelTypeSet& in
8 years, 3 months ago (2012-08-31 00:06:10 UTC) #23
rlarocque
http://codereview.chromium.org/10832286/diff/52003/sync/internal_api/public/base/model_type.h File sync/internal_api/public/base/model_type.h (right): http://codereview.chromium.org/10832286/diff/52003/sync/internal_api/public/base/model_type.h#newcode165 sync/internal_api/public/base/model_type.h:165: FullModelTypeSet ToFullModelTypeSet(ModelTypeSet in); On 2012/08/31 00:06:10, timsteele wrote: > ...
8 years, 3 months ago (2012-08-31 00:12:43 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/10832286/52003
8 years, 3 months ago (2012-08-31 17:54:41 UTC) #25
commit-bot: I haz the power
8 years, 3 months ago (2012-08-31 22:32:51 UTC) #26
Change committed as 154522

Powered by Google App Engine
This is Rietveld 408576698