summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/engine
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/sync/engine')
-rw-r--r--chrome/browser/sync/engine/model_changing_syncer_command.cc24
-rw-r--r--chrome/browser/sync/engine/model_safe_worker.cc3
2 files changed, 23 insertions, 4 deletions
diff --git a/chrome/browser/sync/engine/model_changing_syncer_command.cc b/chrome/browser/sync/engine/model_changing_syncer_command.cc
index 7c73631..797f795 100644
--- a/chrome/browser/sync/engine/model_changing_syncer_command.cc
+++ b/chrome/browser/sync/engine/model_changing_syncer_command.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -17,9 +17,31 @@ void ModelChangingSyncerCommand::ExecuteImpl(sessions::SyncSession* session) {
return;
}
+ // 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 = session->workers()[i];
ModelSafeGroup group = worker->GetModelSafeGroup();
+ // Skip workers whose group isn't active.
+ if (active_groups.find(group) == active_groups.end()) {
+ VLOG(2) << "Skipping worker for group "
+ << ModelSafeGroupToString(group);
+ continue;
+ }
sessions::StatusController* status = work_session_->status_controller();
sessions::ScopedModelSafeGroupRestriction r(status, group);
diff --git a/chrome/browser/sync/engine/model_safe_worker.cc b/chrome/browser/sync/engine/model_safe_worker.cc
index 8142be2..ae94b26 100644
--- a/chrome/browser/sync/engine/model_safe_worker.cc
+++ b/chrome/browser/sync/engine/model_safe_worker.cc
@@ -43,9 +43,6 @@ ModelSafeGroup GetGroupForModelType(const syncable::ModelType type,
const ModelSafeRoutingInfo& routes) {
ModelSafeRoutingInfo::const_iterator it = routes.find(type);
if (it == routes.end()) {
- // TODO(tim): We shouldn't end up here for TOP_LEVEL_FOLDER, but an issue
- // with the server's PermanentItemPopulator is causing TLF updates in
- // some cases. See bug 36735.
if (type != syncable::UNSPECIFIED && type != syncable::TOP_LEVEL_FOLDER)
LOG(WARNING) << "Entry does not belong to active ModelSafeGroup!";
return GROUP_PASSIVE;