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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 const tracked_objects::Location& from_here, | 156 const tracked_objects::Location& from_here, |
157 const SyncStatusCallback& callback, | 157 const SyncStatusCallback& callback, |
158 scoped_ptr<TaskBlocker> task_blocker); | 158 scoped_ptr<TaskBlocker> task_blocker); |
159 | 159 |
160 void PushPendingTask(const base::Closure& closure, Priority priority); | 160 void PushPendingTask(const base::Closure& closure, Priority priority); |
161 | 161 |
162 void RunTask(scoped_ptr<SyncTaskToken> token, | 162 void RunTask(scoped_ptr<SyncTaskToken> token, |
163 scoped_ptr<SyncTask> task); | 163 scoped_ptr<SyncTask> task); |
164 | 164 |
165 // Runs a pending task as a foreground task if possible. | 165 // Runs a pending task as a foreground task if possible. |
166 // If |token| is non-NULL, put |token| back to |token_| beforehand. | 166 // If |token| is non-nullptr, put |token| back to |token_| beforehand. |
167 void MaybeStartNextForegroundTask(scoped_ptr<SyncTaskToken> token); | 167 void MaybeStartNextForegroundTask(scoped_ptr<SyncTaskToken> token); |
168 | 168 |
169 base::WeakPtr<Client> client_; | 169 base::WeakPtr<Client> client_; |
170 | 170 |
171 // Owns running SyncTask to cancel the task on SyncTaskManager deletion. | 171 // Owns running SyncTask to cancel the task on SyncTaskManager deletion. |
172 scoped_ptr<SyncTask> running_foreground_task_; | 172 scoped_ptr<SyncTask> running_foreground_task_; |
173 | 173 |
174 // Owns running backgrounded SyncTask to cancel the task on SyncTaskManager | 174 // Owns running backgrounded SyncTask to cancel the task on SyncTaskManager |
175 // deletion. | 175 // deletion. |
176 base::ScopedPtrHashMap<int64, SyncTask> running_background_tasks_; | 176 base::ScopedPtrHashMap<int64, SyncTask> running_background_tasks_; |
(...skipping 20 matching lines...) Expand all 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 |