| 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 #pragma once | 10 #pragma once |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 static void SplitServerInformationIntoNewEntry( | 62 static void SplitServerInformationIntoNewEntry( |
| 63 syncable::WriteTransaction* trans, | 63 syncable::WriteTransaction* trans, |
| 64 syncable::MutableEntry* entry); | 64 syncable::MutableEntry* entry); |
| 65 | 65 |
| 66 // This function is called on an entry when we can update the user-facing data | 66 // This function is called on an entry when we can update the user-facing data |
| 67 // from the server data. | 67 // from the server data. |
| 68 static void UpdateLocalDataFromServerData(syncable::WriteTransaction* trans, | 68 static void UpdateLocalDataFromServerData(syncable::WriteTransaction* trans, |
| 69 syncable::MutableEntry* entry); | 69 syncable::MutableEntry* entry); |
| 70 | 70 |
| 71 static void IgnoreLocalChanges(syncable::MutableEntry* entry); |
| 72 static void OverwriteServerChanges(syncable::MutableEntry* entry); |
| 73 static void IgnoreConflict(syncable::MutableEntry *trans); |
| 74 |
| 71 static VerifyCommitResult ValidateCommitEntry(syncable::Entry* entry); | 75 static VerifyCommitResult ValidateCommitEntry(syncable::Entry* entry); |
| 72 | 76 |
| 73 static VerifyResult VerifyNewEntry(const SyncEntity& update, | 77 static VerifyResult VerifyNewEntry(const SyncEntity& update, |
| 74 syncable::Entry* target, | 78 syncable::Entry* target, |
| 75 const bool deleted); | 79 const bool deleted); |
| 76 | 80 |
| 77 // Assumes we have an existing entry; check here for updates that break | 81 // Assumes we have an existing entry; check here for updates that break |
| 78 // consistency rules. | 82 // consistency rules. |
| 79 static VerifyResult VerifyUpdateConsistency(syncable::WriteTransaction* trans, | 83 static VerifyResult VerifyUpdateConsistency(syncable::WriteTransaction* trans, |
| 80 const SyncEntity& update, | 84 const SyncEntity& update, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 syncable::Directory* dir, | 123 syncable::Directory* dir, |
| 120 std::set<syncable::Id>* deleted_folders); | 124 std::set<syncable::Id>* deleted_folders); |
| 121 | 125 |
| 122 private: | 126 private: |
| 123 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncerUtil); | 127 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncerUtil); |
| 124 }; | 128 }; |
| 125 | 129 |
| 126 } // namespace browser_sync | 130 } // namespace browser_sync |
| 127 | 131 |
| 128 #endif // SYNC_ENGINE_SYNCER_UTIL_H_ | 132 #endif // SYNC_ENGINE_SYNCER_UTIL_H_ |
| OLD | NEW |