OLD | NEW |
| (Empty) |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef SYNC_ENGINE_COMMIT_UTIL_H_ | |
6 #define SYNC_ENGINE_COMMIT_UTIL_H_ | |
7 | |
8 #include <stdint.h> | |
9 | |
10 #include <set> | |
11 | |
12 #include "sync/base/sync_export.h" | |
13 #include "sync/internal_api/public/base/model_type.h" | |
14 #include "sync/protocol/sync.pb.h" | |
15 #include "sync/util/extensions_activity.h" | |
16 | |
17 namespace sync_pb { | |
18 class CommitMessage; | |
19 class SyncEntity; | |
20 } | |
21 | |
22 namespace syncer { | |
23 | |
24 namespace syncable { | |
25 class BaseTransaction; | |
26 class Entry; | |
27 class Id; | |
28 class BaseWriteTransaction; | |
29 } | |
30 | |
31 namespace commit_util { | |
32 | |
33 // Adds bookmark extensions activity report to |message|. | |
34 SYNC_EXPORT void AddExtensionsActivityToMessage( | |
35 ExtensionsActivity* activity, | |
36 ExtensionsActivity::Records* extensions_activity_buffer, | |
37 sync_pb::CommitMessage* message); | |
38 | |
39 // Fills the config_params field of |message|. | |
40 SYNC_EXPORT void AddClientConfigParamsToMessage( | |
41 ModelTypeSet enabled_types, | |
42 bool cookie_jar_mismatch, | |
43 sync_pb::CommitMessage* message); | |
44 | |
45 // Takes a snapshot of |meta_entry| and puts it into a protobuf suitable for use | |
46 // in a commit request message. | |
47 SYNC_EXPORT void BuildCommitItem(const syncable::Entry& meta_entry, | |
48 sync_pb::SyncEntity* sync_entry); | |
49 | |
50 // Process a single commit response. Updates the entry's SERVER fields using | |
51 // |pb_commit_response| and |pb_committed_entry|. | |
52 // | |
53 // The |deleted_folders| parameter is a set of IDs that represent deleted | |
54 // folders. This function will add its entry's ID to this set if it finds | |
55 // itself processing a folder deletion. | |
56 SYNC_EXPORT | |
57 sync_pb::CommitResponse::ResponseType ProcessSingleCommitResponse( | |
58 syncable::BaseWriteTransaction* trans, | |
59 const sync_pb::CommitResponse_EntryResponse& server_entry, | |
60 const sync_pb::SyncEntity& commit_request_entry, | |
61 int64_t metahandle, | |
62 std::set<syncable::Id>* deleted_folders); | |
63 | |
64 } // namespace commit_util | |
65 | |
66 } // namespace syncer | |
67 | |
68 #endif // SYNC_ENGINE_COMMIT_UTIL_H_ | |
OLD | NEW |