| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_UPDATE_HANDLER_H_ | 5 #ifndef SYNC_ENGINE_UPDATE_HANDLER_H_ |
| 6 #define SYNC_ENGINE_UPDATE_HANDLER_H_ | 6 #define SYNC_ENGINE_UPDATE_HANDLER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "sync/base/sync_export.h" | 10 #include "sync/base/sync_export.h" |
| 11 #include "sync/internal_api/public/util/syncer_error.h" |
| 11 | 12 |
| 12 namespace sync_pb { | 13 namespace sync_pb { |
| 13 class DataTypeContext; | 14 class DataTypeContext; |
| 14 class DataTypeProgressMarker; | 15 class DataTypeProgressMarker; |
| 15 class SyncEntity; | 16 class SyncEntity; |
| 16 } | 17 } |
| 17 | 18 |
| 18 typedef std::vector<const sync_pb::SyncEntity*> SyncEntityList; | 19 typedef std::vector<const sync_pb::SyncEntity*> SyncEntityList; |
| 19 | 20 |
| 20 namespace syncer { | 21 namespace syncer { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 42 | 43 |
| 43 // Processes the contents of a GetUpdates response message. | 44 // Processes the contents of a GetUpdates response message. |
| 44 // | 45 // |
| 45 // Should be invoked with the progress marker and set of SyncEntities from a | 46 // Should be invoked with the progress marker and set of SyncEntities from a |
| 46 // single GetUpdates response message. The progress marker's type must match | 47 // single GetUpdates response message. The progress marker's type must match |
| 47 // this update handler's type, and the set of SyncEntities must include all | 48 // this update handler's type, and the set of SyncEntities must include all |
| 48 // entities of this type found in the response message. | 49 // entities of this type found in the response message. |
| 49 // | 50 // |
| 50 // In this context, "applicable_updates" means the set of updates belonging to | 51 // In this context, "applicable_updates" means the set of updates belonging to |
| 51 // this type. | 52 // this type. |
| 52 virtual void ProcessGetUpdatesResponse( | 53 // |
| 54 // Returns SYNCER_OK if the all data was processed successfully, a syncer |
| 55 // error otherwise. |
| 56 virtual SyncerError ProcessGetUpdatesResponse( |
| 53 const sync_pb::DataTypeProgressMarker& progress_marker, | 57 const sync_pb::DataTypeProgressMarker& progress_marker, |
| 54 const sync_pb::DataTypeContext& mutated_context, | 58 const sync_pb::DataTypeContext& mutated_context, |
| 55 const SyncEntityList& applicable_updates, | 59 const SyncEntityList& applicable_updates, |
| 56 sessions::StatusController* status) = 0; | 60 sessions::StatusController* status) = 0; |
| 57 | 61 |
| 58 // Called at the end of a non-configure GetUpdates loop to apply any unapplied | 62 // Called at the end of a non-configure GetUpdates loop to apply any unapplied |
| 59 // updates. | 63 // updates. |
| 60 virtual void ApplyUpdates(sessions::StatusController* status) = 0; | 64 virtual void ApplyUpdates(sessions::StatusController* status) = 0; |
| 61 | 65 |
| 62 // Called at the end of a configure GetUpdates loop to perform any required | 66 // Called at the end of a configure GetUpdates loop to perform any required |
| 63 // post-initial-download update application. | 67 // post-initial-download update application. |
| 64 virtual void PassiveApplyUpdates(sessions::StatusController* status) = 0; | 68 virtual void PassiveApplyUpdates(sessions::StatusController* status) = 0; |
| 65 }; | 69 }; |
| 66 | 70 |
| 67 } // namespace syncer | 71 } // namespace syncer |
| 68 | 72 |
| 69 #endif // SYNC_ENGINE_UPDATE_HANDLER_H_ | 73 #endif // SYNC_ENGINE_UPDATE_HANDLER_H_ |
| OLD | NEW |