Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: sync/syncable/mutable_entry.h

Issue 23435008: sync: Refactor MutablEntry internals (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sync/syncable/mutable_entry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SYNC_SYNCABLE_MUTABLE_ENTRY_H_ 5 #ifndef SYNC_SYNCABLE_MUTABLE_ENTRY_H_
6 #define SYNC_SYNCABLE_MUTABLE_ENTRY_H_ 6 #define SYNC_SYNCABLE_MUTABLE_ENTRY_H_
7 7
8 #include "sync/base/sync_export.h" 8 #include "sync/base/sync_export.h"
9 #include "sync/internal_api/public/base/model_type.h" 9 #include "sync/internal_api/public/base/model_type.h"
10 #include "sync/syncable/entry.h" 10 #include "sync/syncable/entry.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 void PutServerMtime(base::Time value); 55 void PutServerMtime(base::Time value);
56 void PutCtime(base::Time value); 56 void PutCtime(base::Time value);
57 void PutServerCtime(base::Time value); 57 void PutServerCtime(base::Time value);
58 bool PutId(const Id& value); 58 bool PutId(const Id& value);
59 void PutParentId(const Id& value); 59 void PutParentId(const Id& value);
60 void PutServerParentId(const Id& value); 60 void PutServerParentId(const Id& value);
61 bool PutIsUnsynced(bool value); 61 bool PutIsUnsynced(bool value);
62 bool PutIsUnappliedUpdate(bool value); 62 bool PutIsUnappliedUpdate(bool value);
63 void PutIsDir(bool value); 63 void PutIsDir(bool value);
64 void PutServerIsDir(bool value); 64 void PutServerIsDir(bool value);
65 bool PutIsDel(bool value); 65 void PutIsDel(bool value);
66 void PutServerIsDel(bool value); 66 void PutServerIsDel(bool value);
67 void PutNonUniqueName(const std::string& value); 67 void PutNonUniqueName(const std::string& value);
68 void PutServerNonUniqueName(const std::string& value); 68 void PutServerNonUniqueName(const std::string& value);
69 bool PutUniqueServerTag(const std::string& value); 69 bool PutUniqueServerTag(const std::string& value);
70 bool PutUniqueClientTag(const std::string& value); 70 bool PutUniqueClientTag(const std::string& value);
71 void PutUniqueBookmarkTag(const std::string& tag); 71 void PutUniqueBookmarkTag(const std::string& tag);
72 void PutSpecifics(const sync_pb::EntitySpecifics& value); 72 void PutSpecifics(const sync_pb::EntitySpecifics& value);
73 void PutServerSpecifics(const sync_pb::EntitySpecifics& value); 73 void PutServerSpecifics(const sync_pb::EntitySpecifics& value);
74 void PutBaseServerSpecifics(const sync_pb::EntitySpecifics& value); 74 void PutBaseServerSpecifics(const sync_pb::EntitySpecifics& value);
75 void PutUniquePosition(const UniquePosition& value); 75 void PutUniquePosition(const UniquePosition& value);
(...skipping 24 matching lines...) Expand all
100 void UpdateTransactionVersion(int64 version); 100 void UpdateTransactionVersion(int64 version);
101 101
102 protected: 102 protected:
103 syncable::MetahandleSet* GetDirtyIndexHelper(); 103 syncable::MetahandleSet* GetDirtyIndexHelper();
104 104
105 private: 105 private:
106 friend class Directory; 106 friend class Directory;
107 friend class WriteTransaction; 107 friend class WriteTransaction;
108 friend class syncer::WriteNode; 108 friend class syncer::WriteNode;
109 109
110 bool Put(Int64Field field, const int64& value);
111 bool Put(TimeField field, const base::Time& value);
112 bool Put(IdField field, const Id& value);
113 bool Put(StringField field, const std::string& value);
114 bool Put(BaseVersion field, int64 value);
115 bool Put(ProtoField field, const sync_pb::EntitySpecifics& value);
116 bool Put(BitTemp field, bool value);
117 bool Put(BitField field, bool value);
118 bool Put(IndexedBitField field, bool value);
119 bool Put(UniquePositionField field, const UniquePosition& value);
120
121 // Don't allow creation on heap, except by sync API wrappers. 110 // Don't allow creation on heap, except by sync API wrappers.
122 void* operator new(size_t size) { return (::operator new)(size); } 111 void* operator new(size_t size) { return (::operator new)(size); }
123 112
124 // Adjusts the successor and predecessor entries so that they no longer 113 // Adjusts the successor and predecessor entries so that they no longer
125 // refer to this entry. 114 // refer to this entry.
126 bool UnlinkFromOrder(); 115 bool UnlinkFromOrder();
127 116
128 // Kind of redundant. We should reduce the number of pointers 117 // Kind of redundant. We should reduce the number of pointers
129 // floating around if at all possible. Could we store this in Directory? 118 // floating around if at all possible. Could we store this in Directory?
130 // Scope: Set on construction, never changed after that. 119 // Scope: Set on construction, never changed after that.
131 WriteTransaction* const write_transaction_; 120 WriteTransaction* const write_transaction_;
132 121
133 protected: 122 protected:
134 MutableEntry(); 123 MutableEntry();
135 124
136 DISALLOW_COPY_AND_ASSIGN(MutableEntry); 125 DISALLOW_COPY_AND_ASSIGN(MutableEntry);
137 }; 126 };
138 127
139 // This function sets only the flags needed to get this entry to sync. 128 // This function sets only the flags needed to get this entry to sync.
140 bool MarkForSyncing(syncable::MutableEntry* e); 129 bool MarkForSyncing(syncable::MutableEntry* e);
141 130
142 } // namespace syncable 131 } // namespace syncable
143 } // namespace syncer 132 } // namespace syncer
144 133
145 #endif // SYNC_SYNCABLE_MUTABLE_ENTRY_H_ 134 #endif // SYNC_SYNCABLE_MUTABLE_ENTRY_H_
OLDNEW
« no previous file with comments | « no previous file | sync/syncable/mutable_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698