OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_API_PUBLIC_NON_BLOCKING_SYNC_COMMON_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_NON_BLOCKING_SYNC_COMMON_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_NON_BLOCKING_SYNC_COMMON_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_NON_BLOCKING_SYNC_COMMON_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 // be data-type specific. Many data types ignore it. | 31 // be data-type specific. Many data types ignore it. |
32 sync_pb::DataTypeContext type_context; | 32 sync_pb::DataTypeContext type_context; |
33 | 33 |
34 // The ID of the folder node that sits at the top of this type's folder | 34 // The ID of the folder node that sits at the top of this type's folder |
35 // hierarchy. We keep this around for legacy reasons. The protocol expects | 35 // hierarchy. We keep this around for legacy reasons. The protocol expects |
36 // that all nodes of a certain type are children of the same type root | 36 // that all nodes of a certain type are children of the same type root |
37 // entity. This entity is delivered by the server, and may not be available | 37 // entity. This entity is delivered by the server, and may not be available |
38 // until the first download cycle has completed. | 38 // until the first download cycle has completed. |
39 std::string type_root_id; | 39 std::string type_root_id; |
40 | 40 |
41 // This value is set if this type's data should be encrypted on the server. | |
42 // If this key changes, the client will need to re-commit all of its local | |
43 // data to the server using the new encryption key. | |
44 std::string encryption_key_name; | |
45 | |
46 // A strictly increasing counter used to generate unique values for the | 41 // A strictly increasing counter used to generate unique values for the |
47 // client-assigned IDs. The incrementing and ID assignment happens on the | 42 // client-assigned IDs. The incrementing and ID assignment happens on the |
48 // sync thread, but we store the value here so we can pass it back to the | 43 // sync thread, but we store the value here so we can pass it back to the |
49 // model thread for persistence. This is probably unnecessary for the | 44 // model thread for persistence. This is probably unnecessary for the |
50 // client-tagged data types supported by non-blocking sync, but we will | 45 // client-tagged data types supported by non-blocking sync, but we will |
51 // continue to emulate the directory sync's behavior for now. | 46 // continue to emulate the directory sync's behavior for now. |
52 int64 next_client_id; | 47 int64 next_client_id; |
53 | 48 |
54 // This flag is set to true when the first download cycle is complete. The | 49 // This flag is set to true when the first download cycle is complete. The |
55 // ModelTypeSyncProxy should not attempt to commit any items until this | 50 // ModelTypeSyncProxy should not attempt to commit any items until this |
56 // flag is set. | 51 // flag is set. |
57 bool initial_sync_done; | 52 bool initial_sync_done; |
58 }; | 53 }; |
| 54 |
59 struct SYNC_EXPORT_PRIVATE CommitRequestData { | 55 struct SYNC_EXPORT_PRIVATE CommitRequestData { |
60 CommitRequestData(); | 56 CommitRequestData(); |
61 ~CommitRequestData(); | 57 ~CommitRequestData(); |
62 | 58 |
63 std::string id; | 59 std::string id; |
64 std::string client_tag_hash; | 60 std::string client_tag_hash; |
65 | 61 |
66 // Strictly incrementing number for in-progress commits. More information | 62 // Strictly incrementing number for in-progress commits. More information |
67 // about its meaning can be found in comments in the files that make use of | 63 // about its meaning can be found in comments in the files that make use of |
68 // this struct. | 64 // this struct. |
(...skipping 22 matching lines...) Expand all Loading... |
91 ~UpdateResponseData(); | 87 ~UpdateResponseData(); |
92 | 88 |
93 std::string id; | 89 std::string id; |
94 std::string client_tag_hash; | 90 std::string client_tag_hash; |
95 int64 response_version; | 91 int64 response_version; |
96 base::Time ctime; | 92 base::Time ctime; |
97 base::Time mtime; | 93 base::Time mtime; |
98 std::string non_unique_name; | 94 std::string non_unique_name; |
99 bool deleted; | 95 bool deleted; |
100 sync_pb::EntitySpecifics specifics; | 96 sync_pb::EntitySpecifics specifics; |
101 std::string encryption_key_name; | |
102 }; | 97 }; |
103 | 98 |
104 typedef std::vector<CommitRequestData> CommitRequestDataList; | 99 typedef std::vector<CommitRequestData> CommitRequestDataList; |
105 typedef std::vector<CommitResponseData> CommitResponseDataList; | 100 typedef std::vector<CommitResponseData> CommitResponseDataList; |
106 typedef std::vector<UpdateResponseData> UpdateResponseDataList; | 101 typedef std::vector<UpdateResponseData> UpdateResponseDataList; |
107 | 102 |
108 } // namespace syncer | 103 } // namespace syncer |
109 | 104 |
110 #endif // SYNC_INTERNAL_API_PUBLIC_NON_BLOCKING_SYNC_COMMON_H_ | 105 #endif // SYNC_INTERNAL_API_PUBLIC_NON_BLOCKING_SYNC_COMMON_H_ |
OLD | NEW |