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

Unified Diff: chrome/browser/sync/engine/apply_updates_command.cc

Issue 8851004: [Sync] Replace all instances of ModelTypeBitSet with ModelEnumSet (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | « no previous file | chrome/browser/sync/engine/store_timestamps_command.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/apply_updates_command.cc
diff --git a/chrome/browser/sync/engine/apply_updates_command.cc b/chrome/browser/sync/engine/apply_updates_command.cc
index a95f75f701632973770b2ed29b53051050953f93..2acd63bdcfafd0a2e58f03a716f8a31dc34e3022 100644
--- a/chrome/browser/sync/engine/apply_updates_command.cc
+++ b/chrome/browser/sync/engine/apply_updates_command.cc
@@ -25,7 +25,7 @@ std::set<ModelSafeGroup> ApplyUpdatesCommand::GetGroupsToChange(
const sessions::SyncSession& session) const {
std::set<ModelSafeGroup> groups_with_unapplied_updates;
- syncable::ModelTypeBitSet server_types_with_unapplied_updates;
+ syncable::FullModelEnumSet server_types_with_unapplied_updates;
{
syncable::ScopedDirLookup dir(session.context()->directory_manager(),
session.context()->account_name());
@@ -39,12 +39,10 @@ std::set<ModelSafeGroup> ApplyUpdatesCommand::GetGroupsToChange(
dir->GetServerTypesWithUnappliedUpdates(&trans);
}
- for (int i = 0; i < syncable::MODEL_TYPE_COUNT; ++i) {
- const syncable::ModelType type = syncable::ModelTypeFromInt(i);
- if (server_types_with_unapplied_updates.test(type)) {
- groups_with_unapplied_updates.insert(
- GetGroupForModelType(type, session.routing_info()));
- }
+ for (syncable::FullModelEnumSet::Iterator it =
+ server_types_with_unapplied_updates.First(); it.Good(); it.Inc()) {
+ groups_with_unapplied_updates.insert(
+ GetGroupForModelType(it.Get(), session.routing_info()));
}
return groups_with_unapplied_updates;
@@ -62,16 +60,14 @@ void ApplyUpdatesCommand::ModelChangingExecuteImpl(SyncSession* session) {
// Compute server types with unapplied updates that fall under our
// group restriction.
- const syncable::ModelTypeBitSet server_types_with_unapplied_updates =
+ const syncable::FullModelEnumSet server_types_with_unapplied_updates =
dir->GetServerTypesWithUnappliedUpdates(&trans);
- syncable::ModelTypeBitSet server_type_restriction;
- for (int i = 0; i < syncable::MODEL_TYPE_COUNT; ++i) {
- const syncable::ModelType server_type = syncable::ModelTypeFromInt(i);
- if (server_types_with_unapplied_updates.test(server_type)) {
- if (GetGroupForModelType(server_type, session->routing_info()) ==
- session->status_controller().group_restriction()) {
- server_type_restriction.set(server_type);
- }
+ syncable::FullModelEnumSet server_type_restriction;
+ for (syncable::FullModelEnumSet::Iterator it =
+ server_types_with_unapplied_updates.First(); it.Good(); it.Inc()) {
+ if (GetGroupForModelType(it.Get(), session->routing_info()) ==
+ session->status_controller().group_restriction()) {
+ server_type_restriction.Put(it.Get());
}
}
« no previous file with comments | « no previous file | chrome/browser/sync/engine/store_timestamps_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698