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

Side by Side Diff: sync/sessions/status_controller.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 | « sync/sessions/status_controller.h ('k') | sync/sessions/status_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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/sessions/status_controller.h"
6
7 #include <vector>
8
9 #include "sync/internal_api/public/base/model_type.h"
10 #include "sync/protocol/sync_protocol_error.h"
11
12 namespace syncer {
13 namespace sessions {
14
15 StatusController::StatusController() {
16 }
17
18 StatusController::~StatusController() {}
19
20 const ModelTypeSet StatusController::get_updates_request_types() const {
21 return model_neutral_.get_updates_request_types;
22 }
23
24 void StatusController::set_get_updates_request_types(ModelTypeSet value) {
25 model_neutral_.get_updates_request_types = value;
26 }
27
28 const ModelTypeSet StatusController::commit_request_types() const {
29 return model_neutral_.commit_request_types;
30 }
31
32 void StatusController::set_commit_request_types(ModelTypeSet value) {
33 model_neutral_.commit_request_types = value;
34 }
35
36 void StatusController::increment_num_updates_downloaded_by(int value) {
37 model_neutral_.num_updates_downloaded_total += value;
38 }
39
40 void StatusController::increment_num_tombstone_updates_downloaded_by(
41 int value) {
42 model_neutral_.num_tombstone_updates_downloaded_total += value;
43 }
44
45 void StatusController::increment_num_reflected_updates_downloaded_by(
46 int value) {
47 model_neutral_.num_reflected_updates_downloaded_total += value;
48 }
49
50 void StatusController::UpdateStartTime() {
51 sync_start_time_ = base::Time::Now();
52 }
53
54 void StatusController::UpdatePollTime() {
55 poll_finish_time_ = base::Time::Now();
56 }
57
58 void StatusController::set_num_successful_bookmark_commits(int value) {
59 model_neutral_.num_successful_bookmark_commits = value;
60 }
61
62 void StatusController::increment_num_successful_bookmark_commits() {
63 model_neutral_.num_successful_bookmark_commits++;
64 }
65
66 void StatusController::increment_num_successful_commits() {
67 model_neutral_.num_successful_commits++;
68 }
69
70 void StatusController::increment_num_updates_applied_by(int value) {
71 model_neutral_.num_updates_applied += value;
72 }
73
74 void StatusController::increment_num_encryption_conflicts_by(int value) {
75 model_neutral_.num_encryption_conflicts += value;
76 }
77
78 void StatusController::increment_num_hierarchy_conflicts_by(int value) {
79 model_neutral_.num_hierarchy_conflicts += value;
80 }
81
82 void StatusController::increment_num_server_conflicts() {
83 model_neutral_.num_server_conflicts++;
84 }
85
86 void StatusController::increment_num_local_overwrites() {
87 model_neutral_.num_local_overwrites++;
88 }
89
90 void StatusController::increment_num_server_overwrites() {
91 model_neutral_.num_server_overwrites++;
92 }
93
94 void StatusController::set_last_get_key_result(const SyncerError result) {
95 model_neutral_.last_get_key_result = result;
96 }
97
98 void StatusController::set_last_download_updates_result(
99 const SyncerError result) {
100 model_neutral_.last_download_updates_result = result;
101 }
102
103 void StatusController::set_commit_result(const SyncerError result) {
104 model_neutral_.commit_result = result;
105 }
106
107 SyncerError StatusController::last_get_key_result() const {
108 return model_neutral_.last_get_key_result;
109 }
110
111 int StatusController::num_updates_applied() const {
112 return model_neutral_.num_updates_applied;
113 }
114
115 int StatusController::num_server_overwrites() const {
116 return model_neutral_.num_server_overwrites;
117 }
118
119 int StatusController::num_local_overwrites() const {
120 return model_neutral_.num_local_overwrites;
121 }
122
123 int StatusController::num_encryption_conflicts() const {
124 return model_neutral_.num_encryption_conflicts;
125 }
126
127 int StatusController::num_hierarchy_conflicts() const {
128 return model_neutral_.num_hierarchy_conflicts;
129 }
130
131 int StatusController::num_server_conflicts() const {
132 return model_neutral_.num_server_conflicts;
133 }
134
135 int StatusController::TotalNumConflictingItems() const {
136 int sum = 0;
137 sum += num_encryption_conflicts();
138 sum += num_hierarchy_conflicts();
139 sum += num_server_conflicts();
140 return sum;
141 }
142
143 } // namespace sessions
144 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/sessions/status_controller.h ('k') | sync/sessions/status_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698