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

Side by Side Diff: components/sync/sessions/update_counters.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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
« no previous file with comments | « components/sync/sessions/update_counters.h ('k') | components/sync/sessions_impl/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/update_counters.h" 5 #include "components/sync/sessions/update_counters.h"
6 6
7 #include "base/json/json_string_value_serializer.h" 7 #include "base/json/json_string_value_serializer.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 9
10 namespace syncer { 10 namespace syncer {
11 11
12 UpdateCounters::UpdateCounters() 12 UpdateCounters::UpdateCounters()
13 : num_updates_received(0), 13 : num_updates_received(0),
14 num_reflected_updates_received(0), 14 num_reflected_updates_received(0),
15 num_tombstone_updates_received(0), 15 num_tombstone_updates_received(0),
16 num_updates_applied(0), 16 num_updates_applied(0),
17 num_hierarchy_conflict_application_failures(0), 17 num_hierarchy_conflict_application_failures(0),
18 num_encryption_conflict_application_failures(0), 18 num_encryption_conflict_application_failures(0),
19 num_server_overwrites(0), 19 num_server_overwrites(0),
20 num_local_overwrites(0) {} 20 num_local_overwrites(0) {}
21 21
22 UpdateCounters::~UpdateCounters() {} 22 UpdateCounters::~UpdateCounters() {}
23 23
24 std::unique_ptr<base::DictionaryValue> UpdateCounters::ToValue() const { 24 std::unique_ptr<base::DictionaryValue> UpdateCounters::ToValue() const {
25 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); 25 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
26 26
27 value->SetInteger("numUpdatesReceived", num_updates_received); 27 value->SetInteger("numUpdatesReceived", num_updates_received);
28 value->SetInteger("numReflectedUpdatesReceived", 28 value->SetInteger("numReflectedUpdatesReceived",
29 num_reflected_updates_received); 29 num_reflected_updates_received);
30 value->SetInteger("numTombstoneUpdatesReceived", 30 value->SetInteger("numTombstoneUpdatesReceived",
(...skipping 13 matching lines...) Expand all
44 44
45 std::string UpdateCounters::ToString() const { 45 std::string UpdateCounters::ToString() const {
46 std::string result; 46 std::string result;
47 std::unique_ptr<base::DictionaryValue> value = ToValue(); 47 std::unique_ptr<base::DictionaryValue> value = ToValue();
48 JSONStringValueSerializer serializer(&result); 48 JSONStringValueSerializer serializer(&result);
49 serializer.Serialize(*value); 49 serializer.Serialize(*value);
50 return result; 50 return result;
51 } 51 }
52 52
53 } // namespace syncer 53 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/sessions/update_counters.h ('k') | components/sync/sessions_impl/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698