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