OLD | NEW |
1 // Copyright 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_INTERNAL_PUBLIC_API_CHANGE_RECORD_H_ | 5 #ifndef SYNC_INTERNAL_PUBLIC_API_CHANGE_RECORD_H_ |
6 #define SYNC_INTERNAL_PUBLIC_API_CHANGE_RECORD_H_ | 6 #define SYNC_INTERNAL_PUBLIC_API_CHANGE_RECORD_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 const sync_pb::PasswordSpecificsData& unencrypted() const; | 35 const sync_pb::PasswordSpecificsData& unencrypted() const; |
36 private: | 36 private: |
37 sync_pb::PasswordSpecificsData unencrypted_; | 37 sync_pb::PasswordSpecificsData unencrypted_; |
38 }; | 38 }; |
39 | 39 |
40 // ChangeRecord indicates a single item that changed as a result of a sync | 40 // ChangeRecord indicates a single item that changed as a result of a sync |
41 // operation. This gives the sync id of the node that changed, and the type | 41 // operation. This gives the sync id of the node that changed, and the type |
42 // of change. To get the actual property values after an ADD or UPDATE, the | 42 // of change. To get the actual property values after an ADD or UPDATE, the |
43 // client should get the node with InitByIdLookup(), using the provided id. | 43 // client should get the node with InitByIdLookup(), using the provided id. |
44 struct ChangeRecord { | 44 struct SYNC_EXPORT_PRIVATE ChangeRecord { |
45 enum Action { | 45 enum Action { |
46 ACTION_ADD, | 46 ACTION_ADD, |
47 ACTION_DELETE, | 47 ACTION_DELETE, |
48 ACTION_UPDATE, | 48 ACTION_UPDATE, |
49 }; | 49 }; |
50 ChangeRecord(); | 50 ChangeRecord(); |
51 ~ChangeRecord(); | 51 ~ChangeRecord(); |
52 | 52 |
53 // Transfers ownership of the DictionaryValue to the caller. | 53 // Transfers ownership of the DictionaryValue to the caller. |
54 base::DictionaryValue* ToValue() const; | 54 base::DictionaryValue* ToValue() const; |
55 | 55 |
56 int64 id; | 56 int64 id; |
57 Action action; | 57 Action action; |
58 sync_pb::EntitySpecifics specifics; | 58 sync_pb::EntitySpecifics specifics; |
59 linked_ptr<ExtraPasswordChangeRecordData> extra; | 59 linked_ptr<ExtraPasswordChangeRecordData> extra; |
60 }; | 60 }; |
61 | 61 |
62 typedef std::vector<ChangeRecord> ChangeRecordList; | 62 typedef std::vector<ChangeRecord> ChangeRecordList; |
63 | 63 |
64 typedef Immutable<ChangeRecordList> ImmutableChangeRecordList; | 64 typedef Immutable<ChangeRecordList> ImmutableChangeRecordList; |
65 | 65 |
66 } // namespace syncer | 66 } // namespace syncer |
67 | 67 |
68 #endif // SYNC_INTERNAL_API_PUBLIC_CHANGE_RECORD_H_ | 68 #endif // SYNC_INTERNAL_API_PUBLIC_CHANGE_RECORD_H_ |
OLD | NEW |