diff options
author | stanisc <stanisc@chromium.org> | 2015-01-30 12:20:31 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-30 20:21:33 +0000 |
commit | 8d4046a92a3314bf5e1b6f1dd6a3c4aed5449e64 (patch) | |
tree | 99940f97995bdc394d36da3602d9820c2e65e7f3 /sync/syncable/directory.h | |
parent | 39cd21120a27c8d3676a84e10637176c8cc69540 (diff) | |
download | chromium_src-8d4046a92a3314bf5e1b6f1dd6a3c4aed5449e64.zip chromium_src-8d4046a92a3314bf5e1b6f1dd6a3c4aed5449e64.tar.gz chromium_src-8d4046a92a3314bf5e1b6f1dd6a3c4aed5449e64.tar.bz2 |
Remove dependency on server generated type root folders
This change prepares the client to deal with implicit permanent folders
in Sync server updates. That includes the following:
- Expect type root folders to not come from the server on the initial
sync. The client auto-creates type root folders for all types except
Bookmarks and Nigori when progress marker changes from empty to
non-empty. These folders are created as local nodes (with client IDs)
that aren't expected to sync back to the server.
- Expect empty parent IDs in updates for both new and existing items.
- Because the client code updates first, the client must expect server
to override locally created type root folders. To enable that the
directory update code that matches update entities to local entities
was updated to look at server unique tags in addition to client
unique tags. Later when the server stops generating folders we
should be able to remove that code.
- Added some extra special cases in Directory::CheckTreeInvariants to
deal with client side created type root folders.
- Added / modified a few tests to cover cases with implicit parent IDs
in updates.
BUG=438313
Review URL: https://codereview.chromium.org/867793003
Cr-Commit-Position: refs/heads/master@{#313977}
Diffstat (limited to 'sync/syncable/directory.h')
-rw-r--r-- | sync/syncable/directory.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sync/syncable/directory.h b/sync/syncable/directory.h index fc0d510..98706b6 100644 --- a/sync/syncable/directory.h +++ b/sync/syncable/directory.h @@ -199,10 +199,13 @@ class SYNC_EXPORT Directory { void GetDownloadProgressAsString( ModelType type, std::string* value_out) const; - size_t GetEntriesCount() const; void SetDownloadProgress( ModelType type, const sync_pb::DataTypeProgressMarker& value); + bool HasEmptyDownloadProgress(ModelType type) const; + + // Gets the total number of entries in the directory. + size_t GetEntriesCount() const; // Gets/Increments transaction version of a model type. Must be called when // holding kernel mutex. |