diff options
author | stanisc <stanisc@chromium.org> | 2015-01-12 11:54:52 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-12 19:56:34 +0000 |
commit | 277354df6e709030559c933b6c8a69836d13a8a2 (patch) | |
tree | 8ced8ad2d4cbc0667c64964ee5bc7e99a85f3f53 /sync/syncable/mutable_entry.h | |
parent | e890fe3c07256d41c2533cd5d5d7268752d2e2c2 (diff) | |
download | chromium_src-277354df6e709030559c933b6c8a69836d13a8a2.zip chromium_src-277354df6e709030559c933b6c8a69836d13a8a2.tar.gz chromium_src-277354df6e709030559c933b6c8a69836d13a8a2.tar.bz2 |
Sync: Support directory entries with unset (implicit) parent ID
This is a part of a larger workitem on supporting datatypes that have implicit
permanent folders. This change prepares Sync directory to handle entries with
unset parent ID. That includes:
1) ParentChildIndex gets ability to resolve an entry without Parent ID to a
datatype root folder based on the entry type.
2) MutableEntity accepts a null Id and gets a constructor overload without
parent ID.
3) Similarly WriteNode accepts initialization with a null parent ID.
4) Added a few extra conditions and checks in the directory validation
routines to handle entries with unset parent ID.
5) Added a few new unit tests.
For now directory entries with implicit parent ID can be created only in test
code. All existing datatypes continue creating entries the old way, with parent ID.
BUG=438313
Review URL: https://codereview.chromium.org/843613002
Cr-Commit-Position: refs/heads/master@{#311090}
Diffstat (limited to 'sync/syncable/mutable_entry.h')
-rw-r--r-- | sync/syncable/mutable_entry.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sync/syncable/mutable_entry.h b/sync/syncable/mutable_entry.h index 615fe80..6f010e6 100644 --- a/sync/syncable/mutable_entry.h +++ b/sync/syncable/mutable_entry.h @@ -30,8 +30,15 @@ class SYNC_EXPORT_PRIVATE MutableEntry : public ModelNeutralMutableEntry { public: MutableEntry(WriteTransaction* trans, CreateNewUpdateItem, const Id& id); - MutableEntry(WriteTransaction* trans, Create, ModelType model_type, - const Id& parent_id, const std::string& name); + MutableEntry(WriteTransaction* trans, + Create, + ModelType model_type, + const std::string& name); + MutableEntry(WriteTransaction* trans, + Create, + ModelType model_type, + const Id& parent_id, + const std::string& name); MutableEntry(WriteTransaction* trans, GetByHandle, int64); MutableEntry(WriteTransaction* trans, GetById, const Id&); MutableEntry(WriteTransaction* trans, GetByClientTag, const std::string& tag); |