| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ | 8 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ |
| 9 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ | 9 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ |
| 10 #pragma once | 10 #pragma once |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 const syncable::Id& id); | 69 const syncable::Id& id); |
| 70 | 70 |
| 71 static bool ServerAndLocalEntriesMatch(syncable::Entry* entry); | 71 static bool ServerAndLocalEntriesMatch(syncable::Entry* entry); |
| 72 | 72 |
| 73 static void SplitServerInformationIntoNewEntry( | 73 static void SplitServerInformationIntoNewEntry( |
| 74 syncable::WriteTransaction* trans, | 74 syncable::WriteTransaction* trans, |
| 75 syncable::MutableEntry* entry); | 75 syncable::MutableEntry* entry); |
| 76 | 76 |
| 77 // This function is called on an entry when we can update the user-facing data | 77 // This function is called on an entry when we can update the user-facing data |
| 78 // from the server data. | 78 // from the server data. |
| 79 static void UpdateLocalDataFromServerData(syncable::WriteTransaction* trans, | 79 static bool UpdateLocalDataFromServerData(syncable::WriteTransaction* trans, |
| 80 syncable::MutableEntry* entry); | 80 syncable::MutableEntry* entry); |
| 81 | 81 |
| 82 static VerifyCommitResult ValidateCommitEntry(syncable::Entry* entry); | 82 static VerifyCommitResult ValidateCommitEntry(syncable::Entry* entry); |
| 83 | 83 |
| 84 static VerifyResult VerifyNewEntry(const SyncEntity& update, | 84 static VerifyResult VerifyNewEntry(const SyncEntity& update, |
| 85 syncable::Entry* target, | 85 syncable::Entry* target, |
| 86 const bool deleted); | 86 const bool deleted); |
| 87 | 87 |
| 88 // Assumes we have an existing entry; check here for updates that break | 88 // Assumes we have an existing entry; check here for updates that break |
| 89 // consistency rules. | 89 // consistency rules. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // if they match. For an up-to-date item, this should be the case. | 135 // if they match. For an up-to-date item, this should be the case. |
| 136 static bool ServerAndLocalOrdersMatch(syncable::Entry* entry); | 136 static bool ServerAndLocalOrdersMatch(syncable::Entry* entry); |
| 137 | 137 |
| 138 private: | 138 private: |
| 139 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncerUtil); | 139 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncerUtil); |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 } // namespace browser_sync | 142 } // namespace browser_sync |
| 143 | 143 |
| 144 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ | 144 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ |
| OLD | NEW |