| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 consecutive_transient_error_commits); | 107 consecutive_transient_error_commits); |
| 108 value->SetInteger("consecutiveErrors", consecutive_errors); | 108 value->SetInteger("consecutiveErrors", consecutive_errors); |
| 109 return value; | 109 return value; |
| 110 } | 110 } |
| 111 | 111 |
| 112 SyncSessionSnapshot::SyncSessionSnapshot( | 112 SyncSessionSnapshot::SyncSessionSnapshot( |
| 113 const SyncerStatus& syncer_status, | 113 const SyncerStatus& syncer_status, |
| 114 const ErrorCounters& errors, | 114 const ErrorCounters& errors, |
| 115 int64 num_server_changes_remaining, | 115 int64 num_server_changes_remaining, |
| 116 bool is_share_usable, | 116 bool is_share_usable, |
| 117 const syncable::ModelTypeBitSet& initial_sync_ended, | 117 syncable::ModelEnumSet initial_sync_ended, |
| 118 const std::string | 118 const std::string |
| 119 (&download_progress_markers)[syncable::MODEL_TYPE_COUNT], | 119 (&download_progress_markers)[syncable::MODEL_TYPE_COUNT], |
| 120 bool more_to_sync, | 120 bool more_to_sync, |
| 121 bool is_silenced, | 121 bool is_silenced, |
| 122 int64 unsynced_count, | 122 int64 unsynced_count, |
| 123 int num_blocking_conflicting_updates, | 123 int num_blocking_conflicting_updates, |
| 124 int num_conflicting_updates, | 124 int num_conflicting_updates, |
| 125 bool did_commit_items, | 125 bool did_commit_items, |
| 126 const SyncSourceInfo& source, | 126 const SyncSourceInfo& source, |
| 127 size_t num_entries, | 127 size_t num_entries, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 152 | 152 |
| 153 DictionaryValue* SyncSessionSnapshot::ToValue() const { | 153 DictionaryValue* SyncSessionSnapshot::ToValue() const { |
| 154 DictionaryValue* value = new DictionaryValue(); | 154 DictionaryValue* value = new DictionaryValue(); |
| 155 value->Set("syncerStatus", syncer_status.ToValue()); | 155 value->Set("syncerStatus", syncer_status.ToValue()); |
| 156 value->Set("errors", errors.ToValue()); | 156 value->Set("errors", errors.ToValue()); |
| 157 // We don't care too much if we lose precision here. | 157 // We don't care too much if we lose precision here. |
| 158 value->SetInteger("numServerChangesRemaining", | 158 value->SetInteger("numServerChangesRemaining", |
| 159 static_cast<int>(num_server_changes_remaining)); | 159 static_cast<int>(num_server_changes_remaining)); |
| 160 value->SetBoolean("isShareUsable", is_share_usable); | 160 value->SetBoolean("isShareUsable", is_share_usable); |
| 161 value->Set("initialSyncEnded", | 161 value->Set("initialSyncEnded", |
| 162 syncable::ModelTypeBitSetToValue(initial_sync_ended)); | 162 syncable::ModelEnumSetToValue(initial_sync_ended)); |
| 163 value->Set("downloadProgressMarkers", | 163 value->Set("downloadProgressMarkers", |
| 164 DownloadProgressMarkersToValue(download_progress_markers)); | 164 DownloadProgressMarkersToValue(download_progress_markers)); |
| 165 value->SetBoolean("hasMoreToSync", has_more_to_sync); | 165 value->SetBoolean("hasMoreToSync", has_more_to_sync); |
| 166 value->SetBoolean("isSilenced", is_silenced); | 166 value->SetBoolean("isSilenced", is_silenced); |
| 167 // We don't care too much if we lose precision here, also. | 167 // We don't care too much if we lose precision here, also. |
| 168 value->SetInteger("unsyncedCount", | 168 value->SetInteger("unsyncedCount", |
| 169 static_cast<int>(unsynced_count)); | 169 static_cast<int>(unsynced_count)); |
| 170 value->SetInteger("numBlockingConflictingUpdates", | 170 value->SetInteger("numBlockingConflictingUpdates", |
| 171 num_blocking_conflicting_updates); | 171 num_blocking_conflicting_updates); |
| 172 value->SetInteger("numConflictingUpdates", num_conflicting_updates); | 172 value->SetInteger("numConflictingUpdates", num_conflicting_updates); |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 | 387 |
| 388 PerModelSafeGroupState::PerModelSafeGroupState(bool* dirty_flag) | 388 PerModelSafeGroupState::PerModelSafeGroupState(bool* dirty_flag) |
| 389 : conflict_progress(dirty_flag) { | 389 : conflict_progress(dirty_flag) { |
| 390 } | 390 } |
| 391 | 391 |
| 392 PerModelSafeGroupState::~PerModelSafeGroupState() { | 392 PerModelSafeGroupState::~PerModelSafeGroupState() { |
| 393 } | 393 } |
| 394 | 394 |
| 395 } // namespace sessions | 395 } // namespace sessions |
| 396 } // namespace browser_sync | 396 } // namespace browser_sync |
| OLD | NEW |