| 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 // | |
| 5 // Utility functions manipulating syncable::Entries, intended for use by the | |
| 6 // syncer. | |
| 7 | 4 |
| 8 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_SYNCER_UTIL_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_SYNCER_UTIL_H_ |
| 9 #define COMPONENTS_SYNC_ENGINE_IMPL_SYNCER_UTIL_H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_SYNCER_UTIL_H_ |
| 10 | 7 |
| 11 #include <stdint.h> | 8 #include <stdint.h> |
| 12 | 9 |
| 13 #include <set> | 10 #include <set> |
| 14 #include <string> | 11 #include <string> |
| 15 #include <vector> | 12 #include <vector> |
| 16 | 13 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 27 | 24 |
| 28 namespace syncer { | 25 namespace syncer { |
| 29 | 26 |
| 30 namespace syncable { | 27 namespace syncable { |
| 31 class BaseTransaction; | 28 class BaseTransaction; |
| 32 class ModelNeutralWriteTransaction; | 29 class ModelNeutralWriteTransaction; |
| 33 } // namespace syncable | 30 } // namespace syncable |
| 34 | 31 |
| 35 class Cryptographer; | 32 class Cryptographer; |
| 36 | 33 |
| 34 // Utility functions manipulating syncable::Entries, intended for use by the |
| 35 // syncer. |
| 36 |
| 37 // If the server sent down a client-tagged entry, or an entry whose | 37 // If the server sent down a client-tagged entry, or an entry whose |
| 38 // commit response was lost, it is necessary to update a local entry | 38 // commit response was lost, it is necessary to update a local entry |
| 39 // with an ID that doesn't match the ID of the update. Here, we | 39 // with an ID that doesn't match the ID of the update. Here, we |
| 40 // find the ID of such an entry, if it exists. This function may | 40 // find the ID of such an entry, if it exists. This function may |
| 41 // determine that |server_entry| should be dropped; if so, it returns | 41 // determine that |server_entry| should be dropped; if so, it returns |
| 42 // the null ID -- callers must handle this case. When update application | 42 // the null ID -- callers must handle this case. When update application |
| 43 // should proceed normally with a new local entry, this function will | 43 // should proceed normally with a new local entry, this function will |
| 44 // return server_entry.id(); the caller must create an entry with that | 44 // return server_entry.id(); the caller must create an entry with that |
| 45 // ID. This function does not alter the database. | 45 // ID. This function does not alter the database. |
| 46 syncable::Id FindLocalIdToUpdate(syncable::BaseTransaction* trans, | 46 syncable::Id FindLocalIdToUpdate(syncable::BaseTransaction* trans, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 const sync_pb::SyncEntity& update, | 103 const sync_pb::SyncEntity& update, |
| 104 syncable::ModelNeutralMutableEntry* target); | 104 syncable::ModelNeutralMutableEntry* target); |
| 105 | 105 |
| 106 void MarkDeletedChildrenSynced(syncable::Directory* dir, | 106 void MarkDeletedChildrenSynced(syncable::Directory* dir, |
| 107 syncable::BaseWriteTransaction* trans, | 107 syncable::BaseWriteTransaction* trans, |
| 108 std::set<syncable::Id>* deleted_folders); | 108 std::set<syncable::Id>* deleted_folders); |
| 109 | 109 |
| 110 } // namespace syncer | 110 } // namespace syncer |
| 111 | 111 |
| 112 #endif // COMPONENTS_SYNC_ENGINE_IMPL_SYNCER_UTIL_H_ | 112 #endif // COMPONENTS_SYNC_ENGINE_IMPL_SYNCER_UTIL_H_ |
| OLD | NEW |