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, receive, and apply updates |
| 28 // from the sync server. |
| 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 // |
| 45 // In this context, "applicable_updates" means the set of updates belonging to |
| 46 // this type. |
| 47 virtual void ProcessGetUpdatesResponse( |
| 48 const sync_pb::DataTypeProgressMarker& progress_marker, |
| 49 const SyncEntityList& applicable_updates, |
| 50 sessions::StatusController* status) = 0; |
| 51 |
| 52 // Called at the end of a non-configure GetUpdates loop to apply any unapplied |
| 53 // updates. |
| 54 virtual void ApplyUpdates(sessions::StatusController* status) = 0; |
| 55 |
| 56 // Called at the end of a configure GetUpdates loop to perform any required |
| 57 // post-initial-download update application. |
| 58 virtual void PassiveApplyUpdates(sessions::StatusController* status) = 0; |
| 59 }; |
| 60 |
| 61 } // namespace syncer |
| 62 |
| 63 #endif // SYNC_ENGINE_UPDATE_HANDLER_H_ |
OLD | NEW |