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