| OLD | NEW |
| 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 23 matching lines...) Expand all Loading... |
| 34 // should proceed normally with a new local entry, this function will | 34 // should proceed normally with a new local entry, this function will |
| 35 // return server_entry.id(); the caller must create an entry with that | 35 // return server_entry.id(); the caller must create an entry with that |
| 36 // ID. This function does not alter the database. | 36 // ID. This function does not alter the database. |
| 37 syncable::Id FindLocalIdToUpdate( | 37 syncable::Id FindLocalIdToUpdate( |
| 38 syncable::BaseTransaction* trans, | 38 syncable::BaseTransaction* trans, |
| 39 const sync_pb::SyncEntity& server_entry); | 39 const sync_pb::SyncEntity& server_entry); |
| 40 | 40 |
| 41 UpdateAttemptResponse AttemptToUpdateEntry( | 41 UpdateAttemptResponse AttemptToUpdateEntry( |
| 42 syncable::WriteTransaction* const trans, | 42 syncable::WriteTransaction* const trans, |
| 43 syncable::MutableEntry* const entry, | 43 syncable::MutableEntry* const entry, |
| 44 ConflictResolver* resolver, | |
| 45 Cryptographer* cryptographer); | 44 Cryptographer* cryptographer); |
| 46 | 45 |
| 47 // Pass in name to avoid redundant UTF8 conversion. | 46 // Pass in name to avoid redundant UTF8 conversion. |
| 48 void UpdateServerFieldsFromUpdate( | 47 void UpdateServerFieldsFromUpdate( |
| 49 syncable::MutableEntry* local_entry, | 48 syncable::MutableEntry* local_entry, |
| 50 const sync_pb::SyncEntity& server_entry, | 49 const sync_pb::SyncEntity& server_entry, |
| 51 const std::string& name); | 50 const std::string& name); |
| 52 | 51 |
| 53 // Creates a new Entry iff no Entry exists with the given id. | 52 // Creates a new Entry iff no Entry exists with the given id. |
| 54 void CreateNewEntry(syncable::WriteTransaction *trans, | 53 void CreateNewEntry(syncable::WriteTransaction *trans, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 syncable::MetahandleSet* inserted_items, | 109 syncable::MetahandleSet* inserted_items, |
| 111 std::vector<syncable::Id>* commit_ids); | 110 std::vector<syncable::Id>* commit_ids); |
| 112 | 111 |
| 113 void MarkDeletedChildrenSynced( | 112 void MarkDeletedChildrenSynced( |
| 114 syncable::Directory* dir, | 113 syncable::Directory* dir, |
| 115 std::set<syncable::Id>* deleted_folders); | 114 std::set<syncable::Id>* deleted_folders); |
| 116 | 115 |
| 117 } // namespace syncer | 116 } // namespace syncer |
| 118 | 117 |
| 119 #endif // SYNC_ENGINE_SYNCER_UTIL_H_ | 118 #endif // SYNC_ENGINE_SYNCER_UTIL_H_ |
| OLD | NEW |