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

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

Issue 290023003: sync: Add UI code for per type debug counters (Closed) Base URL: https://chromium.googlesource.com/chromium/src
Patch Set: Update comment and rebase Created 6 years, 6 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 | « sync/internal_api/public/sessions/status_counters.h ('k') | no next file » | 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/status_counters.h" 5 #include "sync/internal_api/public/sessions/status_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 StatusCounters::StatusCounters() 12 StatusCounters::StatusCounters()
13 : num_total_entries(0) {} 13 : num_entries(0) {}
14 14
15 StatusCounters::~StatusCounters() {} 15 StatusCounters::~StatusCounters() {}
16 16
17 scoped_ptr<base::DictionaryValue> StatusCounters::ToValue() const { 17 scoped_ptr<base::DictionaryValue> StatusCounters::ToValue() const {
18 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue()); 18 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
19 value->SetInteger("numTotalEntries", num_total_entries); 19 value->SetInteger("numEntries", num_entries);
20 return value.Pass(); 20 return value.Pass();
21 } 21 }
22 22
23 std::string StatusCounters::ToString() const { 23 std::string StatusCounters::ToString() const {
24 std::string result; 24 std::string result;
25 scoped_ptr<base::DictionaryValue> value = ToValue(); 25 scoped_ptr<base::DictionaryValue> value = ToValue();
26 JSONStringValueSerializer serializer(&result); 26 JSONStringValueSerializer serializer(&result);
27 serializer.Serialize(*value); 27 serializer.Serialize(*value);
28 return result; 28 return result;
29 } 29 }
30 30
31 } // namespace syncer 31 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/public/sessions/status_counters.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698