Index: chrome/browser/sync/engine/model_changing_syncer_command.cc |
=================================================================== |
--- chrome/browser/sync/engine/model_changing_syncer_command.cc (revision 112854) |
+++ chrome/browser/sync/engine/model_changing_syncer_command.cc (working copy) |
@@ -6,6 +6,7 @@ |
#include "base/basictypes.h" |
#include "base/callback_old.h" |
+#include "chrome/browser/sync/engine/model_safe_worker.h" |
#include "chrome/browser/sync/sessions/status_controller.h" |
#include "chrome/browser/sync/sessions/sync_session.h" |
#include "chrome/browser/sync/util/unrecoverable_error_info.h" |
@@ -18,13 +19,27 @@ |
return; |
} |
- const std::set<ModelSafeGroup>& groups_to_change = |
- GetGroupsToChange(*work_session_); |
+ // Project the list of active types (i.e., types in the routing |
+ // info) to a list of groups. |
+ // |
+ // TODO(akalin): Make this overrideable by subclasses (who might be |
+ // working on a subset of |active_groups|). (See |
+ // http://crbug.com/97832.) |
+ std::set<ModelSafeGroup> active_groups; |
+ const ModelSafeRoutingInfo& routing_info = session->routing_info(); |
+ for (ModelSafeRoutingInfo::const_iterator it = routing_info.begin(); |
+ it != routing_info.end(); ++it) { |
+ active_groups.insert(it->second); |
+ } |
+ // Always work on GROUP_PASSIVE, since that's the group that |
+ // top-level folders map to. |
+ active_groups.insert(GROUP_PASSIVE); |
+ |
for (size_t i = 0; i < session->workers().size(); ++i) { |
- ModelSafeWorker* worker = work_session_->workers()[i]; |
+ ModelSafeWorker* worker = session->workers()[i]; |
ModelSafeGroup group = worker->GetModelSafeGroup(); |
// Skip workers whose group isn't active. |
- if (groups_to_change.count(group) == 0u) { |
+ if (active_groups.find(group) == active_groups.end()) { |
DVLOG(2) << "Skipping worker for group " |
<< ModelSafeGroupToString(group); |
continue; |