| 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/status_controller.h" | 5 #include "sync/sessions/status_controller.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "sync/internal_api/public/base/model_type.h" | 10 #include "sync/internal_api/public/base/model_type.h" |
| 11 #include "sync/protocol/sync_protocol_error.h" | 11 #include "sync/protocol/sync_protocol_error.h" |
| 12 | 12 |
| 13 namespace syncer { | 13 namespace syncer { |
| 14 namespace sessions { | 14 namespace sessions { |
| 15 | 15 |
| 16 using syncable::FIRST_REAL_MODEL_TYPE; | |
| 17 using syncable::MODEL_TYPE_COUNT; | |
| 18 | |
| 19 StatusController::StatusController(const ModelSafeRoutingInfo& routes) | 16 StatusController::StatusController(const ModelSafeRoutingInfo& routes) |
| 20 : per_model_group_deleter_(&per_model_group_), | 17 : per_model_group_deleter_(&per_model_group_), |
| 21 group_restriction_in_effect_(false), | 18 group_restriction_in_effect_(false), |
| 22 group_restriction_(GROUP_PASSIVE), | 19 group_restriction_(GROUP_PASSIVE), |
| 23 routing_info_(routes) { | 20 routing_info_(routes) { |
| 24 } | 21 } |
| 25 | 22 |
| 26 StatusController::~StatusController() {} | 23 StatusController::~StatusController() {} |
| 27 | 24 |
| 28 const UpdateProgress* StatusController::update_progress() const { | 25 const UpdateProgress* StatusController::update_progress() const { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 it = per_model_group_.insert(std::make_pair(group, state)).first; | 88 it = per_model_group_.insert(std::make_pair(group, state)).first; |
| 92 } | 89 } |
| 93 return it->second; | 90 return it->second; |
| 94 } | 91 } |
| 95 | 92 |
| 96 void StatusController::increment_num_updates_downloaded_by(int value) { | 93 void StatusController::increment_num_updates_downloaded_by(int value) { |
| 97 model_neutral_.num_updates_downloaded_total += value; | 94 model_neutral_.num_updates_downloaded_total += value; |
| 98 } | 95 } |
| 99 | 96 |
| 100 void StatusController::set_types_needing_local_migration( | 97 void StatusController::set_types_needing_local_migration( |
| 101 syncable::ModelTypeSet types) { | 98 syncer::ModelTypeSet types) { |
| 102 model_neutral_.types_needing_local_migration = types; | 99 model_neutral_.types_needing_local_migration = types; |
| 103 } | 100 } |
| 104 | 101 |
| 105 void StatusController::increment_num_tombstone_updates_downloaded_by( | 102 void StatusController::increment_num_tombstone_updates_downloaded_by( |
| 106 int value) { | 103 int value) { |
| 107 model_neutral_.num_tombstone_updates_downloaded_total += value; | 104 model_neutral_.num_tombstone_updates_downloaded_total += value; |
| 108 } | 105 } |
| 109 | 106 |
| 110 void StatusController::increment_num_reflected_updates_downloaded_by( | 107 void StatusController::increment_num_reflected_updates_downloaded_by( |
| 111 int value) { | 108 int value) { |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 void StatusController::set_debug_info_sent() { | 260 void StatusController::set_debug_info_sent() { |
| 264 model_neutral_.debug_info_sent = true; | 261 model_neutral_.debug_info_sent = true; |
| 265 } | 262 } |
| 266 | 263 |
| 267 bool StatusController::debug_info_sent() const { | 264 bool StatusController::debug_info_sent() const { |
| 268 return model_neutral_.debug_info_sent; | 265 return model_neutral_.debug_info_sent; |
| 269 } | 266 } |
| 270 | 267 |
| 271 } // namespace sessions | 268 } // namespace sessions |
| 272 } // namespace syncer | 269 } // namespace syncer |
| OLD | NEW |