• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/api/sync_merge_result.h"
6 
7 namespace syncer {
8 
SyncMergeResult(ModelType type)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) {
17 }
18 
~SyncMergeResult()19 SyncMergeResult::~SyncMergeResult() {
20 }
21 
22 // Setters.
set_error(SyncError error)23 void SyncMergeResult::set_error(SyncError error) {
24   DCHECK(!error.IsSet() || model_type_ == error.model_type());
25   error_ = error;
26 }
27 
set_num_items_before_association(int num_items_before_association)28 void SyncMergeResult::set_num_items_before_association(
29     int  num_items_before_association) {
30   num_items_before_association_ = num_items_before_association;
31 }
32 
set_num_items_after_association(int num_items_after_association)33 void SyncMergeResult::set_num_items_after_association(
34     int num_items_after_association) {
35   num_items_after_association_ = num_items_after_association;
36 }
37 
set_num_items_added(int num_items_added)38 void SyncMergeResult::set_num_items_added(int num_items_added) {
39   num_items_added_ = num_items_added;
40 }
41 
set_num_items_deleted(int num_items_deleted)42 void SyncMergeResult::set_num_items_deleted(int num_items_deleted) {
43   num_items_deleted_ = num_items_deleted;
44 }
45 
set_num_items_modified(int num_items_modified)46 void SyncMergeResult::set_num_items_modified(int num_items_modified) {
47   num_items_modified_ = num_items_modified;
48 }
49 
set_pre_association_version(int64 version)50 void SyncMergeResult::set_pre_association_version(int64 version) {
51   pre_association_version_ = version;
52 }
53 
model_type() const54 ModelType SyncMergeResult::model_type() const {
55   return model_type_;
56 }
57 
error() const58 SyncError SyncMergeResult::error() const {
59   return error_;
60 }
61 
num_items_before_association() const62 int SyncMergeResult::num_items_before_association() const {
63   return num_items_before_association_;
64 }
65 
num_items_after_association() const66 int SyncMergeResult::num_items_after_association() const {
67   return num_items_after_association_;
68 }
69 
num_items_added() const70 int SyncMergeResult::num_items_added() const {
71   return num_items_added_;
72 }
73 
num_items_deleted() const74 int SyncMergeResult::num_items_deleted() const {
75   return num_items_deleted_;
76 }
77 
num_items_modified() const78 int SyncMergeResult::num_items_modified() const {
79   return num_items_modified_;
80 }
81 
pre_association_version() const82 int64 SyncMergeResult::pre_association_version() const {
83   return pre_association_version_;
84 }
85 
86 }  // namespace syncer
87