sync: Refactor MutablEntry internals

This is a follow-up to r223111.  That change modified the public
interface of MutableEntry to expose one setter function for each mutable
field in the EntryKernel.

This change modifies the internals of MutableEntry to match the external
API.  Many of the shared setter functions used to diverge significantly
based on which field was being set.  Now that each field has its own
setter, it's easier to provide different setter implementations for each
field.

Some of these changes might make it look like we're unnecessarily
introducing copy+paste code.  However, we have more CLs on the way that
introduce more differences among the setters.  In particular, many of
the SERVER_* field setters will be modified to no longer call
SaveOriginal().

BUG=284672

Review URL: https://chromiumcodereview.appspot.com/23435008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223537 0039d316-1c4b-4281-b951-d872f2087c98
parent 07d0a6bf
This diff is collapsed.
......@@ -62,7 +62,7 @@ class SYNC_EXPORT_PRIVATE MutableEntry : public Entry {
bool PutIsUnappliedUpdate(bool value);
void PutIsDir(bool value);
void PutServerIsDir(bool value);
bool PutIsDel(bool value);
void PutIsDel(bool value);
void PutServerIsDel(bool value);
void PutNonUniqueName(const std::string& value);
void PutServerNonUniqueName(const std::string& value);
......@@ -107,17 +107,6 @@ class SYNC_EXPORT_PRIVATE MutableEntry : public Entry {
friend class WriteTransaction;
friend class syncer::WriteNode;
bool Put(Int64Field field, const int64& value);
bool Put(TimeField field, const base::Time& value);
bool Put(IdField field, const Id& value);
bool Put(StringField field, const std::string& value);
bool Put(BaseVersion field, int64 value);
bool Put(ProtoField field, const sync_pb::EntitySpecifics& value);
bool Put(BitTemp field, bool value);
bool Put(BitField field, bool value);
bool Put(IndexedBitField field, bool value);
bool Put(UniquePositionField field, const UniquePosition& value);
// Don't allow creation on heap, except by sync API wrappers.
void* operator new(size_t size) { return (::operator new)(size); }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment