Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: sync/sessions/session_state.cc

Issue 9950137: [not for review] sync: Don't use group_restriction from ApplyUpdatesCommand. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/sessions/session_state.h ('k') | sync/sessions/status_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/session_state.cc
diff --git a/sync/sessions/session_state.cc b/sync/sessions/session_state.cc
index f49c41d00d8b90333aad4c81d000cc5866e3bc90..d1aec9d36da9f6a2d78b889a1762871e9bdf3d44 100644
--- a/sync/sessions/session_state.cc
+++ b/sync/sessions/session_state.cc
@@ -14,6 +14,7 @@
#include "base/json/json_writer.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
+#include "sync/engine/model_safe_worker.h"
#include "sync/protocol/proto_enum_conversions.h"
using std::set;
@@ -254,7 +255,10 @@ void ConflictProgress::AddServerConflictingItemById(
}
}
-UpdateProgress::UpdateProgress() {}
+UpdateProgress::UpdateProgress(ModelSafeGroup group,
+ const ModelSafeRoutingInfo& routes)
+ : types_in_model_safe_group_(GetModelTypesForGroup(group, routes)) {
+}
UpdateProgress::~UpdateProgress() {}
@@ -268,8 +272,12 @@ void UpdateProgress::AddAppliedUpdate(const UpdateAttemptResponse& response,
applied_updates_.push_back(std::make_pair(response, id));
}
-std::vector<AppliedUpdate>::iterator UpdateProgress::AppliedUpdatesBegin() {
- return applied_updates_.begin();
+void UpdateProgress::CollectUpdatesToApply(
+ syncable::Directory* dir,
+ syncable::BaseTransaction* trans) {
+ dir->GetUnappliedUpdateMetaHandles(trans,
+ types_in_model_safe_group_,
+ &unapplied_updates_);
}
std::vector<VerifiedUpdate>::const_iterator
@@ -277,11 +285,6 @@ UpdateProgress::VerifiedUpdatesBegin() const {
return verified_updates_.begin();
}
-std::vector<AppliedUpdate>::const_iterator
-UpdateProgress::AppliedUpdatesEnd() const {
- return applied_updates_.end();
-}
-
std::vector<VerifiedUpdate>::const_iterator
UpdateProgress::VerifiedUpdatesEnd() const {
return verified_updates_.end();
@@ -321,8 +324,11 @@ AllModelTypeState::AllModelTypeState(bool* dirty_flag)
AllModelTypeState::~AllModelTypeState() {}
-PerModelSafeGroupState::PerModelSafeGroupState(bool* dirty_flag)
- : conflict_progress(dirty_flag) {
+PerModelSafeGroupState::PerModelSafeGroupState(
+ bool* dirty_flag,
+ ModelSafeGroup group,
+ const ModelSafeRoutingInfo& routes)
+ : update_progress(group, routes), conflict_progress(dirty_flag) {
}
PerModelSafeGroupState::~PerModelSafeGroupState() {
« no previous file with comments | « sync/sessions/session_state.h ('k') | sync/sessions/status_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698