| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "chrome/browser/sync/engine/model_changing_syncer_command.h" | 11 #include "chrome/browser/sync/engine/model_changing_syncer_command.h" |
| 12 #include "chrome/browser/sync/engine/syncer_session.h" | |
| 13 #include "chrome/browser/sync/engine/syncproto.h" | 12 #include "chrome/browser/sync/engine/syncproto.h" |
| 14 | 13 |
| 15 namespace syncable { | 14 namespace syncable { |
| 16 class Id; | 15 class Id; |
| 17 class WriteTransaction; | 16 class WriteTransaction; |
| 18 class MutableEntry; | 17 class MutableEntry; |
| 19 } | 18 } |
| 20 | 19 |
| 21 namespace browser_sync { | 20 namespace browser_sync { |
| 22 | 21 |
| 23 class ProcessCommitResponseCommand : public ModelChangingSyncerCommand { | 22 class ProcessCommitResponseCommand : public ModelChangingSyncerCommand { |
| 24 public: | 23 public: |
| 25 | 24 |
| 26 explicit ProcessCommitResponseCommand(ExtensionsActivityMonitor* monitor); | 25 ProcessCommitResponseCommand(); |
| 27 virtual ~ProcessCommitResponseCommand(); | 26 virtual ~ProcessCommitResponseCommand(); |
| 28 | 27 |
| 29 virtual void ModelChangingExecuteImpl(SyncerSession* session); | 28 // ModelChangingSyncerCommand implementation. |
| 29 virtual void ModelChangingExecuteImpl(sessions::SyncSession* session); |
| 30 |
| 30 private: | 31 private: |
| 31 CommitResponse::RESPONSE_TYPE ProcessSingleCommitResponse( | 32 CommitResponse::RESPONSE_TYPE ProcessSingleCommitResponse( |
| 32 syncable::WriteTransaction* trans, | 33 syncable::WriteTransaction* trans, |
| 33 const sync_pb::CommitResponse_EntryResponse& pb_server_entry, | 34 const sync_pb::CommitResponse_EntryResponse& pb_server_entry, |
| 34 const syncable::Id& pre_commit_id, std::set<syncable::Id>* | 35 const syncable::Id& pre_commit_id, std::set<syncable::Id>* |
| 35 conflicting_new_directory_ids, | 36 conflicting_new_directory_ids, |
| 36 std::set<syncable::Id>* deleted_folders, | 37 std::set<syncable::Id>* deleted_folders); |
| 37 SyncerSession* const session); | |
| 38 | 38 |
| 39 // Actually does the work of execute. | 39 // Actually does the work of execute. |
| 40 void ProcessCommitResponse(SyncerSession* session); | 40 void ProcessCommitResponse(sessions::SyncSession* session); |
| 41 | 41 |
| 42 void ProcessSuccessfulCommitResponse(syncable::WriteTransaction* trans, | 42 void ProcessSuccessfulCommitResponse(syncable::WriteTransaction* trans, |
| 43 const CommitResponse_EntryResponse& server_entry, | 43 const CommitResponse_EntryResponse& server_entry, |
| 44 const syncable::Id& pre_commit_id, syncable::MutableEntry* local_entry, | 44 const syncable::Id& pre_commit_id, syncable::MutableEntry* local_entry, |
| 45 bool syncing_was_set, std::set<syncable::Id>* deleted_folders, | 45 bool syncing_was_set, std::set<syncable::Id>* deleted_folders); |
| 46 SyncerSession* const session); | |
| 47 | 46 |
| 48 void PerformCommitTimeNameAside( | 47 void PerformCommitTimeNameAside( |
| 49 syncable::WriteTransaction* trans, | 48 syncable::WriteTransaction* trans, |
| 50 const CommitResponse_EntryResponse& server_entry, | 49 const CommitResponse_EntryResponse& server_entry, |
| 51 syncable::MutableEntry* local_entry); | 50 syncable::MutableEntry* local_entry); |
| 52 | 51 |
| 53 // We may need to update this with records from a commit attempt if the | |
| 54 // attempt failed. | |
| 55 ExtensionsActivityMonitor* extensions_monitor_; | |
| 56 | |
| 57 DISALLOW_COPY_AND_ASSIGN(ProcessCommitResponseCommand); | 52 DISALLOW_COPY_AND_ASSIGN(ProcessCommitResponseCommand); |
| 58 }; | 53 }; |
| 59 | 54 |
| 60 } // namespace browser_sync | 55 } // namespace browser_sync |
| 61 | 56 |
| 62 #endif // CHROME_BROWSER_SYNC_ENGINE_PROCESS_COMMIT_RESPONSE_COMMAND_H_ | 57 #endif // CHROME_BROWSER_SYNC_ENGINE_PROCESS_COMMIT_RESPONSE_COMMAND_H_ |
| OLD | NEW |