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

Unified Diff: sync/sessions/status_controller.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/status_controller.h ('k') | sync/syncable/syncable.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/status_controller.cc
diff --git a/sync/sessions/status_controller.cc b/sync/sessions/status_controller.cc
index 19fdbaff76f18d4b714e8728ca4e4d716086a92c..e192bba4e2259f78ddb2237be0109a2f4cf8b456 100644
--- a/sync/sessions/status_controller.cc
+++ b/sync/sessions/status_controller.cc
@@ -68,6 +68,18 @@ ConflictProgress*
return &GetOrCreateModelSafeGroupState(false, group)->conflict_progress;
}
+std::set<ModelSafeGroup>
+ StatusController::GetModelSafeGroupsWithUnappliedUpdates() const {
+ std::set<ModelSafeGroup> result;
+ std::map<ModelSafeGroup, PerModelSafeGroupState*>::const_iterator it =
+ per_model_group_.begin();
+ for (; it != per_model_group_.end(); ++it) {
+ if (it->second->update_progress.HasUnappliedUpdates())
+ result.insert(it->first);
+ }
+ return result;
+}
+
const UpdateProgress* StatusController::GetUnrestrictedUpdateProgress(
ModelSafeGroup group) const {
const PerModelSafeGroupState* state =
@@ -95,7 +107,8 @@ PerModelSafeGroupState* StatusController::GetOrCreateModelSafeGroupState(
std::map<ModelSafeGroup, PerModelSafeGroupState*>::iterator it =
per_model_group_.find(group);
if (it == per_model_group_.end()) {
- PerModelSafeGroupState* state = new PerModelSafeGroupState(&is_dirty_);
+ PerModelSafeGroupState* state =
+ new PerModelSafeGroupState(&is_dirty_, group, routing_info_);
it = per_model_group_.insert(std::make_pair(group, state)).first;
}
return it->second;
« no previous file with comments | « sync/sessions/status_controller.h ('k') | sync/syncable/syncable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698