| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "sync/engine/process_commit_response_command.h" | 5 #include "sync/engine/process_commit_response_command.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/location.h" | 13 #include "base/location.h" |
| 14 #include "sync/engine/syncer_proto_util.h" | 14 #include "sync/engine/syncer_proto_util.h" |
| 15 #include "sync/engine/syncer_util.h" | 15 #include "sync/engine/syncer_util.h" |
| 16 #include "sync/engine/syncproto.h" | 16 #include "sync/engine/syncproto.h" |
| 17 #include "sync/sessions/sync_session.h" | 17 #include "sync/sessions/sync_session.h" |
| 18 #include "sync/syncable/entry.h" | 18 #include "sync/syncable/entry.h" |
| 19 #include "sync/syncable/mutable_entry.h" | 19 #include "sync/syncable/mutable_entry.h" |
| 20 #include "sync/syncable/read_transaction.h" | 20 #include "sync/syncable/read_transaction.h" |
| 21 #include "sync/syncable/syncable_util.h" | 21 #include "sync/syncable/syncable_util.h" |
| 22 #include "sync/syncable/write_transaction.h" | 22 #include "sync/syncable/write_transaction.h" |
| 23 #include "sync/util/time.h" | 23 #include "sync/util/time.h" |
| 24 | 24 |
| 25 using syncable::WriteTransaction; | |
| 26 using syncable::MutableEntry; | |
| 27 using syncable::Entry; | |
| 28 | |
| 29 using std::set; | 25 using std::set; |
| 30 using std::string; | 26 using std::string; |
| 31 using std::vector; | 27 using std::vector; |
| 32 | 28 |
| 29 namespace syncer { |
| 30 |
| 31 using sessions::OrderedCommitSet; |
| 32 using sessions::StatusController; |
| 33 using sessions::SyncSession; |
| 34 using sessions::ConflictProgress; |
| 35 using syncable::WriteTransaction; |
| 36 using syncable::MutableEntry; |
| 37 using syncable::Entry; |
| 33 using syncable::BASE_VERSION; | 38 using syncable::BASE_VERSION; |
| 34 using syncable::GET_BY_ID; | 39 using syncable::GET_BY_ID; |
| 35 using syncable::ID; | 40 using syncable::ID; |
| 36 using syncable::IS_DEL; | 41 using syncable::IS_DEL; |
| 37 using syncable::IS_DIR; | 42 using syncable::IS_DIR; |
| 38 using syncable::IS_UNAPPLIED_UPDATE; | 43 using syncable::IS_UNAPPLIED_UPDATE; |
| 39 using syncable::IS_UNSYNCED; | 44 using syncable::IS_UNSYNCED; |
| 40 using syncable::PARENT_ID; | 45 using syncable::PARENT_ID; |
| 41 using syncable::SERVER_IS_DEL; | 46 using syncable::SERVER_IS_DEL; |
| 42 using syncable::SERVER_PARENT_ID; | 47 using syncable::SERVER_PARENT_ID; |
| 43 using syncable::SERVER_POSITION_IN_PARENT; | 48 using syncable::SERVER_POSITION_IN_PARENT; |
| 44 using syncable::SERVER_VERSION; | 49 using syncable::SERVER_VERSION; |
| 45 using syncable::SYNCER; | 50 using syncable::SYNCER; |
| 46 using syncable::SYNCING; | 51 using syncable::SYNCING; |
| 47 | 52 |
| 48 namespace syncer { | |
| 49 | |
| 50 using sessions::OrderedCommitSet; | |
| 51 using sessions::StatusController; | |
| 52 using sessions::SyncSession; | |
| 53 using sessions::ConflictProgress; | |
| 54 | |
| 55 ProcessCommitResponseCommand::ProcessCommitResponseCommand( | 53 ProcessCommitResponseCommand::ProcessCommitResponseCommand( |
| 56 const sessions::OrderedCommitSet& commit_set, | 54 const sessions::OrderedCommitSet& commit_set, |
| 57 const ClientToServerMessage& commit_message, | 55 const ClientToServerMessage& commit_message, |
| 58 const ClientToServerResponse& commit_response) | 56 const ClientToServerResponse& commit_response) |
| 59 : commit_set_(commit_set), | 57 : commit_set_(commit_set), |
| 60 commit_message_(commit_message), | 58 commit_message_(commit_message), |
| 61 commit_response_(commit_response) { | 59 commit_response_(commit_response) { |
| 62 } | 60 } |
| 63 | 61 |
| 64 ProcessCommitResponseCommand::~ProcessCommitResponseCommand() {} | 62 ProcessCommitResponseCommand::~ProcessCommitResponseCommand() {} |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 // been recursively deleted. | 469 // been recursively deleted. |
| 472 // TODO(nick): Here, commit_message.deleted() would be more correct than | 470 // TODO(nick): Here, commit_message.deleted() would be more correct than |
| 473 // local_entry->Get(IS_DEL). For example, an item could be renamed, and then | 471 // local_entry->Get(IS_DEL). For example, an item could be renamed, and then |
| 474 // deleted during the commit of the rename. Unit test & fix. | 472 // deleted during the commit of the rename. Unit test & fix. |
| 475 if (local_entry->Get(IS_DIR) && local_entry->Get(IS_DEL)) { | 473 if (local_entry->Get(IS_DIR) && local_entry->Get(IS_DEL)) { |
| 476 deleted_folders->insert(local_entry->Get(ID)); | 474 deleted_folders->insert(local_entry->Get(ID)); |
| 477 } | 475 } |
| 478 } | 476 } |
| 479 | 477 |
| 480 } // namespace syncer | 478 } // namespace syncer |
| OLD | NEW |