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}