Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: sync/internal_api/public/sessions/sync_session_snapshot.cc

Issue 1144443004: Revert of [Sync] Refactoring polling to be reliable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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,
38 const std::vector<int>& num_entries_by_type, 37 const std::vector<int>& num_entries_by_type,
39 const std::vector<int>& num_to_delete_entries_by_type, 38 const std::vector<int>& num_to_delete_entries_by_type,
40 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource legacy_updates_source) 39 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource legacy_updates_source)
41 : model_neutral_state_(model_neutral_state), 40 : model_neutral_state_(model_neutral_state),
42 download_progress_markers_(download_progress_markers), 41 download_progress_markers_(download_progress_markers),
43 is_silenced_(is_silenced), 42 is_silenced_(is_silenced),
44 num_encryption_conflicts_(num_encryption_conflicts), 43 num_encryption_conflicts_(num_encryption_conflicts),
45 num_hierarchy_conflicts_(num_hierarchy_conflicts), 44 num_hierarchy_conflicts_(num_hierarchy_conflicts),
46 num_server_conflicts_(num_server_conflicts), 45 num_server_conflicts_(num_server_conflicts),
47 notifications_enabled_(notifications_enabled), 46 notifications_enabled_(notifications_enabled),
48 num_entries_(num_entries), 47 num_entries_(num_entries),
49 sync_start_time_(sync_start_time), 48 sync_start_time_(sync_start_time),
50 poll_finish_time_(poll_finish_time),
51 num_entries_by_type_(num_entries_by_type), 49 num_entries_by_type_(num_entries_by_type),
52 num_to_delete_entries_by_type_(num_to_delete_entries_by_type), 50 num_to_delete_entries_by_type_(num_to_delete_entries_by_type),
53 legacy_updates_source_(legacy_updates_source), 51 legacy_updates_source_(legacy_updates_source),
54 is_initialized_(true) { 52 is_initialized_(true) {
55 } 53 }
56 54
57 SyncSessionSnapshot::~SyncSessionSnapshot() {} 55 SyncSessionSnapshot::~SyncSessionSnapshot() {}
58 56
59 base::DictionaryValue* SyncSessionSnapshot::ToValue() const { 57 base::DictionaryValue* SyncSessionSnapshot::ToValue() const {
60 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue()); 58 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 135 }
138 136
139 size_t SyncSessionSnapshot::num_entries() const { 137 size_t SyncSessionSnapshot::num_entries() const {
140 return num_entries_; 138 return num_entries_;
141 } 139 }
142 140
143 base::Time SyncSessionSnapshot::sync_start_time() const { 141 base::Time SyncSessionSnapshot::sync_start_time() const {
144 return sync_start_time_; 142 return sync_start_time_;
145 } 143 }
146 144
147 base::Time SyncSessionSnapshot::poll_finish_time() const {
148 return poll_finish_time_;
149 }
150
151 bool SyncSessionSnapshot::is_initialized() const { 145 bool SyncSessionSnapshot::is_initialized() const {
152 return is_initialized_; 146 return is_initialized_;
153 } 147 }
154 148
155 const std::vector<int>& SyncSessionSnapshot::num_entries_by_type() const { 149 const std::vector<int>& SyncSessionSnapshot::num_entries_by_type() const {
156 return num_entries_by_type_; 150 return num_entries_by_type_;
157 } 151 }
158 152
159 const std::vector<int>& 153 const std::vector<int>&
160 SyncSessionSnapshot::num_to_delete_entries_by_type() const { 154 SyncSessionSnapshot::num_to_delete_entries_by_type() const {
161 return num_to_delete_entries_by_type_; 155 return num_to_delete_entries_by_type_;
162 } 156 }
163 157
164 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource 158 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource
165 SyncSessionSnapshot::legacy_updates_source() const { 159 SyncSessionSnapshot::legacy_updates_source() const {
166 return legacy_updates_source_; 160 return legacy_updates_source_;
167 } 161 }
168 162
169 } // namespace sessions 163 } // namespace sessions
170 } // namespace syncer 164 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698