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

Side by Side Diff: components/sync/sessions/commit_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
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/commit_counters.h" 5 #include "components/sync/sessions/commit_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 CommitCounters::CommitCounters() 12 CommitCounters::CommitCounters()
13 : num_commits_attempted(0), 13 : num_commits_attempted(0),
14 num_commits_success(0), 14 num_commits_success(0),
15 num_commits_conflict(0), 15 num_commits_conflict(0),
16 num_commits_error(0) {} 16 num_commits_error(0) {}
17 17
18 CommitCounters::~CommitCounters() {} 18 CommitCounters::~CommitCounters() {}
19 19
20 std::unique_ptr<base::DictionaryValue> CommitCounters::ToValue() const { 20 std::unique_ptr<base::DictionaryValue> CommitCounters::ToValue() const {
21 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); 21 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
22 value->SetInteger("numCommitsAttempted", num_commits_attempted); 22 value->SetInteger("numCommitsAttempted", num_commits_attempted);
23 value->SetInteger("numCommitsSuccess", num_commits_success); 23 value->SetInteger("numCommitsSuccess", num_commits_success);
24 value->SetInteger("numCommitsConflict", num_commits_conflict); 24 value->SetInteger("numCommitsConflict", num_commits_conflict);
25 value->SetInteger("numCommitsError", num_commits_error); 25 value->SetInteger("numCommitsError", num_commits_error);
26 return value; 26 return value;
27 } 27 }
28 28
29 std::string CommitCounters::ToString() const { 29 std::string CommitCounters::ToString() const {
30 std::string result; 30 std::string result;
31 std::unique_ptr<base::DictionaryValue> value = ToValue(); 31 std::unique_ptr<base::DictionaryValue> value = ToValue();
32 JSONStringValueSerializer serializer(&result); 32 JSONStringValueSerializer serializer(&result);
33 serializer.Serialize(*value); 33 serializer.Serialize(*value);
34 return result; 34 return result;
35 } 35 }
36 36
37 } // namespace syncer 37 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/sessions/commit_counters.h ('k') | components/sync/sessions/model_neutral_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698