Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / sync / api / sync_merge_result.cc
blob601c5777ceb9751b5d0d9486dab913f35f5c7fd2
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.
5 #include "sync/api/sync_merge_result.h"
7 namespace syncer {
9 SyncMergeResult::SyncMergeResult(ModelType type)
10 : model_type_(type),
11 num_items_before_association_(0),
12 num_items_after_association_(0),
13 num_items_added_(0),
14 num_items_deleted_(0),
15 num_items_modified_(0),
16 pre_association_version_(0) {
19 SyncMergeResult::~SyncMergeResult() {
22 // Setters.
23 void SyncMergeResult::set_error(SyncError error) {
24 DCHECK(!error.IsSet() || model_type_ == error.model_type());
25 error_ = error;
28 void SyncMergeResult::set_num_items_before_association(
29 int num_items_before_association) {
30 num_items_before_association_ = num_items_before_association;
33 void SyncMergeResult::set_num_items_after_association(
34 int num_items_after_association) {
35 num_items_after_association_ = num_items_after_association;
38 void SyncMergeResult::set_num_items_added(int num_items_added) {
39 num_items_added_ = num_items_added;
42 void SyncMergeResult::set_num_items_deleted(int num_items_deleted) {
43 num_items_deleted_ = num_items_deleted;
46 void SyncMergeResult::set_num_items_modified(int num_items_modified) {
47 num_items_modified_ = num_items_modified;
50 void SyncMergeResult::set_pre_association_version(int64 version) {
51 pre_association_version_ = version;
54 ModelType SyncMergeResult::model_type() const {
55 return model_type_;
58 SyncError SyncMergeResult::error() const {
59 return error_;
62 int SyncMergeResult::num_items_before_association() const {
63 return num_items_before_association_;
66 int SyncMergeResult::num_items_after_association() const {
67 return num_items_after_association_;
70 int SyncMergeResult::num_items_added() const {
71 return num_items_added_;
74 int SyncMergeResult::num_items_deleted() const {
75 return num_items_deleted_;
78 int SyncMergeResult::num_items_modified() const {
79 return num_items_modified_;
82 int64 SyncMergeResult::pre_association_version() const {
83 return pre_association_version_;
86 } // namespace syncer