| 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 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 ConflictResolver::ConflictResolver(SyncEngineContext* sync_context) | 27 ConflictResolver::ConflictResolver(SyncEngineContext* sync_context) |
| 28 : sync_context_(sync_context), | 28 : sync_context_(sync_context), |
| 29 weak_ptr_factory_(this) {} | 29 weak_ptr_factory_(this) {} |
| 30 | 30 |
| 31 ConflictResolver::~ConflictResolver() {} | 31 ConflictResolver::~ConflictResolver() {} |
| 32 | 32 |
| 33 void ConflictResolver::RunPreflight(scoped_ptr<SyncTaskToken> token) { | 33 void ConflictResolver::RunPreflight(scoped_ptr<SyncTaskToken> token) { |
| 34 token->InitializeTaskLog("Conflict Resolution"); | 34 token->InitializeTaskLog("Conflict Resolution"); |
| 35 | 35 |
| 36 scoped_ptr<BlockingFactor> blocking_factor(new BlockingFactor); | 36 scoped_ptr<TaskBlocker> task_blocker(new TaskBlocker); |
| 37 blocking_factor->exclusive = true; | 37 task_blocker->exclusive = true; |
| 38 SyncTaskManager::UpdateBlockingFactor( | 38 SyncTaskManager::UpdateTaskBlocker( |
| 39 token.Pass(), blocking_factor.Pass(), | 39 token.Pass(), task_blocker.Pass(), |
| 40 base::Bind(&ConflictResolver::RunExclusive, | 40 base::Bind(&ConflictResolver::RunExclusive, |
| 41 weak_ptr_factory_.GetWeakPtr())); | 41 weak_ptr_factory_.GetWeakPtr())); |
| 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 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 set_used_network(true); | 318 set_used_network(true); |
| 319 return sync_context_->GetDriveService(); | 319 return sync_context_->GetDriveService(); |
| 320 } | 320 } |
| 321 | 321 |
| 322 MetadataDatabase* ConflictResolver::metadata_database() { | 322 MetadataDatabase* ConflictResolver::metadata_database() { |
| 323 return sync_context_->GetMetadataDatabase(); | 323 return sync_context_->GetMetadataDatabase(); |
| 324 } | 324 } |
| 325 | 325 |
| 326 } // namespace drive_backend | 326 } // namespace drive_backend |
| 327 } // namespace sync_file_system | 327 } // namespace sync_file_system |
| OLD | NEW |