| Index: sync/sessions/session_state.h
|
| diff --git a/sync/sessions/session_state.h b/sync/sessions/session_state.h
|
| index 7403758b728e0a83a63c87ec30dec3590bb1cb7f..8aa5b0ceeba508190f2c0170493a6e934a278fd2 100644
|
| --- a/sync/sessions/session_state.h
|
| +++ b/sync/sessions/session_state.h
|
| @@ -213,7 +213,7 @@ typedef std::pair<UpdateAttemptResponse, syncable::Id> AppliedUpdate;
|
| // Tracks update application and verification.
|
| class UpdateProgress {
|
| public:
|
| - UpdateProgress();
|
| + UpdateProgress(ModelSafeGroup group, const ModelSafeRoutingInfo& routes);
|
| ~UpdateProgress();
|
|
|
| void AddVerifyResult(const VerifyResult& verify_result,
|
| @@ -223,10 +223,14 @@ class UpdateProgress {
|
| void AddAppliedUpdate(const UpdateAttemptResponse& response,
|
| const syncable::Id& id);
|
|
|
| + // Fills our unapplied updates state from the set indexed in the directory for
|
| + // each ModelType in our ModelSafeGroup (using types_in_model_safe_group).
|
| + void CollectUpdatesToApply(
|
| + syncable::Directory* dir,
|
| + syncable::BaseTransaction* trans);
|
| +
|
| // Various iterators.
|
| - std::vector<AppliedUpdate>::iterator AppliedUpdatesBegin();
|
| std::vector<VerifiedUpdate>::const_iterator VerifiedUpdatesBegin() const;
|
| - std::vector<AppliedUpdate>::const_iterator AppliedUpdatesEnd() const;
|
| std::vector<VerifiedUpdate>::const_iterator VerifiedUpdatesEnd() const;
|
|
|
| // Returns the number of update application attempts. This includes both
|
| @@ -234,9 +238,14 @@ class UpdateProgress {
|
| int AppliedUpdatesSize() const { return applied_updates_.size(); }
|
| int VerifiedUpdatesSize() const { return verified_updates_.size(); }
|
| bool HasVerifiedUpdates() const { return !verified_updates_.empty(); }
|
| - bool HasAppliedUpdates() const { return !applied_updates_.empty(); }
|
| void ClearVerifiedUpdates() { verified_updates_.clear(); }
|
|
|
| + std::vector<int64>* unapplied_updates() {
|
| + return &unapplied_updates_;
|
| + }
|
| +
|
| + bool HasUnappliedUpdates() const { return !unapplied_updates_.empty(); }
|
| +
|
| // Count the number of successful update applications that have happend this
|
| // cycle. Note that if an item is successfully applied twice, it will be
|
| // double counted here.
|
| @@ -253,6 +262,12 @@ class UpdateProgress {
|
| // Stores the result of the various ApplyUpdate attempts we've made.
|
| // May contain duplicate entries.
|
| std::vector<AppliedUpdate> applied_updates_;
|
| +
|
| + std::vector<int64> unapplied_updates_;
|
| +
|
| + // The set of types corresponding to the ModelSafeGroup we are tracking
|
| + // update progress for, generated on construction from the routing info.
|
| + const syncable::FullModelTypeSet types_in_model_safe_group_;
|
| };
|
|
|
| struct SyncCycleControlParameters {
|
| @@ -319,7 +334,9 @@ struct AllModelTypeState {
|
|
|
| // Grouping of all state that applies to a single ModelSafeGroup.
|
| struct PerModelSafeGroupState {
|
| - explicit PerModelSafeGroupState(bool* dirty_flag);
|
| + PerModelSafeGroupState(bool* dirty_flag,
|
| + ModelSafeGroup group,
|
| + const ModelSafeRoutingInfo& routes);
|
| ~PerModelSafeGroupState();
|
|
|
| UpdateProgress update_progress;
|
|
|