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 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 SyncStatusCode last_operation_status, | 63 SyncStatusCode last_operation_status, |
64 bool last_operation_used_network) = 0; | 64 bool last_operation_used_network) = 0; |
65 | 65 |
66 virtual void RecordTaskLog(scoped_ptr<TaskLogger::TaskLog> task_log) = 0; | 66 virtual void RecordTaskLog(scoped_ptr<TaskLogger::TaskLog> task_log) = 0; |
67 }; | 67 }; |
68 | 68 |
69 // Runs at most |maximum_background_tasks| parallel as background tasks. | 69 // Runs at most |maximum_background_tasks| parallel as background tasks. |
70 // 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. |
71 SyncTaskManager(base::WeakPtr<Client> client, | 71 SyncTaskManager(base::WeakPtr<Client> client, |
72 size_t maximum_background_task, | 72 size_t maximum_background_task, |
73 base::SequencedTaskRunner* task_runner); | 73 const scoped_refptr<base::SequencedTaskRunner>& task_runner); |
74 virtual ~SyncTaskManager(); | 74 virtual ~SyncTaskManager(); |
75 | 75 |
76 // This needs to be called to start task scheduling. | 76 // This needs to be called to start task scheduling. |
77 // If |status| is not SYNC_STATUS_OK calling this may change the | 77 // If |status| is not SYNC_STATUS_OK calling this may change the |
78 // service status. This should not be called more than once. | 78 // service status. This should not be called more than once. |
79 void Initialize(SyncStatusCode status); | 79 void Initialize(SyncStatusCode status); |
80 | 80 |
81 // Schedules a task at the given priority. | 81 // Schedules a task at the given priority. |
82 void ScheduleTask(const tracked_objects::Location& from_here, | 82 void ScheduleTask(const tracked_objects::Location& from_here, |
83 const Task& task, | 83 const Task& task, |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 197 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
198 base::SequenceChecker sequence_checker_; | 198 base::SequenceChecker sequence_checker_; |
199 | 199 |
200 DISALLOW_COPY_AND_ASSIGN(SyncTaskManager); | 200 DISALLOW_COPY_AND_ASSIGN(SyncTaskManager); |
201 }; | 201 }; |
202 | 202 |
203 } // namespace drive_backend | 203 } // namespace drive_backend |
204 } // namespace sync_file_system | 204 } // namespace sync_file_system |
205 | 205 |
206 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_MANAGER_H_ | 206 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_MANAGER_H_ |
OLD | NEW |