summaryrefslogtreecommitdiffstats
path: root/sync/syncable/entry_kernel.cc
diff options
context:
space:
mode:
authorstanisc <stanisc@chromium.org>2015-06-19 19:08:21 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-20 02:08:58 +0000
commit5f55952649a3a412b6d836672feea36bb003b0f9 (patch)
tree3e69406ebb5d7384e824e254283c9e8d1c468d22 /sync/syncable/entry_kernel.cc
parentaf86c2b3dfcbdf6446b41729b443c99a3777bb26 (diff)
downloadchromium_src-5f55952649a3a412b6d836672feea36bb003b0f9.zip
chromium_src-5f55952649a3a412b6d836672feea36bb003b0f9.tar.gz
chromium_src-5f55952649a3a412b6d836672feea36bb003b0f9.tar.bz2
Sync: Implement sharing of sync data in the directory using ProtoValuePtr
1) In EntryKernel sync_pb::EntitySpecifics and sync_pb::AttachmentMetadata fields are wrapped with ProtoValuePtr smart pointers that implement COW. This allows implicit sharing of the data when entire instances of EntryKernel are copied. 2) Mutable access to those fields (mutable_ref methods) is removed from EntryKernel and copy methods are added to allow sharing of data between the server and the client fields of EntryKernel. 3) The code that loads EntryKernel fields from Sync DB is modified to perform binary comparison of the serialized data and share the values between the server and the client fields of EntryKernel. 4) In MutableEntry and ModelNeutralMutableEntry, the following Put* methods are modified to perform an additional check for the sharing opportunity between the assigned field and another field that is likely to be source for the value being assigned and therefore have an identical value: - PutServerSpecifics checks against SPECIFICS - PutSpecifics checks agains against SERVER_SPECIFICS - PutBaseServerSpecifics checks against SERVER_SPECIFICS - PutServerAttachmentMetadata checks against ATTACHMENT_METADATA - PutAttachmentMetadata checks against SERVER_ATTACHMENT_METADATA BUG=499443 Review URL: https://codereview.chromium.org/1191013006 Cr-Commit-Position: refs/heads/master@{#335419}
Diffstat (limited to 'sync/syncable/entry_kernel.cc')
-rw-r--r--sync/syncable/entry_kernel.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sync/syncable/entry_kernel.cc b/sync/syncable/entry_kernel.cc
index c51b1a6..52481f2 100644
--- a/sync/syncable/entry_kernel.cc
+++ b/sync/syncable/entry_kernel.cc
@@ -14,7 +14,7 @@ namespace syncable {
EntryKernel::EntryKernel() : dirty_(false) {
// Everything else should already be default-initialized.
- for (int i = INT64_FIELDS_BEGIN; i < INT64_FIELDS_END; ++i) {
+ for (int i = 0; i < INT64_FIELDS_COUNT; ++i) {
int64_fields[i] = 0;
}
}