| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 static void SplitServerInformationIntoNewEntry( | 71 static void SplitServerInformationIntoNewEntry( |
| 72 syncable::WriteTransaction* trans, | 72 syncable::WriteTransaction* trans, |
| 73 syncable::MutableEntry* entry); | 73 syncable::MutableEntry* entry); |
| 74 | 74 |
| 75 // This function is called on an entry when we can update the user-facing data | 75 // This function is called on an entry when we can update the user-facing data |
| 76 // from the server data. | 76 // from the server data. |
| 77 static void UpdateLocalDataFromServerData(syncable::WriteTransaction* trans, | 77 static void UpdateLocalDataFromServerData(syncable::WriteTransaction* trans, |
| 78 syncable::MutableEntry* entry); | 78 syncable::MutableEntry* entry); |
| 79 | 79 |
| 80 static VerifyCommitResult ValidateCommitEntry(syncable::Entry* entry); | |
| 81 | |
| 82 static VerifyResult VerifyNewEntry(const SyncEntity& update, | 80 static VerifyResult VerifyNewEntry(const SyncEntity& update, |
| 83 syncable::Entry* target, | 81 syncable::Entry* target, |
| 84 const bool deleted); | 82 const bool deleted); |
| 85 | 83 |
| 86 // Assumes we have an existing entry; check here for updates that break | 84 // Assumes we have an existing entry; check here for updates that break |
| 87 // consistency rules. | 85 // consistency rules. |
| 88 static VerifyResult VerifyUpdateConsistency(syncable::WriteTransaction* trans, | 86 static VerifyResult VerifyUpdateConsistency(syncable::WriteTransaction* trans, |
| 89 const SyncEntity& update, | 87 const SyncEntity& update, |
| 90 syncable::MutableEntry* target, | 88 syncable::MutableEntry* target, |
| 91 const bool deleted, | 89 const bool deleted, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 const syncable::ScopedDirLookup &dir, | 126 const syncable::ScopedDirLookup &dir, |
| 129 std::set<syncable::Id>* deleted_folders); | 127 std::set<syncable::Id>* deleted_folders); |
| 130 | 128 |
| 131 private: | 129 private: |
| 132 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncerUtil); | 130 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncerUtil); |
| 133 }; | 131 }; |
| 134 | 132 |
| 135 } // namespace browser_sync | 133 } // namespace browser_sync |
| 136 | 134 |
| 137 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ | 135 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ |
| OLD | NEW |