Index: chrome/browser/sync/engine/apply_updates_command.cc |
=================================================================== |
--- chrome/browser/sync/engine/apply_updates_command.cc (revision 112854) |
+++ chrome/browser/sync/engine/apply_updates_command.cc (working copy) |
@@ -17,35 +17,6 @@ |
ApplyUpdatesCommand::ApplyUpdatesCommand() {} |
ApplyUpdatesCommand::~ApplyUpdatesCommand() {} |
-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::ScopedDirLookup dir(session.context()->directory_manager(), |
- session.context()->account_name()); |
- if (!dir.good()) { |
- LOG(ERROR) << "Scoped dir lookup failed!"; |
- return groups_with_unapplied_updates; |
- } |
- |
- syncable::ReadTransaction trans(FROM_HERE, dir); |
- server_types_with_unapplied_updates = |
- 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())); |
- } |
- } |
- |
- return groups_with_unapplied_updates; |
-} |
- |
void ApplyUpdatesCommand::ModelChangingExecuteImpl(SyncSession* session) { |
syncable::ScopedDirLookup dir(session->context()->directory_manager(), |
session->context()->account_name()); |
@@ -53,27 +24,9 @@ |
LOG(ERROR) << "Scoped dir lookup failed!"; |
return; |
} |
- |
syncable::WriteTransaction trans(FROM_HERE, syncable::SYNCER, dir); |
- |
- // Compute server types with unapplied updates that fall under our |
- // group restriction. |
- const syncable::ModelTypeBitSet 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::Directory::UnappliedUpdateMetaHandles handles; |
- dir->GetUnappliedUpdateMetaHandles( |
- &trans, server_type_restriction, &handles); |
+ dir->GetUnappliedUpdateMetaHandles(&trans, &handles); |
UpdateApplicator applicator( |
session->context()->resolver(), |
@@ -89,6 +42,13 @@ |
// some subset of the currently synced datatypes. |
const sessions::StatusController& status(session->status_controller()); |
if (status.ServerSaysNothingMoreToDownload()) { |
+ syncable::ScopedDirLookup dir(session->context()->directory_manager(), |
+ session->context()->account_name()); |
+ if (!dir.good()) { |
+ LOG(ERROR) << "Scoped dir lookup failed!"; |
+ return; |
+ } |
+ |
for (int i = syncable::FIRST_REAL_MODEL_TYPE; |
i < syncable::MODEL_TYPE_COUNT; ++i) { |
syncable::ModelType model_type = syncable::ModelTypeFromInt(i); |