| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "sync/sessions/sync_session.h" | 5 #include "sync/sessions/sync_session.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 std::set<ModelSafeGroup> enabled_groups; | 22 std::set<ModelSafeGroup> enabled_groups; |
| 23 // Project the list of enabled types (i.e., types in the routing | 23 // Project the list of enabled types (i.e., types in the routing |
| 24 // info) to a list of enabled groups. | 24 // info) to a list of enabled groups. |
| 25 for (ModelSafeRoutingInfo::const_iterator it = routing_info.begin(); | 25 for (ModelSafeRoutingInfo::const_iterator it = routing_info.begin(); |
| 26 it != routing_info.end(); ++it) { | 26 it != routing_info.end(); ++it) { |
| 27 enabled_groups.insert(it->second); | 27 enabled_groups.insert(it->second); |
| 28 } | 28 } |
| 29 // GROUP_PASSIVE is always enabled, since that's the group that | 29 // GROUP_PASSIVE is always enabled, since that's the group that |
| 30 // top-level folders map to. | 30 // top-level folders map to. |
| 31 enabled_groups.insert(GROUP_PASSIVE); | 31 enabled_groups.insert(GROUP_PASSIVE); |
| 32 enabled_groups.insert(GROUP_CONTROL); // FIXME comment. |
| 32 if (DCHECK_IS_ON()) { | 33 if (DCHECK_IS_ON()) { |
| 33 // We sometimes create dummy SyncSession objects (see | 34 // We sometimes create dummy SyncSession objects (see |
| 34 // SyncScheduler::InitialSnapshot) so don't check in that case. | 35 // SyncScheduler::InitialSnapshot) so don't check in that case. |
| 35 if (!routing_info.empty() || !workers.empty()) { | 36 if (!routing_info.empty() || !workers.empty()) { |
| 36 std::set<ModelSafeGroup> groups_with_workers; | 37 std::set<ModelSafeGroup> groups_with_workers; |
| 37 for (std::vector<ModelSafeWorker*>::const_iterator it = workers.begin(); | 38 for (std::vector<ModelSafeWorker*>::const_iterator it = workers.begin(); |
| 38 it != workers.end(); ++it) { | 39 it != workers.end(); ++it) { |
| 39 groups_with_workers.insert((*it)->GetModelSafeGroup()); | 40 groups_with_workers.insert((*it)->GetModelSafeGroup()); |
| 40 } | 41 } |
| 41 // All enabled groups should have a corresponding worker. | 42 // All enabled groups should have a corresponding worker. |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 // with the server. Therefore, we verify no errors and at least one SYNCER_OK. | 255 // with the server. Therefore, we verify no errors and at least one SYNCER_OK. |
| 255 return reached_server && !HadErrors(error); | 256 return reached_server && !HadErrors(error); |
| 256 } | 257 } |
| 257 | 258 |
| 258 void SyncSession::SetFinished() { | 259 void SyncSession::SetFinished() { |
| 259 finished_ = true; | 260 finished_ = true; |
| 260 } | 261 } |
| 261 | 262 |
| 262 } // namespace sessions | 263 } // namespace sessions |
| 263 } // namespace csync | 264 } // namespace csync |
| OLD | NEW |