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