| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 bool is_share_usable, | 114 bool is_share_usable, |
| 115 const syncable::ModelTypeBitSet& initial_sync_ended, | 115 const syncable::ModelTypeBitSet& initial_sync_ended, |
| 116 const std::string | 116 const std::string |
| 117 (&download_progress_markers)[syncable::MODEL_TYPE_COUNT], | 117 (&download_progress_markers)[syncable::MODEL_TYPE_COUNT], |
| 118 bool more_to_sync, | 118 bool more_to_sync, |
| 119 bool is_silenced, | 119 bool is_silenced, |
| 120 int64 unsynced_count, | 120 int64 unsynced_count, |
| 121 int num_blocking_conflicting_updates, | 121 int num_blocking_conflicting_updates, |
| 122 int num_conflicting_updates, | 122 int num_conflicting_updates, |
| 123 bool did_commit_items, | 123 bool did_commit_items, |
| 124 const SyncSourceInfo& source) | 124 const SyncSourceInfo& source, |
| 125 size_t num_entries) |
| 125 : syncer_status(syncer_status), | 126 : syncer_status(syncer_status), |
| 126 errors(errors), | 127 errors(errors), |
| 127 num_server_changes_remaining(num_server_changes_remaining), | 128 num_server_changes_remaining(num_server_changes_remaining), |
| 128 is_share_usable(is_share_usable), | 129 is_share_usable(is_share_usable), |
| 129 initial_sync_ended(initial_sync_ended), | 130 initial_sync_ended(initial_sync_ended), |
| 130 download_progress_markers(), | 131 download_progress_markers(), |
| 131 has_more_to_sync(more_to_sync), | 132 has_more_to_sync(more_to_sync), |
| 132 is_silenced(is_silenced), | 133 is_silenced(is_silenced), |
| 133 unsynced_count(unsynced_count), | 134 unsynced_count(unsynced_count), |
| 134 num_blocking_conflicting_updates(num_blocking_conflicting_updates), | 135 num_blocking_conflicting_updates(num_blocking_conflicting_updates), |
| 135 num_conflicting_updates(num_conflicting_updates), | 136 num_conflicting_updates(num_conflicting_updates), |
| 136 did_commit_items(did_commit_items), | 137 did_commit_items(did_commit_items), |
| 137 source(source) { | 138 source(source), |
| 139 num_entries(num_entries){ |
| 138 for (int i = syncable::FIRST_REAL_MODEL_TYPE; | 140 for (int i = syncable::FIRST_REAL_MODEL_TYPE; |
| 139 i < syncable::MODEL_TYPE_COUNT; ++i) { | 141 i < syncable::MODEL_TYPE_COUNT; ++i) { |
| 140 const_cast<std::string&>(this->download_progress_markers[i]).assign( | 142 const_cast<std::string&>(this->download_progress_markers[i]).assign( |
| 141 download_progress_markers[i]); | 143 download_progress_markers[i]); |
| 142 } | 144 } |
| 143 } | 145 } |
| 144 | 146 |
| 145 SyncSessionSnapshot::~SyncSessionSnapshot() {} | 147 SyncSessionSnapshot::~SyncSessionSnapshot() {} |
| 146 | 148 |
| 147 DictionaryValue* SyncSessionSnapshot::ToValue() const { | 149 DictionaryValue* SyncSessionSnapshot::ToValue() const { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 158 DownloadProgressMarkersToValue(download_progress_markers)); | 160 DownloadProgressMarkersToValue(download_progress_markers)); |
| 159 value->SetBoolean("hasMoreToSync", has_more_to_sync); | 161 value->SetBoolean("hasMoreToSync", has_more_to_sync); |
| 160 value->SetBoolean("isSilenced", is_silenced); | 162 value->SetBoolean("isSilenced", is_silenced); |
| 161 // We don't care too much if we lose precision here, also. | 163 // We don't care too much if we lose precision here, also. |
| 162 value->SetInteger("unsyncedCount", | 164 value->SetInteger("unsyncedCount", |
| 163 static_cast<int>(unsynced_count)); | 165 static_cast<int>(unsynced_count)); |
| 164 value->SetInteger("numBlockingConflictingUpdates", | 166 value->SetInteger("numBlockingConflictingUpdates", |
| 165 num_blocking_conflicting_updates); | 167 num_blocking_conflicting_updates); |
| 166 value->SetInteger("numConflictingUpdates", num_conflicting_updates); | 168 value->SetInteger("numConflictingUpdates", num_conflicting_updates); |
| 167 value->SetBoolean("didCommitItems", did_commit_items); | 169 value->SetBoolean("didCommitItems", did_commit_items); |
| 170 value->SetInteger("numEntries", num_entries); |
| 168 value->Set("source", source.ToValue()); | 171 value->Set("source", source.ToValue()); |
| 169 return value; | 172 return value; |
| 170 } | 173 } |
| 171 | 174 |
| 172 ConflictProgress::ConflictProgress(bool* dirty_flag) : dirty_(dirty_flag) {} | 175 ConflictProgress::ConflictProgress(bool* dirty_flag) : dirty_(dirty_flag) {} |
| 173 | 176 |
| 174 ConflictProgress::~ConflictProgress() { | 177 ConflictProgress::~ConflictProgress() { |
| 175 CleanupSets(); | 178 CleanupSets(); |
| 176 } | 179 } |
| 177 | 180 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 | 380 |
| 378 PerModelSafeGroupState::PerModelSafeGroupState(bool* dirty_flag) | 381 PerModelSafeGroupState::PerModelSafeGroupState(bool* dirty_flag) |
| 379 : conflict_progress(dirty_flag) { | 382 : conflict_progress(dirty_flag) { |
| 380 } | 383 } |
| 381 | 384 |
| 382 PerModelSafeGroupState::~PerModelSafeGroupState() { | 385 PerModelSafeGroupState::~PerModelSafeGroupState() { |
| 383 } | 386 } |
| 384 | 387 |
| 385 } // namespace sessions | 388 } // namespace sessions |
| 386 } // namespace browser_sync | 389 } // namespace browser_sync |
| OLD | NEW |