| 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 #include "sync/protocol/proto_enum_conversions.h" | 10 #include "sync/protocol/proto_enum_conversions.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 SyncSessionSnapshot::SyncSessionSnapshot( | 27 SyncSessionSnapshot::SyncSessionSnapshot( |
| 28 const ModelNeutralState& model_neutral_state, | 28 const ModelNeutralState& model_neutral_state, |
| 29 const ProgressMarkerMap& download_progress_markers, | 29 const ProgressMarkerMap& download_progress_markers, |
| 30 bool is_silenced, | 30 bool is_silenced, |
| 31 int num_encryption_conflicts, | 31 int num_encryption_conflicts, |
| 32 int num_hierarchy_conflicts, | 32 int num_hierarchy_conflicts, |
| 33 int num_server_conflicts, | 33 int num_server_conflicts, |
| 34 bool notifications_enabled, | 34 bool notifications_enabled, |
| 35 size_t num_entries, | 35 size_t num_entries, |
| 36 base::Time sync_start_time, | 36 base::Time sync_start_time, |
| 37 base::Time poll_finish_time, |
| 37 const std::vector<int>& num_entries_by_type, | 38 const std::vector<int>& num_entries_by_type, |
| 38 const std::vector<int>& num_to_delete_entries_by_type, | 39 const std::vector<int>& num_to_delete_entries_by_type, |
| 39 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource legacy_updates_source) | 40 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource legacy_updates_source) |
| 40 : model_neutral_state_(model_neutral_state), | 41 : model_neutral_state_(model_neutral_state), |
| 41 download_progress_markers_(download_progress_markers), | 42 download_progress_markers_(download_progress_markers), |
| 42 is_silenced_(is_silenced), | 43 is_silenced_(is_silenced), |
| 43 num_encryption_conflicts_(num_encryption_conflicts), | 44 num_encryption_conflicts_(num_encryption_conflicts), |
| 44 num_hierarchy_conflicts_(num_hierarchy_conflicts), | 45 num_hierarchy_conflicts_(num_hierarchy_conflicts), |
| 45 num_server_conflicts_(num_server_conflicts), | 46 num_server_conflicts_(num_server_conflicts), |
| 46 notifications_enabled_(notifications_enabled), | 47 notifications_enabled_(notifications_enabled), |
| 47 num_entries_(num_entries), | 48 num_entries_(num_entries), |
| 48 sync_start_time_(sync_start_time), | 49 sync_start_time_(sync_start_time), |
| 50 poll_finish_time_(poll_finish_time), |
| 49 num_entries_by_type_(num_entries_by_type), | 51 num_entries_by_type_(num_entries_by_type), |
| 50 num_to_delete_entries_by_type_(num_to_delete_entries_by_type), | 52 num_to_delete_entries_by_type_(num_to_delete_entries_by_type), |
| 51 legacy_updates_source_(legacy_updates_source), | 53 legacy_updates_source_(legacy_updates_source), |
| 52 is_initialized_(true) { | 54 is_initialized_(true) { |
| 53 } | 55 } |
| 54 | 56 |
| 55 SyncSessionSnapshot::~SyncSessionSnapshot() {} | 57 SyncSessionSnapshot::~SyncSessionSnapshot() {} |
| 56 | 58 |
| 57 base::DictionaryValue* SyncSessionSnapshot::ToValue() const { | 59 base::DictionaryValue* SyncSessionSnapshot::ToValue() const { |
| 58 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue()); | 60 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue()); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } | 137 } |
| 136 | 138 |
| 137 size_t SyncSessionSnapshot::num_entries() const { | 139 size_t SyncSessionSnapshot::num_entries() const { |
| 138 return num_entries_; | 140 return num_entries_; |
| 139 } | 141 } |
| 140 | 142 |
| 141 base::Time SyncSessionSnapshot::sync_start_time() const { | 143 base::Time SyncSessionSnapshot::sync_start_time() const { |
| 142 return sync_start_time_; | 144 return sync_start_time_; |
| 143 } | 145 } |
| 144 | 146 |
| 147 base::Time SyncSessionSnapshot::poll_finish_time() const { |
| 148 return poll_finish_time_; |
| 149 } |
| 150 |
| 145 bool SyncSessionSnapshot::is_initialized() const { | 151 bool SyncSessionSnapshot::is_initialized() const { |
| 146 return is_initialized_; | 152 return is_initialized_; |
| 147 } | 153 } |
| 148 | 154 |
| 149 const std::vector<int>& SyncSessionSnapshot::num_entries_by_type() const { | 155 const std::vector<int>& SyncSessionSnapshot::num_entries_by_type() const { |
| 150 return num_entries_by_type_; | 156 return num_entries_by_type_; |
| 151 } | 157 } |
| 152 | 158 |
| 153 const std::vector<int>& | 159 const std::vector<int>& |
| 154 SyncSessionSnapshot::num_to_delete_entries_by_type() const { | 160 SyncSessionSnapshot::num_to_delete_entries_by_type() const { |
| 155 return num_to_delete_entries_by_type_; | 161 return num_to_delete_entries_by_type_; |
| 156 } | 162 } |
| 157 | 163 |
| 158 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource | 164 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource |
| 159 SyncSessionSnapshot::legacy_updates_source() const { | 165 SyncSessionSnapshot::legacy_updates_source() const { |
| 160 return legacy_updates_source_; | 166 return legacy_updates_source_; |
| 161 } | 167 } |
| 162 | 168 |
| 163 } // namespace sessions | 169 } // namespace sessions |
| 164 } // namespace syncer | 170 } // namespace syncer |
| OLD | NEW |