| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 "chrome/browser/sync_file_system/drive_backend/conflict_resolver.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/conflict_resolver.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 | 43 |
| 44 void ConflictResolver::RunExclusive(scoped_ptr<SyncTaskToken> token) { | 44 void ConflictResolver::RunExclusive(scoped_ptr<SyncTaskToken> token) { |
| 45 if (!IsContextReady()) { | 45 if (!IsContextReady()) { |
| 46 SyncTaskManager::NotifyTaskDone(token.Pass(), SYNC_STATUS_FAILED); | 46 SyncTaskManager::NotifyTaskDone(token.Pass(), SYNC_STATUS_FAILED); |
| 47 return; | 47 return; |
| 48 } | 48 } |
| 49 | 49 |
| 50 // Conflict resolution should be invoked on clean tree. | 50 // Conflict resolution should be invoked on clean tree. |
| 51 if (metadata_database()->HasDirtyTracker()) { | 51 if (metadata_database()->HasDirtyTracker()) { |
| 52 NOTREACHED(); | 52 SyncTaskManager::NotifyTaskDone(token.Pass(), SYNC_STATUS_RETRY); |
| 53 SyncTaskManager::NotifyTaskDone(token.Pass(), SYNC_STATUS_FAILED); | |
| 54 return; | 53 return; |
| 55 } | 54 } |
| 56 | 55 |
| 57 TrackerIDSet trackers; | 56 TrackerIDSet trackers; |
| 58 if (metadata_database()->GetMultiParentFileTrackers( | 57 if (metadata_database()->GetMultiParentFileTrackers( |
| 59 &target_file_id_, &trackers)) { | 58 &target_file_id_, &trackers)) { |
| 60 DCHECK_LT(1u, trackers.size()); | 59 DCHECK_LT(1u, trackers.size()); |
| 61 if (!trackers.has_active()) { | 60 if (!trackers.has_active()) { |
| 62 NOTREACHED(); | 61 NOTREACHED(); |
| 63 SyncTaskManager::NotifyTaskDone(token.Pass(), SYNC_STATUS_FAILED); | 62 SyncTaskManager::NotifyTaskDone(token.Pass(), SYNC_STATUS_FAILED); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 set_used_network(true); | 318 set_used_network(true); |
| 320 return sync_context_->GetDriveService(); | 319 return sync_context_->GetDriveService(); |
| 321 } | 320 } |
| 322 | 321 |
| 323 MetadataDatabase* ConflictResolver::metadata_database() { | 322 MetadataDatabase* ConflictResolver::metadata_database() { |
| 324 return sync_context_->GetMetadataDatabase(); | 323 return sync_context_->GetMetadataDatabase(); |
| 325 } | 324 } |
| 326 | 325 |
| 327 } // namespace drive_backend | 326 } // namespace drive_backend |
| 328 } // namespace sync_file_system | 327 } // namespace sync_file_system |
| OLD | NEW |