| 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/internal_api/public/sessions/sync_session_snapshot.h" | 5 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" |
| 6 | 6 |
| 7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 notifications_enabled_(false), | 22 notifications_enabled_(false), |
| 23 num_entries_(0), | 23 num_entries_(0), |
| 24 retry_scheduled_(false), | 24 retry_scheduled_(false), |
| 25 is_initialized_(false) { | 25 is_initialized_(false) { |
| 26 } | 26 } |
| 27 | 27 |
| 28 SyncSessionSnapshot::SyncSessionSnapshot( | 28 SyncSessionSnapshot::SyncSessionSnapshot( |
| 29 const ModelNeutralState& model_neutral_state, | 29 const ModelNeutralState& model_neutral_state, |
| 30 bool is_share_usable, | 30 bool is_share_usable, |
| 31 ModelTypeSet initial_sync_ended, | 31 ModelTypeSet initial_sync_ended, |
| 32 const ModelTypePayloadMap& download_progress_markers, | 32 const ModelTypeStateMap& download_progress_markers, |
| 33 bool more_to_sync, | 33 bool more_to_sync, |
| 34 bool is_silenced, | 34 bool is_silenced, |
| 35 int num_encryption_conflicts, | 35 int num_encryption_conflicts, |
| 36 int num_hierarchy_conflicts, | 36 int num_hierarchy_conflicts, |
| 37 int num_simple_conflicts, | 37 int num_simple_conflicts, |
| 38 int num_server_conflicts, | 38 int num_server_conflicts, |
| 39 const SyncSourceInfo& source, | 39 const SyncSourceInfo& source, |
| 40 bool notifications_enabled, | 40 bool notifications_enabled, |
| 41 size_t num_entries, | 41 size_t num_entries, |
| 42 base::Time sync_start_time, | 42 base::Time sync_start_time, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 model_neutral_state_.num_local_overwrites); | 77 model_neutral_state_.num_local_overwrites); |
| 78 value->SetInteger("numServerOverwrites", | 78 value->SetInteger("numServerOverwrites", |
| 79 model_neutral_state_.num_server_overwrites); | 79 model_neutral_state_.num_server_overwrites); |
| 80 value->SetInteger( | 80 value->SetInteger( |
| 81 "numServerChangesRemaining", | 81 "numServerChangesRemaining", |
| 82 static_cast<int>(model_neutral_state_.num_server_changes_remaining)); | 82 static_cast<int>(model_neutral_state_.num_server_changes_remaining)); |
| 83 value->SetBoolean("isShareUsable", is_share_usable_); | 83 value->SetBoolean("isShareUsable", is_share_usable_); |
| 84 value->Set("initialSyncEnded", | 84 value->Set("initialSyncEnded", |
| 85 ModelTypeSetToValue(initial_sync_ended_)); | 85 ModelTypeSetToValue(initial_sync_ended_)); |
| 86 value->Set("downloadProgressMarkers", | 86 value->Set("downloadProgressMarkers", |
| 87 ModelTypePayloadMapToValue(download_progress_markers_)); | 87 ModelTypeStateMapToValue(download_progress_markers_)); |
| 88 value->SetBoolean("hasMoreToSync", has_more_to_sync_); | 88 value->SetBoolean("hasMoreToSync", has_more_to_sync_); |
| 89 value->SetBoolean("isSilenced", is_silenced_); | 89 value->SetBoolean("isSilenced", is_silenced_); |
| 90 // We don't care too much if we lose precision here, also. | 90 // We don't care too much if we lose precision here, also. |
| 91 value->SetInteger("numEncryptionConflicts", | 91 value->SetInteger("numEncryptionConflicts", |
| 92 num_encryption_conflicts_); | 92 num_encryption_conflicts_); |
| 93 value->SetInteger("numHierarchyConflicts", | 93 value->SetInteger("numHierarchyConflicts", |
| 94 num_hierarchy_conflicts_); | 94 num_hierarchy_conflicts_); |
| 95 value->SetInteger("numSimpleConflicts", | 95 value->SetInteger("numSimpleConflicts", |
| 96 num_simple_conflicts_); | 96 num_simple_conflicts_); |
| 97 value->SetInteger("numServerConflicts", | 97 value->SetInteger("numServerConflicts", |
| (...skipping 18 matching lines...) Expand all Loading... |
| 116 } | 116 } |
| 117 | 117 |
| 118 bool SyncSessionSnapshot::is_share_usable() const { | 118 bool SyncSessionSnapshot::is_share_usable() const { |
| 119 return is_share_usable_; | 119 return is_share_usable_; |
| 120 } | 120 } |
| 121 | 121 |
| 122 ModelTypeSet SyncSessionSnapshot::initial_sync_ended() const { | 122 ModelTypeSet SyncSessionSnapshot::initial_sync_ended() const { |
| 123 return initial_sync_ended_; | 123 return initial_sync_ended_; |
| 124 } | 124 } |
| 125 | 125 |
| 126 ModelTypePayloadMap SyncSessionSnapshot::download_progress_markers() const { | 126 ModelTypeStateMap SyncSessionSnapshot::download_progress_markers() const { |
| 127 return download_progress_markers_; | 127 return download_progress_markers_; |
| 128 } | 128 } |
| 129 | 129 |
| 130 bool SyncSessionSnapshot::has_more_to_sync() const { | 130 bool SyncSessionSnapshot::has_more_to_sync() const { |
| 131 return has_more_to_sync_; | 131 return has_more_to_sync_; |
| 132 } | 132 } |
| 133 | 133 |
| 134 bool SyncSessionSnapshot::is_silenced() const { | 134 bool SyncSessionSnapshot::is_silenced() const { |
| 135 return is_silenced_; | 135 return is_silenced_; |
| 136 } | 136 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 bool SyncSessionSnapshot::retry_scheduled() const { | 170 bool SyncSessionSnapshot::retry_scheduled() const { |
| 171 return retry_scheduled_; | 171 return retry_scheduled_; |
| 172 } | 172 } |
| 173 | 173 |
| 174 bool SyncSessionSnapshot::is_initialized() const { | 174 bool SyncSessionSnapshot::is_initialized() const { |
| 175 return is_initialized_; | 175 return is_initialized_; |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace sessions | 178 } // namespace sessions |
| 179 } // namespace syncer | 179 } // namespace syncer |
| OLD | NEW |