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

Side by Side Diff: sync/internal_api/public/sessions/status_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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "sync/internal_api/public/sessions/status_counters.h"
6
7 #include "base/json/json_string_value_serializer.h"
8 #include "base/values.h"
9
10 namespace syncer {
11
12 StatusCounters::StatusCounters()
13 : num_entries(0),
14 num_entries_and_tombstones(0) {}
15
16 StatusCounters::~StatusCounters() {}
17
18 std::unique_ptr<base::DictionaryValue> StatusCounters::ToValue() const {
19 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
20 value->SetInteger("numEntries", num_entries);
21 value->SetInteger("numEntriesAndTombstones", num_entries_and_tombstones);
22 return value;
23 }
24
25 std::string StatusCounters::ToString() const {
26 std::string result;
27 std::unique_ptr<base::DictionaryValue> value = ToValue();
28 JSONStringValueSerializer serializer(&result);
29 serializer.Serialize(*value);
30 return result;
31 }
32
33 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/public/sessions/status_counters.h ('k') | sync/internal_api/public/sessions/sync_session_snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698