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

Issue 11817010: sync: Initialize entries with a valid model type (Closed)

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

Description

sync: Initialize entries with a valid model type This change modifies two important sync functions. The first is MutableEntry's CREATE constructor. It now requires that the ModelType of the entry to be specified when the entry is create. This doesn't quite eliminate the existence of nodes without a valid model type (the CREATE_NEW_UPDATE_ITEM can still make them), but it helps. This paves the way for the upcoming UniquePosition change. Part of that change is that bookmarks must be granted a unique tag on creation. To support this, we must know at creation time the type of a new entry, so we can take the appropriate bookmark-specific steps if necessary. The second function to get a new signature is WriteNode's InitByCreation(), which has been renamed to WriteNode::InitBookmarkByCreation(). The function can only be used to create bookmarks, so the new name describes its function more precisely. Updates to the call-sites of MutableEntry's constructor make up the majority of this change. This change also includes some minor updates to test functions that create entries to make them compatible with the stricter assertions or to make them more closely reflect real world behaviour. BUG=145412, 126505 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=176340

Patch Set 1 #

Total comments: 3

Patch Set 2 : Update comment #

Total comments: 2

Patch Set 3 : Fix broken DCHECKs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+401 lines, -406 lines) Patch
M chrome/browser/sync/glue/bookmark_change_processor.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_autofill_unittest.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service_bookmark_unittest.cc View 2 chunks +3 lines, -4 lines 0 comments Download
M sync/engine/apply_updates_and_resolve_conflicts_command_unittest.cc View 5 chunks +13 lines, -16 lines 0 comments Download
M sync/engine/process_commit_response_command_unittest.cc View 1 11 chunks +78 lines, -105 lines 0 comments Download
M sync/engine/syncer_unittest.cc View 51 chunks +93 lines, -80 lines 0 comments Download
M sync/internal_api/public/test/test_entry_factory.h View 2 chunks +16 lines, -11 lines 0 comments Download
M sync/internal_api/public/write_node.h View 1 2 2 chunks +4 lines, -10 lines 0 comments Download
M sync/internal_api/sync_encryption_handler_impl_unittest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M sync/internal_api/sync_manager_impl_unittest.cc View 1 2 8 chunks +38 lines, -51 lines 0 comments Download
M sync/internal_api/test/test_entry_factory.cc View 1 2 7 chunks +49 lines, -19 lines 0 comments Download
M sync/internal_api/write_node.cc View 1 2 6 chunks +7 lines, -27 lines 0 comments Download
M sync/syncable/mutable_entry.h View 2 chunks +5 lines, -4 lines 0 comments Download
M sync/syncable/mutable_entry.cc View 1 2 3 chunks +24 lines, -12 lines 0 comments Download
M sync/syncable/syncable_unittest.cc View 41 chunks +65 lines, -64 lines 0 comments Download
M sync/test/engine/test_syncable_utils.cc View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
rlarocque
Please review. This patch is big and tedious, but at least it's not very dangerous. ...
7 years, 11 months ago (2013-01-09 01:20:35 UTC) #1
tim (not reviewing)
LGTM https://codereview.chromium.org/11817010/diff/1/sync/engine/process_commit_response_command_unittest.cc File sync/engine/process_commit_response_command_unittest.cc (right): https://codereview.chromium.org/11817010/diff/1/sync/engine/process_commit_response_command_unittest.cc#newcode83 sync/engine/process_commit_response_command_unittest.cc:83: int CreateUnprocessedCommitResult( Comment that the return value is ...
7 years, 11 months ago (2013-01-10 20:16:43 UTC) #2
rlarocque
Patch updated. I'll send this to the CQ soon. https://codereview.chromium.org/11817010/diff/1/sync/engine/process_commit_response_command_unittest.cc File sync/engine/process_commit_response_command_unittest.cc (right): https://codereview.chromium.org/11817010/diff/1/sync/engine/process_commit_response_command_unittest.cc#newcode201 sync/engine/process_commit_response_command_unittest.cc:201: ...
7 years, 11 months ago (2013-01-10 21:32:09 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/11817010/4001
7 years, 11 months ago (2013-01-10 23:20:23 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/11817010/4001
7 years, 11 months ago (2013-01-11 13:34:38 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/11817010/4001
7 years, 11 months ago (2013-01-11 13:43:13 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/11817010/4001
7 years, 11 months ago (2013-01-11 13:52:36 UTC) #7
commit-bot: I haz the power
Change committed as 176340
7 years, 11 months ago (2013-01-11 15:11:23 UTC) #8
Joao da Silva
This broke several bots: http://build.chromium.org/p/chromium.win/buildstatus?builder=Vista%20Tests%20%283%29&number=26229 http://build.chromium.org/p/chromium.mac/buildstatus?builder=Mac10.6%20Tests%20%282%29&number=31185 http://build.chromium.org/p/chromium.mac/buildstatus?builder=Mac10.7%20Tests%20%282%29&number=7505 http://build.chromium.org/p/chromium.linux/buildstatus?builder=Linux%20Aura&number=970 http://build.chromium.org/p/chromium.chromiumos/buildstatus?builder=Linux%20ChromiumOS%20Tests%20%281%29&number=18694 Reverted in https://codereview.chromium.org/11863011/
7 years, 11 months ago (2013-01-11 15:53:59 UTC) #9
Joao da Silva
Great, codereview broke the URLs. Here they are again: http://build.chromium.org/p/chromium.win/buildstatus?builder=Vista%20Tests%20%283%29&number=26229 http://build.chromium.org/p/chromium.mac/buildstatus?builder=Mac10.6%20Tests%20%282%29&number=31185 http://build.chromium.org/p/chromium.mac/buildstatus?builder=Mac10.7%20Tests%20%282%29&number=7505 http://build.chromium.org/p/chromium.linux/buildstatus?builder=Linux%20Aura&number=970 http://build.chromium.org/p/chromium.chromiumos/buildstatus?builder=Linux%20ChromiumOS%20Tests%20%281%29&number=18694 On ...
7 years, 11 months ago (2013-01-11 15:54:54 UTC) #10
rlarocque
7 years, 11 months ago (2013-01-11 18:41:14 UTC) #11
Message was sent while issue was closed.
https://codereview.chromium.org/11817010/diff/4001/sync/internal_api/test/tes...
File sync/internal_api/test/test_entry_factory.cc (right):

https://codereview.chromium.org/11817010/diff/4001/sync/internal_api/test/tes...
sync/internal_api/test/test_entry_factory.cc:123:
DCHECK(entry.PutPredecessor(predecessor_id));
I bet this is the cause of the buildbot failures.

I had fixed this in other patch stacks, but apparently that never got applied to
this one.

https://codereview.chromium.org/11817010/diff/4001/sync/syncable/mutable_entr...
File sync/syncable/mutable_entry.cc (right):

https://codereview.chromium.org/11817010/diff/4001/sync/syncable/mutable_entr...
sync/syncable/mutable_entry.cc:66: DCHECK(trans->directory()->InsertEntry(trans,
kernel_));
Actually, this is the root cause of the failures.  This one would break a lot
more tests.  

This, too, was fixed in a different patch stack.

Powered by Google App Engine
This is Rietveld 408576698