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 COMPONENTS_SYNC_CORE_NON_BLOCKING_SYNC_COMMON_H_ | 5 #ifndef COMPONENTS_SYNC_CORE_NON_BLOCKING_SYNC_COMMON_H_ |
6 #define COMPONENTS_SYNC_CORE_NON_BLOCKING_SYNC_COMMON_H_ | 6 #define COMPONENTS_SYNC_CORE_NON_BLOCKING_SYNC_COMMON_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "components/sync/api/entity_data.h" | 14 #include "components/sync/api/entity_data.h" |
15 #include "components/sync/base/sync_export.h" | |
16 #include "components/sync/protocol/sync.pb.h" | 15 #include "components/sync/protocol/sync.pb.h" |
17 | 16 |
18 namespace syncer_v2 { | 17 namespace syncer_v2 { |
19 | 18 |
20 static const int64_t kUncommittedVersion = -1; | 19 static const int64_t kUncommittedVersion = -1; |
21 | 20 |
22 struct SYNC_EXPORT CommitRequestData { | 21 struct CommitRequestData { |
23 CommitRequestData(); | 22 CommitRequestData(); |
24 CommitRequestData(const CommitRequestData& other); | 23 CommitRequestData(const CommitRequestData& other); |
25 ~CommitRequestData(); | 24 ~CommitRequestData(); |
26 | 25 |
27 EntityDataPtr entity; | 26 EntityDataPtr entity; |
28 | 27 |
29 // Strictly incrementing number for in-progress commits. More information | 28 // Strictly incrementing number for in-progress commits. More information |
30 // about its meaning can be found in comments in the files that make use of | 29 // about its meaning can be found in comments in the files that make use of |
31 // this struct. | 30 // this struct. |
32 int64_t sequence_number = 0; | 31 int64_t sequence_number = 0; |
33 int64_t base_version = 0; | 32 int64_t base_version = 0; |
34 std::string specifics_hash; | 33 std::string specifics_hash; |
35 }; | 34 }; |
36 | 35 |
37 struct SYNC_EXPORT CommitResponseData { | 36 struct CommitResponseData { |
38 CommitResponseData(); | 37 CommitResponseData(); |
39 CommitResponseData(const CommitResponseData& other); | 38 CommitResponseData(const CommitResponseData& other); |
40 ~CommitResponseData(); | 39 ~CommitResponseData(); |
41 | 40 |
42 std::string id; | 41 std::string id; |
43 std::string client_tag_hash; | 42 std::string client_tag_hash; |
44 int64_t sequence_number = 0; | 43 int64_t sequence_number = 0; |
45 int64_t response_version = 0; | 44 int64_t response_version = 0; |
46 std::string specifics_hash; | 45 std::string specifics_hash; |
47 }; | 46 }; |
48 | 47 |
49 struct SYNC_EXPORT UpdateResponseData { | 48 struct UpdateResponseData { |
50 UpdateResponseData(); | 49 UpdateResponseData(); |
51 UpdateResponseData(const UpdateResponseData& other); | 50 UpdateResponseData(const UpdateResponseData& other); |
52 ~UpdateResponseData(); | 51 ~UpdateResponseData(); |
53 | 52 |
54 EntityDataPtr entity; | 53 EntityDataPtr entity; |
55 | 54 |
56 int64_t response_version = 0; | 55 int64_t response_version = 0; |
57 std::string encryption_key_name; | 56 std::string encryption_key_name; |
58 }; | 57 }; |
59 | 58 |
60 typedef std::vector<CommitRequestData> CommitRequestDataList; | 59 typedef std::vector<CommitRequestData> CommitRequestDataList; |
61 typedef std::vector<CommitResponseData> CommitResponseDataList; | 60 typedef std::vector<CommitResponseData> CommitResponseDataList; |
62 typedef std::vector<UpdateResponseData> UpdateResponseDataList; | 61 typedef std::vector<UpdateResponseData> UpdateResponseDataList; |
63 | 62 |
64 } // namespace syncer_v2 | 63 } // namespace syncer_v2 |
65 | 64 |
66 #endif // COMPONENTS_SYNC_CORE_NON_BLOCKING_SYNC_COMMON_H_ | 65 #endif // COMPONENTS_SYNC_CORE_NON_BLOCKING_SYNC_COMMON_H_ |
OLD | NEW |