OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/sync/sessions/status_controller.h" | 5 #include "chrome/browser/sync/sessions/status_controller.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 | 8 |
9 namespace browser_sync { | 9 namespace browser_sync { |
10 namespace sessions { | 10 namespace sessions { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 set_num_consecutive_transient_error_commits( | 74 set_num_consecutive_transient_error_commits( |
75 shared_.error_counters.value().consecutive_transient_error_commits + | 75 shared_.error_counters.value().consecutive_transient_error_commits + |
76 value); | 76 value); |
77 } | 77 } |
78 | 78 |
79 void StatusController::set_num_consecutive_errors(int value) { | 79 void StatusController::set_num_consecutive_errors(int value) { |
80 if (shared_.error_counters.value().consecutive_errors != value) | 80 if (shared_.error_counters.value().consecutive_errors != value) |
81 shared_.error_counters.mutate()->consecutive_errors = value; | 81 shared_.error_counters.mutate()->consecutive_errors = value; |
82 } | 82 } |
83 | 83 |
84 void StatusController::set_got_new_timestamp() { | |
85 shared_.control_params.got_new_timestamp = true; | |
86 } | |
87 | |
88 void StatusController::set_current_sync_timestamp(syncable::ModelType model, | 84 void StatusController::set_current_sync_timestamp(syncable::ModelType model, |
89 int64 current_timestamp) { | 85 int64 current_timestamp) { |
90 PerModelTypeState* state = GetOrCreateModelTypeState(false, model); | 86 PerModelTypeState* state = GetOrCreateModelTypeState(false, model); |
91 if (current_timestamp > state->current_sync_timestamp.value()) | 87 if (current_timestamp > state->current_sync_timestamp.value()) |
92 *(state->current_sync_timestamp.mutate()) = current_timestamp; | 88 *(state->current_sync_timestamp.mutate()) = current_timestamp; |
93 } | 89 } |
94 | 90 |
95 void StatusController::set_num_server_changes_remaining( | 91 void StatusController::set_num_server_changes_remaining( |
96 int64 changes_remaining) { | 92 int64 changes_remaining) { |
97 if (shared_.num_server_changes_remaining.value() != changes_remaining) | 93 if (shared_.num_server_changes_remaining.value() != changes_remaining) |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 per_model_group_.begin(); | 209 per_model_group_.begin(); |
214 int sum = 0; | 210 int sum = 0; |
215 for (; it != per_model_group_.end(); ++it) { | 211 for (; it != per_model_group_.end(); ++it) { |
216 sum += it->second->conflict_progress.ConflictingItemsSize(); | 212 sum += it->second->conflict_progress.ConflictingItemsSize(); |
217 } | 213 } |
218 return sum; | 214 return sum; |
219 } | 215 } |
220 | 216 |
221 } // namespace sessions | 217 } // namespace sessions |
222 } // namespace browser_sync | 218 } // namespace browser_sync |
OLD | NEW |