| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 syncable::MutableEntry* const entry, | 56 syncable::MutableEntry* const entry, |
| 57 ConflictResolver* resolver, | 57 ConflictResolver* resolver, |
| 58 Cryptographer* cryptographer); | 58 Cryptographer* cryptographer); |
| 59 | 59 |
| 60 // Pass in name to avoid redundant UTF8 conversion. | 60 // Pass in name to avoid redundant UTF8 conversion. |
| 61 static void UpdateServerFieldsFromUpdate( | 61 static void UpdateServerFieldsFromUpdate( |
| 62 syncable::MutableEntry* local_entry, | 62 syncable::MutableEntry* local_entry, |
| 63 const SyncEntity& server_entry, | 63 const SyncEntity& server_entry, |
| 64 const std::string& name); | 64 const std::string& name); |
| 65 | 65 |
| 66 static void ApplyExtendedAttributes( | |
| 67 syncable::MutableEntry* local_entry, | |
| 68 const SyncEntity& server_entry); | |
| 69 | |
| 70 // Creates a new Entry iff no Entry exists with the given id. | 66 // Creates a new Entry iff no Entry exists with the given id. |
| 71 static void CreateNewEntry(syncable::WriteTransaction *trans, | 67 static void CreateNewEntry(syncable::WriteTransaction *trans, |
| 72 const syncable::Id& id); | 68 const syncable::Id& id); |
| 73 | 69 |
| 74 static bool ServerAndLocalEntriesMatch(syncable::Entry* entry); | 70 static bool ServerAndLocalEntriesMatch(syncable::Entry* entry); |
| 75 | 71 |
| 76 static void SplitServerInformationIntoNewEntry( | 72 static void SplitServerInformationIntoNewEntry( |
| 77 syncable::WriteTransaction* trans, | 73 syncable::WriteTransaction* trans, |
| 78 syncable::MutableEntry* entry); | 74 syncable::MutableEntry* entry); |
| 79 | 75 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 | 186 |
| 191 inline bool ClientAndServerTimeMatch(int64 client_time, int64 server_time) { | 187 inline bool ClientAndServerTimeMatch(int64 client_time, int64 server_time) { |
| 192 // Compare at the coarser timescale (server) | 188 // Compare at the coarser timescale (server) |
| 193 return ClientTimeToServerTime(client_time) == server_time; | 189 return ClientTimeToServerTime(client_time) == server_time; |
| 194 } | 190 } |
| 195 #endif | 191 #endif |
| 196 | 192 |
| 197 } // namespace browser_sync | 193 } // namespace browser_sync |
| 198 | 194 |
| 199 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ | 195 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ |
| OLD | NEW |