OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/api/sync_merge_result.h" | 5 #include "sync/api/sync_merge_result.h" |
6 | 6 |
7 namespace syncer { | 7 namespace syncer { |
8 | 8 |
9 SyncMergeResult::SyncMergeResult(ModelType type) | 9 SyncMergeResult::SyncMergeResult(ModelType type) |
10 : model_type_(type), | 10 : model_type_(type), |
11 num_items_before_association_(0), | 11 num_items_before_association_(0), |
12 num_items_after_association_(0), | 12 num_items_after_association_(0), |
13 num_items_added_(0), | 13 num_items_added_(0), |
14 num_items_deleted_(0), | 14 num_items_deleted_(0), |
15 num_items_modified_(0) { | 15 num_items_modified_(0) { |
16 } | 16 } |
17 | 17 |
18 SyncMergeResult::~SyncMergeResult() { | 18 SyncMergeResult::~SyncMergeResult() { |
19 } | 19 } |
20 | 20 |
21 // Setters. | 21 // Setters. |
22 void SyncMergeResult::set_error(SyncError error) { | 22 void SyncMergeResult::set_error(SyncError error) { |
23 DCHECK(!error.IsSet() || model_type_ == error.type()); | 23 DCHECK(!error.IsSet() || model_type_ == error.model_type()); |
24 error_ = error; | 24 error_ = error; |
25 } | 25 } |
26 | 26 |
27 void SyncMergeResult::set_num_items_before_association( | 27 void SyncMergeResult::set_num_items_before_association( |
28 int num_items_before_association) { | 28 int num_items_before_association) { |
29 num_items_before_association_ = num_items_before_association; | 29 num_items_before_association_ = num_items_before_association; |
30 } | 30 } |
31 | 31 |
32 void SyncMergeResult::set_num_items_after_association( | 32 void SyncMergeResult::set_num_items_after_association( |
33 int num_items_after_association) { | 33 int num_items_after_association) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 int SyncMergeResult::num_items_deleted() const { | 69 int SyncMergeResult::num_items_deleted() const { |
70 return num_items_deleted_; | 70 return num_items_deleted_; |
71 } | 71 } |
72 | 72 |
73 int SyncMergeResult::num_items_modified() const { | 73 int SyncMergeResult::num_items_modified() const { |
74 return num_items_modified_; | 74 return num_items_modified_; |
75 } | 75 } |
76 | 76 |
77 } // namespace syncer | 77 } // namespace syncer |
OLD | NEW |