| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_PROCESS_UPDATES_UTIL_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_PROCESS_UPDATES_UTIL_H_ |
| 6 #define COMPONENTS_SYNC_ENGINE_IMPL_PROCESS_UPDATES_UTIL_H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_PROCESS_UPDATES_UTIL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "components/sync/base/model_type.h" | 12 #include "components/sync/base/model_type.h" |
| 13 | 13 |
| 14 namespace sync_pb { | 14 namespace sync_pb { |
| 15 class SyncEntity; | 15 class SyncEntity; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace syncer { | 18 namespace syncer { |
| 19 | 19 |
| 20 namespace sessions { | |
| 21 class StatusController; | 20 class StatusController; |
| 22 } | 21 struct UpdateCounters; |
| 23 | 22 |
| 24 namespace syncable { | 23 namespace syncable { |
| 25 class ModelNeutralWriteTransaction; | 24 class ModelNeutralWriteTransaction; |
| 26 class Directory; | 25 class Directory; |
| 27 } | 26 } |
| 28 | 27 |
| 29 struct UpdateCounters; | |
| 30 | |
| 31 typedef std::vector<const sync_pb::SyncEntity*> SyncEntityList; | 28 typedef std::vector<const sync_pb::SyncEntity*> SyncEntityList; |
| 32 | 29 |
| 33 // Processes all the updates associated with a single ModelType. | 30 // Processes all the updates associated with a single ModelType. |
| 34 void ProcessDownloadedUpdates(syncable::Directory* dir, | 31 void ProcessDownloadedUpdates(syncable::Directory* dir, |
| 35 syncable::ModelNeutralWriteTransaction* trans, | 32 syncable::ModelNeutralWriteTransaction* trans, |
| 36 ModelType type, | 33 ModelType type, |
| 37 const SyncEntityList& applicable_updates, | 34 const SyncEntityList& applicable_updates, |
| 38 sessions::StatusController* status, | 35 StatusController* status, |
| 39 UpdateCounters* counters); | 36 UpdateCounters* counters); |
| 40 | 37 |
| 41 // Tombstones all entries of |type| whose versions are older than | 38 // Tombstones all entries of |type| whose versions are older than |
| 42 // |version_watermark| unless they are type root or unsynced/unapplied. | 39 // |version_watermark| unless they are type root or unsynced/unapplied. |
| 43 void ExpireEntriesByVersion(syncable::Directory* dir, | 40 void ExpireEntriesByVersion(syncable::Directory* dir, |
| 44 syncable::ModelNeutralWriteTransaction* trans, | 41 syncable::ModelNeutralWriteTransaction* trans, |
| 45 ModelType type, | 42 ModelType type, |
| 46 int64_t version_watermark); | 43 int64_t version_watermark); |
| 47 | 44 |
| 48 } // namespace syncer | 45 } // namespace syncer |
| 49 | 46 |
| 50 #endif // COMPONENTS_SYNC_ENGINE_IMPL_PROCESS_UPDATES_UTIL_H_ | 47 #endif // COMPONENTS_SYNC_ENGINE_IMPL_PROCESS_UPDATES_UTIL_H_ |
| OLD | NEW |