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 8b5a6b8db8d28e10eca8fe405b2cb0b2b03df8d0..b7716ff97c511f61adeb5c5680972e9b645c2d52 100644 |
--- a/chrome/browser/sync/engine/apply_updates_command.cc |
+++ b/chrome/browser/sync/engine/apply_updates_command.cc |
@@ -17,6 +17,30 @@ using sessions::SyncSession; |
ApplyUpdatesCommand::ApplyUpdatesCommand() {} |
ApplyUpdatesCommand::~ApplyUpdatesCommand() {} |
+std::set<ModelSafeGroup> ApplyUpdatesCommand::GetGroupsToChange( |
+ const sessions::SyncSession& session) const { |
+ std::set<ModelSafeGroup> groups_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); |
+ syncable::Directory::UnappliedUpdateMetaHandles handles; |
+ dir->GetUnappliedUpdateMetaHandles(&trans, &handles); |
+ for (syncable::Directory::UnappliedUpdateMetaHandles::const_iterator it = |
tim (not reviewing)
2011/11/29 00:01:59
Might it make sense to keep an index on this in Di
akalin
2011/11/30 01:33:03
Done. Not quite trivial, but doable. I basically
|
+ handles.begin(); it != handles.end(); ++it) { |
+ const syncable::Entry entry(&trans, syncable::GET_BY_HANDLE, *it); |
+ groups_with_unapplied_updates.insert( |
+ GetGroupForModelType(entry.GetServerModelType(), |
+ session.routing_info())); |
+ } |
+ |
+ return groups_with_unapplied_updates; |
+} |
+ |
void ApplyUpdatesCommand::ModelChangingExecuteImpl(SyncSession* session) { |
syncable::ScopedDirLookup dir(session->context()->directory_manager(), |
session->context()->account_name()); |