OLD | NEW |
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_entries(0) {} | 13 : num_entries(0), |
| 14 num_entries_and_tombstones(0) {} |
14 | 15 |
15 StatusCounters::~StatusCounters() {} | 16 StatusCounters::~StatusCounters() {} |
16 | 17 |
17 scoped_ptr<base::DictionaryValue> StatusCounters::ToValue() const { | 18 scoped_ptr<base::DictionaryValue> StatusCounters::ToValue() const { |
18 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue()); | 19 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue()); |
19 value->SetInteger("numEntries", num_entries); | 20 value->SetInteger("numEntries", num_entries); |
| 21 value->SetInteger("numEntriesAndTombstones", num_entries_and_tombstones); |
20 return value.Pass(); | 22 return value.Pass(); |
21 } | 23 } |
22 | 24 |
23 std::string StatusCounters::ToString() const { | 25 std::string StatusCounters::ToString() const { |
24 std::string result; | 26 std::string result; |
25 scoped_ptr<base::DictionaryValue> value = ToValue(); | 27 scoped_ptr<base::DictionaryValue> value = ToValue(); |
26 JSONStringValueSerializer serializer(&result); | 28 JSONStringValueSerializer serializer(&result); |
27 serializer.Serialize(*value); | 29 serializer.Serialize(*value); |
28 return result; | 30 return result; |
29 } | 31 } |
30 | 32 |
31 } // namespace syncer | 33 } // namespace syncer |
OLD | NEW |