| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 static UpdateAttemptResponse AttemptToUpdateEntry( | 48 static UpdateAttemptResponse AttemptToUpdateEntry( |
| 49 syncable::WriteTransaction* const trans, | 49 syncable::WriteTransaction* const trans, |
| 50 syncable::MutableEntry* const entry, | 50 syncable::MutableEntry* const entry, |
| 51 ConflictResolver* resolver); | 51 ConflictResolver* resolver); |
| 52 | 52 |
| 53 | 53 |
| 54 // Pass in name to avoid redundant UTF8 conversion. | 54 // Pass in name to avoid redundant UTF8 conversion. |
| 55 static void UpdateServerFieldsFromUpdate( | 55 static void UpdateServerFieldsFromUpdate( |
| 56 syncable::MutableEntry* local_entry, | 56 syncable::MutableEntry* local_entry, |
| 57 const SyncEntity& server_entry, | 57 const SyncEntity& server_entry, |
| 58 const PathString& name); | 58 const std::string& name); |
| 59 | 59 |
| 60 static void ApplyExtendedAttributes( | 60 static void ApplyExtendedAttributes( |
| 61 syncable::MutableEntry* local_entry, | 61 syncable::MutableEntry* local_entry, |
| 62 const SyncEntity& server_entry); | 62 const SyncEntity& server_entry); |
| 63 | 63 |
| 64 // Creates a new Entry iff no Entry exists with the given id. | 64 // Creates a new Entry iff no Entry exists with the given id. |
| 65 static void CreateNewEntry(syncable::WriteTransaction *trans, | 65 static void CreateNewEntry(syncable::WriteTransaction *trans, |
| 66 const syncable::Id& id); | 66 const syncable::Id& id); |
| 67 | 67 |
| 68 static bool ServerAndLocalEntriesMatch(syncable::Entry* entry); | 68 static bool ServerAndLocalEntriesMatch(syncable::Entry* entry); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 187 |
| 188 inline bool ClientAndServerTimeMatch(int64 client_time, int64 server_time) { | 188 inline bool ClientAndServerTimeMatch(int64 client_time, int64 server_time) { |
| 189 // Compare at the coarser timescale (server) | 189 // Compare at the coarser timescale (server) |
| 190 return ClientTimeToServerTime(client_time) == server_time; | 190 return ClientTimeToServerTime(client_time) == server_time; |
| 191 } | 191 } |
| 192 #endif | 192 #endif |
| 193 | 193 |
| 194 } // namespace browser_sync | 194 } // namespace browser_sync |
| 195 | 195 |
| 196 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ | 196 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_ |
| OLD | NEW |