summaryrefslogtreecommitdiffstats
path: root/sync/test
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-12 19:25:25 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-12 19:25:25 +0000
commit47b0ab7c912b4b884c6876c2b6c05c6e8e53a9e1 (patch)
tree5add5e881a6c742a134d0880f0657f1502ad8db9 /sync/test
parentf8621b0f6d9652721f012fe68595be02f644ac00 (diff)
downloadchromium_src-47b0ab7c912b4b884c6876c2b6c05c6e8e53a9e1.zip
chromium_src-47b0ab7c912b4b884c6876c2b6c05c6e8e53a9e1.tar.gz
chromium_src-47b0ab7c912b4b884c6876c2b6c05c6e8e53a9e1.tar.bz2
reland: sync: Initialize entries with a 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. NOTE: The previous version of this patch misused DCHECK() so it did not function correctly in release mode. This has since been fixed. BUG=145412,126505 Review URL: https://chromiumcodereview.appspot.com/11861017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/test')
-rw-r--r--sync/test/engine/test_syncable_utils.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sync/test/engine/test_syncable_utils.cc b/sync/test/engine/test_syncable_utils.cc
index 77be4c3..389a16a 100644
--- a/sync/test/engine/test_syncable_utils.cc
+++ b/sync/test/engine/test_syncable_utils.cc
@@ -71,6 +71,7 @@ void CreateTypeRoot(WriteTransaction* trans,
std::string tag_name = syncer::ModelTypeToRootTag(type);
syncable::MutableEntry node(trans,
syncable::CREATE,
+ type,
TestIdFactory::root(),
tag_name);
DCHECK(node.good());