| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/sync_task_manager.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/sync_task_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
| 11 #include "chrome/browser/sync_file_system/drive_backend/sync_task.h" | 11 #include "chrome/browser/sync_file_system/drive_backend/sync_task.h" |
| 12 #include "chrome/browser/sync_file_system/drive_backend/sync_task_token.h" | 12 #include "chrome/browser/sync_file_system/drive_backend/sync_task_token.h" |
| 13 #include "chrome/browser/sync_file_system/sync_file_metadata.h" | 13 #include "chrome/browser/sync_file_system/sync_file_metadata.h" |
| 14 | 14 |
| 15 using storage::FileSystemURL; | 15 using storage::FileSystemURL; |
| 16 | 16 |
| 17 namespace sync_file_system { | 17 namespace sync_file_system { |
| 18 namespace drive_backend { | 18 namespace drive_backend { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 class SyncTaskAdapter : public ExclusiveTask { | 22 class SyncTaskAdapter : public ExclusiveTask { |
| 23 public: | 23 public: |
| 24 explicit SyncTaskAdapter(const SyncTaskManager::Task& task) : task_(task) {} | 24 explicit SyncTaskAdapter(const SyncTaskManager::Task& task) : task_(task) {} |
| 25 virtual ~SyncTaskAdapter() {} | 25 ~SyncTaskAdapter() override {} |
| 26 | 26 |
| 27 virtual void RunExclusive(const SyncStatusCallback& callback) override { | 27 void RunExclusive(const SyncStatusCallback& callback) override { |
| 28 task_.Run(callback); | 28 task_.Run(callback); |
| 29 } | 29 } |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 SyncTaskManager::Task task_; | 32 SyncTaskManager::Task task_; |
| 33 | 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(SyncTaskAdapter); | 34 DISALLOW_COPY_AND_ASSIGN(SyncTaskAdapter); |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 } // namespace | 37 } // namespace |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 closure.Run(); | 399 closure.Run(); |
| 400 return; | 400 return; |
| 401 } | 401 } |
| 402 | 402 |
| 403 if (client_) | 403 if (client_) |
| 404 client_->MaybeScheduleNextTask(); | 404 client_->MaybeScheduleNextTask(); |
| 405 } | 405 } |
| 406 | 406 |
| 407 } // namespace drive_backend | 407 } // namespace drive_backend |
| 408 } // namespace sync_file_system | 408 } // namespace sync_file_system |
| OLD | NEW |