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/session_state.h" | 5 #include "chrome/browser/sync/sessions/session_state.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 using std::set; | 10 using std::set; |
11 using std::vector; | 11 using std::vector; |
12 | 12 |
13 namespace browser_sync { | 13 namespace browser_sync { |
14 namespace sessions { | 14 namespace sessions { |
15 | 15 |
| 16 SyncerStatus::SyncerStatus() |
| 17 : invalid_store(false), |
| 18 syncer_stuck(false), |
| 19 syncing(false), |
| 20 num_successful_commits(0), |
| 21 num_successful_bookmark_commits(0), |
| 22 num_updates_downloaded_total(0), |
| 23 num_tombstone_updates_downloaded_total(0) { |
| 24 } |
| 25 |
| 26 ErrorCounters::ErrorCounters() |
| 27 : num_conflicting_commits(0), |
| 28 consecutive_transient_error_commits(0), |
| 29 consecutive_errors(0) { |
| 30 } |
| 31 |
16 SyncSessionSnapshot::SyncSessionSnapshot( | 32 SyncSessionSnapshot::SyncSessionSnapshot( |
17 const SyncerStatus& syncer_status, | 33 const SyncerStatus& syncer_status, |
18 const ErrorCounters& errors, | 34 const ErrorCounters& errors, |
19 int64 num_server_changes_remaining, | 35 int64 num_server_changes_remaining, |
20 int64 max_local_timestamp, | |
21 bool is_share_usable, | 36 bool is_share_usable, |
22 const syncable::ModelTypeBitSet& initial_sync_ended, | 37 const syncable::ModelTypeBitSet& initial_sync_ended, |
| 38 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT], |
23 bool more_to_sync, | 39 bool more_to_sync, |
24 bool is_silenced, | 40 bool is_silenced, |
25 int64 unsynced_count, | 41 int64 unsynced_count, |
26 int num_conflicting_updates, | 42 int num_conflicting_updates, |
27 bool did_commit_items) | 43 bool did_commit_items) |
28 : syncer_status(syncer_status), | 44 : syncer_status(syncer_status), |
29 errors(errors), | 45 errors(errors), |
30 num_server_changes_remaining(num_server_changes_remaining), | 46 num_server_changes_remaining(num_server_changes_remaining), |
31 max_local_timestamp(max_local_timestamp), | |
32 is_share_usable(is_share_usable), | 47 is_share_usable(is_share_usable), |
33 initial_sync_ended(initial_sync_ended), | 48 initial_sync_ended(initial_sync_ended), |
| 49 download_progress_markers(), |
34 has_more_to_sync(more_to_sync), | 50 has_more_to_sync(more_to_sync), |
35 is_silenced(is_silenced), | 51 is_silenced(is_silenced), |
36 unsynced_count(unsynced_count), | 52 unsynced_count(unsynced_count), |
37 num_conflicting_updates(num_conflicting_updates), | 53 num_conflicting_updates(num_conflicting_updates), |
38 did_commit_items(did_commit_items) { | 54 did_commit_items(did_commit_items) { |
| 55 for (int i = 0; i < syncable::MODEL_TYPE_COUNT; ++i) { |
| 56 const_cast<std::string&>(this->download_progress_markers[i]).assign( |
| 57 download_progress_markers[i]); |
| 58 } |
39 } | 59 } |
40 | 60 |
41 SyncSessionSnapshot::~SyncSessionSnapshot() {} | 61 SyncSessionSnapshot::~SyncSessionSnapshot() {} |
42 | 62 |
43 ConflictProgress::ConflictProgress(bool* dirty_flag) : dirty_(dirty_flag) {} | 63 ConflictProgress::ConflictProgress(bool* dirty_flag) : dirty_(dirty_flag) {} |
44 | 64 |
45 ConflictProgress::~ConflictProgress() { | 65 ConflictProgress::~ConflictProgress() { |
46 CleanupSets(); | 66 CleanupSets(); |
47 } | 67 } |
48 | 68 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 251 |
232 AllModelTypeState::~AllModelTypeState() {} | 252 AllModelTypeState::~AllModelTypeState() {} |
233 | 253 |
234 PerModelSafeGroupState::PerModelSafeGroupState(bool* dirty_flag) | 254 PerModelSafeGroupState::PerModelSafeGroupState(bool* dirty_flag) |
235 : conflict_progress(dirty_flag) { | 255 : conflict_progress(dirty_flag) { |
236 } | 256 } |
237 | 257 |
238 PerModelSafeGroupState::~PerModelSafeGroupState() { | 258 PerModelSafeGroupState::~PerModelSafeGroupState() { |
239 } | 259 } |
240 | 260 |
241 PerModelTypeState::PerModelTypeState(bool* dirty_flag) | |
242 : current_download_timestamp(dirty_flag, 0) { | |
243 } | |
244 | |
245 PerModelTypeState::~PerModelTypeState() { | |
246 } | |
247 | |
248 } // namespace sessions | 261 } // namespace sessions |
249 } // namespace browser_sync | 262 } // namespace browser_sync |
OLD | NEW |