OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_SYNC_ENGINE_PROCESS_COMMIT_RESPONSE_COMMAND_H_ | 5 #ifndef CHROME_BROWSER_SYNC_ENGINE_PROCESS_COMMIT_RESPONSE_COMMAND_H_ |
6 #define CHROME_BROWSER_SYNC_ENGINE_PROCESS_COMMIT_RESPONSE_COMMAND_H_ | 6 #define CHROME_BROWSER_SYNC_ENGINE_PROCESS_COMMIT_RESPONSE_COMMAND_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 14 matching lines...) Expand all Loading... |
25 class ProcessCommitResponseCommand : public ModelChangingSyncerCommand { | 25 class ProcessCommitResponseCommand : public ModelChangingSyncerCommand { |
26 public: | 26 public: |
27 | 27 |
28 ProcessCommitResponseCommand(); | 28 ProcessCommitResponseCommand(); |
29 virtual ~ProcessCommitResponseCommand(); | 29 virtual ~ProcessCommitResponseCommand(); |
30 | 30 |
31 protected: | 31 protected: |
32 // ModelChangingSyncerCommand implementation. | 32 // ModelChangingSyncerCommand implementation. |
33 virtual std::set<ModelSafeGroup> GetGroupsToChange( | 33 virtual std::set<ModelSafeGroup> GetGroupsToChange( |
34 const sessions::SyncSession& session) const OVERRIDE; | 34 const sessions::SyncSession& session) const OVERRIDE; |
35 virtual bool ModelNeutralExecuteImpl( | 35 virtual SyncerError ModelNeutralExecuteImpl( |
36 sessions::SyncSession* session) OVERRIDE; | 36 sessions::SyncSession* session) OVERRIDE; |
37 virtual void ModelChangingExecuteImpl( | 37 virtual SyncerError ModelChangingExecuteImpl( |
38 sessions::SyncSession* session) OVERRIDE; | 38 sessions::SyncSession* session) OVERRIDE; |
39 | 39 |
40 private: | 40 private: |
41 CommitResponse::ResponseType ProcessSingleCommitResponse( | 41 CommitResponse::ResponseType ProcessSingleCommitResponse( |
42 syncable::WriteTransaction* trans, | 42 syncable::WriteTransaction* trans, |
43 const sync_pb::CommitResponse_EntryResponse& pb_commit_response, | 43 const sync_pb::CommitResponse_EntryResponse& pb_commit_response, |
44 const sync_pb::SyncEntity& pb_committed_entry, | 44 const sync_pb::SyncEntity& pb_committed_entry, |
45 const syncable::Id& pre_commit_id, | 45 const syncable::Id& pre_commit_id, |
46 std::set<syncable::Id>* conflicting_new_directory_ids, | 46 std::set<syncable::Id>* conflicting_new_directory_ids, |
47 std::set<syncable::Id>* deleted_folders); | 47 std::set<syncable::Id>* deleted_folders); |
48 | 48 |
49 // Actually does the work of execute. | 49 // Actually does the work of execute. |
50 void ProcessCommitResponse(sessions::SyncSession* session); | 50 SyncerError ProcessCommitResponse(sessions::SyncSession* session); |
51 | 51 |
52 void ProcessSuccessfulCommitResponse( | 52 void ProcessSuccessfulCommitResponse( |
53 const sync_pb::SyncEntity& committed_entry, | 53 const sync_pb::SyncEntity& committed_entry, |
54 const CommitResponse_EntryResponse& entry_response, | 54 const CommitResponse_EntryResponse& entry_response, |
55 const syncable::Id& pre_commit_id, syncable::MutableEntry* local_entry, | 55 const syncable::Id& pre_commit_id, syncable::MutableEntry* local_entry, |
56 bool syncing_was_set, std::set<syncable::Id>* deleted_folders); | 56 bool syncing_was_set, std::set<syncable::Id>* deleted_folders); |
57 | 57 |
58 // Update the BASE_VERSION and SERVER_VERSION, post-commit. | 58 // Update the BASE_VERSION and SERVER_VERSION, post-commit. |
59 // Helper for ProcessSuccessfulCommitResponse. | 59 // Helper for ProcessSuccessfulCommitResponse. |
60 bool UpdateVersionAfterCommit( | 60 bool UpdateVersionAfterCommit( |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 const std::string& GetResultingPostCommitName( | 92 const std::string& GetResultingPostCommitName( |
93 const sync_pb::SyncEntity& committed_entry, | 93 const sync_pb::SyncEntity& committed_entry, |
94 const CommitResponse_EntryResponse& entry_response); | 94 const CommitResponse_EntryResponse& entry_response); |
95 | 95 |
96 DISALLOW_COPY_AND_ASSIGN(ProcessCommitResponseCommand); | 96 DISALLOW_COPY_AND_ASSIGN(ProcessCommitResponseCommand); |
97 }; | 97 }; |
98 | 98 |
99 } // namespace browser_sync | 99 } // namespace browser_sync |
100 | 100 |
101 #endif // CHROME_BROWSER_SYNC_ENGINE_PROCESS_COMMIT_RESPONSE_COMMAND_H_ | 101 #endif // CHROME_BROWSER_SYNC_ENGINE_PROCESS_COMMIT_RESPONSE_COMMAND_H_ |
OLD | NEW |