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

Side by Side Diff: components/sync/engine/cycle/sync_cycle_snapshot.cc

Issue 2433563002: [Sync] Reimplement proto value conversions on top of field visitors. (Closed)
Patch Set: Remove temporary tests Created 4 years, 1 month 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 "components/sync/engine/cycle/sync_cycle_snapshot.h" 5 #include "components/sync/engine/cycle/sync_cycle_snapshot.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 value->SetInteger("numServerOverwrites", 75 value->SetInteger("numServerOverwrites",
76 model_neutral_state_.num_server_overwrites); 76 model_neutral_state_.num_server_overwrites);
77 value->Set("downloadProgressMarkers", 77 value->Set("downloadProgressMarkers",
78 ProgressMarkerMapToValue(download_progress_markers_)); 78 ProgressMarkerMapToValue(download_progress_markers_));
79 value->SetBoolean("isSilenced", is_silenced_); 79 value->SetBoolean("isSilenced", is_silenced_);
80 // We don't care too much if we lose precision here, also. 80 // We don't care too much if we lose precision here, also.
81 value->SetInteger("numEncryptionConflicts", num_encryption_conflicts_); 81 value->SetInteger("numEncryptionConflicts", num_encryption_conflicts_);
82 value->SetInteger("numHierarchyConflicts", num_hierarchy_conflicts_); 82 value->SetInteger("numHierarchyConflicts", num_hierarchy_conflicts_);
83 value->SetInteger("numServerConflicts", num_server_conflicts_); 83 value->SetInteger("numServerConflicts", num_server_conflicts_);
84 value->SetInteger("numEntries", num_entries_); 84 value->SetInteger("numEntries", num_entries_);
85 value->SetString("legacySource", 85 value->SetString("legacySource", ProtoEnumToString(legacy_updates_source_));
86 GetUpdatesSourceString(legacy_updates_source_));
87 value->SetBoolean("notificationsEnabled", notifications_enabled_); 86 value->SetBoolean("notificationsEnabled", notifications_enabled_);
88 87
89 std::unique_ptr<base::DictionaryValue> counter_entries( 88 std::unique_ptr<base::DictionaryValue> counter_entries(
90 new base::DictionaryValue()); 89 new base::DictionaryValue());
91 for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; i++) { 90 for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; i++) {
92 std::unique_ptr<base::DictionaryValue> type_entries( 91 std::unique_ptr<base::DictionaryValue> type_entries(
93 new base::DictionaryValue()); 92 new base::DictionaryValue());
94 type_entries->SetInteger("numEntries", num_entries_by_type_[i]); 93 type_entries->SetInteger("numEntries", num_entries_by_type_[i]);
95 type_entries->SetInteger("numToDeleteEntries", 94 type_entries->SetInteger("numToDeleteEntries",
96 num_to_delete_entries_by_type_[i]); 95 num_to_delete_entries_by_type_[i]);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 const { 156 const {
158 return num_to_delete_entries_by_type_; 157 return num_to_delete_entries_by_type_;
159 } 158 }
160 159
161 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource 160 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource
162 SyncCycleSnapshot::legacy_updates_source() const { 161 SyncCycleSnapshot::legacy_updates_source() const {
163 return legacy_updates_source_; 162 return legacy_updates_source_;
164 } 163 }
165 164
166 } // namespace syncer 165 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/driver/about_sync_util.cc ('k') | components/sync/engine/events/configure_get_updates_request_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698