| 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 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_MANAGER_H_ |
| 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_MANAGER_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_MANAGER_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/containers/scoped_ptr_hash_map.h" | 12 #include "base/containers/scoped_ptr_hash_map.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/location.h" | 14 #include "base/location.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/threading/non_thread_safe.h" | 17 #include "base/threading/non_thread_safe.h" |
| 18 #include "chrome/browser/sync_file_system/drive_backend/sync_task.h" | 18 #include "chrome/browser/sync_file_system/drive_backend/sync_task.h" |
| 19 #include "chrome/browser/sync_file_system/drive_backend/task_dependency_manager.
h" | 19 #include "chrome/browser/sync_file_system/drive_backend/task_dependency_manager.
h" |
| 20 #include "chrome/browser/sync_file_system/sync_callbacks.h" | 20 #include "chrome/browser/sync_file_system/sync_callbacks.h" |
| 21 #include "chrome/browser/sync_file_system/sync_status_code.h" | 21 #include "chrome/browser/sync_file_system/sync_status_code.h" |
| 22 #include "chrome/browser/sync_file_system/task_logger.h" |
| 22 | 23 |
| 23 namespace tracked_objects { | 24 namespace tracked_objects { |
| 24 class Location; | 25 class Location; |
| 25 } | 26 } |
| 26 | 27 |
| 27 namespace sync_file_system { | 28 namespace sync_file_system { |
| 28 namespace drive_backend { | 29 namespace drive_backend { |
| 29 | 30 |
| 30 class SyncTaskToken; | 31 class SyncTaskToken; |
| 31 struct BlockingFactor; | 32 struct BlockingFactor; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 54 public: | 55 public: |
| 55 virtual ~Client() {} | 56 virtual ~Client() {} |
| 56 | 57 |
| 57 // Called when the manager is idle. | 58 // Called when the manager is idle. |
| 58 virtual void MaybeScheduleNextTask() = 0; | 59 virtual void MaybeScheduleNextTask() = 0; |
| 59 | 60 |
| 60 // Called when the manager is notified a task is done. | 61 // Called when the manager is notified a task is done. |
| 61 virtual void NotifyLastOperationStatus( | 62 virtual void NotifyLastOperationStatus( |
| 62 SyncStatusCode last_operation_status, | 63 SyncStatusCode last_operation_status, |
| 63 bool last_operation_used_network) = 0; | 64 bool last_operation_used_network) = 0; |
| 65 |
| 66 virtual void RecordTaskLog(scoped_ptr<TaskLogger::TaskLog> task_log) = 0; |
| 64 }; | 67 }; |
| 65 | 68 |
| 66 // Runs at most |maximum_background_tasks| parallel as background tasks. | 69 // Runs at most |maximum_background_tasks| parallel as background tasks. |
| 67 // If |maximum_background_tasks| is zero, all task runs as foreground task. | 70 // If |maximum_background_tasks| is zero, all task runs as foreground task. |
| 68 SyncTaskManager(base::WeakPtr<Client> client, | 71 SyncTaskManager(base::WeakPtr<Client> client, |
| 69 size_t maximum_background_task); | 72 size_t maximum_background_task); |
| 70 virtual ~SyncTaskManager(); | 73 virtual ~SyncTaskManager(); |
| 71 | 74 |
| 72 // This needs to be called to start task scheduling. | 75 // This needs to be called to start task scheduling. |
| 73 // If |status| is not SYNC_STATUS_OK calling this may change the | 76 // If |status| is not SYNC_STATUS_OK calling this may change the |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 188 |
| 186 TaskDependencyManager dependency_manager_; | 189 TaskDependencyManager dependency_manager_; |
| 187 | 190 |
| 188 DISALLOW_COPY_AND_ASSIGN(SyncTaskManager); | 191 DISALLOW_COPY_AND_ASSIGN(SyncTaskManager); |
| 189 }; | 192 }; |
| 190 | 193 |
| 191 } // namespace drive_backend | 194 } // namespace drive_backend |
| 192 } // namespace sync_file_system | 195 } // namespace sync_file_system |
| 193 | 196 |
| 194 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_MANAGER_H_ | 197 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_MANAGER_H_ |
| OLD | NEW |