| 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/values.h" | 8 #include "base/values.h" |
| 9 | 9 |
| 10 namespace syncer { | 10 namespace syncer { |
| 11 namespace sessions { | 11 namespace sessions { |
| 12 | 12 |
| 13 SyncSessionSnapshot::SyncSessionSnapshot() | 13 SyncSessionSnapshot::SyncSessionSnapshot() |
| 14 : is_share_usable_(false), | 14 : is_share_usable_(false), |
| 15 has_more_to_sync_(false), | 15 has_more_to_sync_(false), |
| 16 is_silenced_(false), | 16 is_silenced_(false), |
| 17 num_encryption_conflicts_(0), | 17 num_encryption_conflicts_(0), |
| 18 num_hierarchy_conflicts_(0), | 18 num_hierarchy_conflicts_(0), |
| 19 num_simple_conflicts_(0), | 19 num_simple_conflicts_(0), |
| 20 num_server_conflicts_(0), | 20 num_server_conflicts_(0), |
| 21 notifications_enabled_(false), | 21 notifications_enabled_(false), |
| 22 num_entries_(0), | 22 num_entries_(0), |
| 23 retry_scheduled_(false) { | 23 retry_scheduled_(false), |
| 24 is_initialized_(false) { |
| 24 } | 25 } |
| 25 | 26 |
| 26 SyncSessionSnapshot::SyncSessionSnapshot( | 27 SyncSessionSnapshot::SyncSessionSnapshot( |
| 27 const ModelNeutralState& model_neutral_state, | 28 const ModelNeutralState& model_neutral_state, |
| 28 bool is_share_usable, | 29 bool is_share_usable, |
| 29 syncable::ModelTypeSet initial_sync_ended, | 30 syncable::ModelTypeSet initial_sync_ended, |
| 30 const syncable::ModelTypePayloadMap& download_progress_markers, | 31 const syncable::ModelTypePayloadMap& download_progress_markers, |
| 31 bool more_to_sync, | 32 bool more_to_sync, |
| 32 bool is_silenced, | 33 bool is_silenced, |
| 33 int num_encryption_conflicts, | 34 int num_encryption_conflicts, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 46 has_more_to_sync_(more_to_sync), | 47 has_more_to_sync_(more_to_sync), |
| 47 is_silenced_(is_silenced), | 48 is_silenced_(is_silenced), |
| 48 num_encryption_conflicts_(num_encryption_conflicts), | 49 num_encryption_conflicts_(num_encryption_conflicts), |
| 49 num_hierarchy_conflicts_(num_hierarchy_conflicts), | 50 num_hierarchy_conflicts_(num_hierarchy_conflicts), |
| 50 num_simple_conflicts_(num_simple_conflicts), | 51 num_simple_conflicts_(num_simple_conflicts), |
| 51 num_server_conflicts_(num_server_conflicts), | 52 num_server_conflicts_(num_server_conflicts), |
| 52 source_(source), | 53 source_(source), |
| 53 notifications_enabled_(notifications_enabled), | 54 notifications_enabled_(notifications_enabled), |
| 54 num_entries_(num_entries), | 55 num_entries_(num_entries), |
| 55 sync_start_time_(sync_start_time), | 56 sync_start_time_(sync_start_time), |
| 56 retry_scheduled_(retry_scheduled) { | 57 retry_scheduled_(retry_scheduled), |
| 58 is_initialized_(true) { |
| 57 } | 59 } |
| 58 | 60 |
| 59 SyncSessionSnapshot::~SyncSessionSnapshot() {} | 61 SyncSessionSnapshot::~SyncSessionSnapshot() {} |
| 60 | 62 |
| 61 DictionaryValue* SyncSessionSnapshot::ToValue() const { | 63 DictionaryValue* SyncSessionSnapshot::ToValue() const { |
| 62 DictionaryValue* value = new DictionaryValue(); | 64 DictionaryValue* value = new DictionaryValue(); |
| 63 value->SetInteger("numSuccessfulCommits", | 65 value->SetInteger("numSuccessfulCommits", |
| 64 model_neutral_state_.num_successful_commits); | 66 model_neutral_state_.num_successful_commits); |
| 65 value->SetInteger("numSuccessfulBookmarkCommits", | 67 value->SetInteger("numSuccessfulBookmarkCommits", |
| 66 model_neutral_state_.num_successful_bookmark_commits); | 68 model_neutral_state_.num_successful_bookmark_commits); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 164 } |
| 163 | 165 |
| 164 base::Time SyncSessionSnapshot::sync_start_time() const { | 166 base::Time SyncSessionSnapshot::sync_start_time() const { |
| 165 return sync_start_time_; | 167 return sync_start_time_; |
| 166 } | 168 } |
| 167 | 169 |
| 168 bool SyncSessionSnapshot::retry_scheduled() const { | 170 bool SyncSessionSnapshot::retry_scheduled() const { |
| 169 return retry_scheduled_; | 171 return retry_scheduled_; |
| 170 } | 172 } |
| 171 | 173 |
| 174 bool SyncSessionSnapshot::is_initialized() const { |
| 175 return is_initialized_; |
| 176 } |
| 177 |
| 172 } // namespace sessions | 178 } // namespace sessions |
| 173 } // namespace syncer | 179 } // namespace syncer |
| OLD | NEW |