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

Side by Side Diff: sync/engine/syncer_util.h

Issue 10832286: sync: Introduce control data types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 // Utility functions manipulating syncable::Entries, intended for use by the 5 // Utility functions manipulating syncable::Entries, intended for use by the
6 // syncer. 6 // syncer.
7 7
8 #ifndef SYNC_ENGINE_SYNCER_UTIL_H_ 8 #ifndef SYNC_ENGINE_SYNCER_UTIL_H_
9 #define SYNC_ENGINE_SYNCER_UTIL_H_ 9 #define SYNC_ENGINE_SYNCER_UTIL_H_
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 void SplitServerInformationIntoNewEntry( 57 void SplitServerInformationIntoNewEntry(
58 syncable::WriteTransaction* trans, 58 syncable::WriteTransaction* trans,
59 syncable::MutableEntry* entry); 59 syncable::MutableEntry* entry);
60 60
61 // This function is called on an entry when we can update the user-facing data 61 // This function is called on an entry when we can update the user-facing data
62 // from the server data. 62 // from the server data.
63 void UpdateLocalDataFromServerData(syncable::WriteTransaction* trans, 63 void UpdateLocalDataFromServerData(syncable::WriteTransaction* trans,
64 syncable::MutableEntry* entry); 64 syncable::MutableEntry* entry);
65 65
66 // Marks the item as no longer requiring sync, allowing the server's version
67 // to 'win' during the next update application step.
68 void IgnoreLocalChanges(syncable::MutableEntry* entry);
tim (not reviewing) 2012/08/22 22:42:28 Is this actually needed outside of ConflictResolve
rlarocque 2012/08/23 20:11:23 Moved to conflict_util.cc/h.
69
70 // Marks the item as no longer requiring update from server data. This will
71 // cause the item to be committed to the server, overwriting the server's
72 // version.
73 void OverwriteServerChanges(syncable::MutableEntry* entry);
74
75 // The local and server versions are identical, so unset the bits that put them
76 // into a conflicting state.
77 void IgnoreConflict(syncable::MutableEntry *trans);
78
66 VerifyCommitResult ValidateCommitEntry(syncable::Entry* entry); 79 VerifyCommitResult ValidateCommitEntry(syncable::Entry* entry);
67 80
68 VerifyResult VerifyNewEntry(const sync_pb::SyncEntity& update, 81 VerifyResult VerifyNewEntry(const sync_pb::SyncEntity& update,
69 syncable::Entry* target, 82 syncable::Entry* target,
70 const bool deleted); 83 const bool deleted);
71 84
72 // Assumes we have an existing entry; check here for updates that break 85 // Assumes we have an existing entry; check here for updates that break
73 // consistency rules. 86 // consistency rules.
74 VerifyResult VerifyUpdateConsistency(syncable::WriteTransaction* trans, 87 VerifyResult VerifyUpdateConsistency(syncable::WriteTransaction* trans,
75 const sync_pb::SyncEntity& update, 88 const sync_pb::SyncEntity& update,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 syncable::MetahandleSet* inserted_items, 123 syncable::MetahandleSet* inserted_items,
111 std::vector<syncable::Id>* commit_ids); 124 std::vector<syncable::Id>* commit_ids);
112 125
113 void MarkDeletedChildrenSynced( 126 void MarkDeletedChildrenSynced(
114 syncable::Directory* dir, 127 syncable::Directory* dir,
115 std::set<syncable::Id>* deleted_folders); 128 std::set<syncable::Id>* deleted_folders);
116 129
117 } // namespace syncer 130 } // namespace syncer
118 131
119 #endif // SYNC_ENGINE_SYNCER_UTIL_H_ 132 #endif // SYNC_ENGINE_SYNCER_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698