OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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_UPDATE_HANDLER_H_ | |
6 #define SYNC_ENGINE_UPDATE_HANDLER_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "sync/base/sync_export.h" | |
11 | |
12 namespace sync_pb { | |
13 class DataTypeProgressMarker; | |
14 class SyncEntity; | |
15 } | |
16 | |
17 typedef std::vector<const sync_pb::SyncEntity*> SyncEntityList; | |
18 | |
19 namespace syncer { | |
20 | |
21 namespace sessions { | |
22 class StatusController; | |
23 } | |
24 | |
25 class ModelSafeWorker; | |
26 | |
27 // This class represents an entity that can request and receive updates from the | |
28 // sync server. | |
tim (not reviewing)
2014/02/18 19:15:01
"...request, receive, and apply updates from the s
rlarocque
2014/02/18 20:01:13
Done.
| |
29 class SYNC_EXPORT_PRIVATE UpdateHandler { | |
30 public: | |
31 UpdateHandler(); | |
32 virtual ~UpdateHandler() = 0; | |
33 | |
34 // Fills the given parameter with the stored progress marker for this type. | |
35 virtual void GetDownloadProgress( | |
36 sync_pb::DataTypeProgressMarker* progress_marker) const = 0; | |
37 | |
38 // Processes the contents of a GetUpdates response message. | |
39 // | |
40 // Should be invoked with the progress marker and set of SyncEntities from a | |
41 // single GetUpdates response message. The progress marker's type must match | |
42 // this update handler's type, and the set of SyncEntities must include all | |
43 // entities of this type found in the response message. | |
44 virtual void ProcessGetUpdatesResponse( | |
45 const sync_pb::DataTypeProgressMarker& progress_marker, | |
46 const SyncEntityList& applicable_updates, | |
tim (not reviewing)
2014/02/18 19:15:01
describe what "applicable" means in this context.
rlarocque
2014/02/18 20:01:13
Done.
| |
47 sessions::StatusController* status) = 0; | |
48 | |
tim (not reviewing)
2014/02/18 19:15:01
nit - extra newline.
rlarocque
2014/02/18 20:01:13
Done.
| |
49 | |
50 // Called at the end of a non-configure GetUpdates loop to apply any unapplied | |
51 // updates. | |
52 virtual void ApplyUpdates(sessions::StatusController* status) = 0; | |
53 | |
54 // Called at the end of a configure GetUpdates loop to perform any required | |
55 // post-initial-download update application. | |
56 virtual void PassiveApplyUpdates(sessions::StatusController* status) = 0; | |
57 }; | |
58 | |
59 } // namespace syncer | |
60 | |
61 #endif // SYNC_ENGINE_UPDATE_HANDLER_H_ | |
OLD | NEW |