OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef SYNC_API_SYNC_CHANGE_H_ | 5 #ifndef SYNC_API_SYNC_CHANGE_H_ |
6 #define SYNC_API_SYNC_CHANGE_H_ | 6 #define SYNC_API_SYNC_CHANGE_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/location.h" | 12 #include "base/location.h" |
13 #include "sync/api/sync_data.h" | 13 #include "sync/api/sync_data.h" |
| 14 #include "sync/base/sync_export.h" |
14 | 15 |
15 namespace syncer { | 16 namespace syncer { |
16 | 17 |
17 // A SyncChange object reflects a change to a piece of synced data. The change | 18 // A SyncChange object reflects a change to a piece of synced data. The change |
18 // can be either a delete, add, or an update. All data relevant to the change | 19 // can be either a delete, add, or an update. All data relevant to the change |
19 // is encapsulated within the SyncChange, which, once created, is immutable. | 20 // is encapsulated within the SyncChange, which, once created, is immutable. |
20 // Note: it is safe and cheap to pass these by value or make copies, as they do | 21 // Note: it is safe and cheap to pass these by value or make copies, as they do |
21 // not create deep copies of their internal data. | 22 // not create deep copies of their internal data. |
22 class SyncChange { | 23 class SYNC_EXPORT SyncChange { |
23 public: | 24 public: |
24 enum SyncChangeType { | 25 enum SyncChangeType { |
25 ACTION_INVALID, | 26 ACTION_INVALID, |
26 ACTION_ADD, | 27 ACTION_ADD, |
27 ACTION_UPDATE, | 28 ACTION_UPDATE, |
28 ACTION_DELETE | 29 ACTION_DELETE |
29 }; | 30 }; |
30 | 31 |
31 // Default constructor creates an invalid change. | 32 // Default constructor creates an invalid change. |
32 SyncChange(); | 33 SyncChange(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // SyncChanges are copied, they copy references to this data. | 69 // SyncChanges are copied, they copy references to this data. |
69 SyncData sync_data_; | 70 SyncData sync_data_; |
70 }; | 71 }; |
71 | 72 |
72 // gmock printer helper. | 73 // gmock printer helper. |
73 void PrintTo(const SyncChange& sync_change, std::ostream* os); | 74 void PrintTo(const SyncChange& sync_change, std::ostream* os); |
74 | 75 |
75 } // namespace syncer | 76 } // namespace syncer |
76 | 77 |
77 #endif // SYNC_API_SYNC_CHANGE_H_ | 78 #endif // SYNC_API_SYNC_CHANGE_H_ |
OLD | NEW |