OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHROMEOS_DRIVE_JOB_SCHEDULER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_JOB_SCHEDULER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_JOB_SCHEDULER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_JOB_SCHEDULER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 // Returns the lowest acceptable priority level of the operations that is | 268 // Returns the lowest acceptable priority level of the operations that is |
269 // currently allowed to start for the |queue_type|. | 269 // currently allowed to start for the |queue_type|. |
270 int GetCurrentAcceptedPriority(QueueType queue_type); | 270 int GetCurrentAcceptedPriority(QueueType queue_type); |
271 | 271 |
272 // Updates |wait_until_| to throttle requests. | 272 // Updates |wait_until_| to throttle requests. |
273 void UpdateWait(); | 273 void UpdateWait(); |
274 | 274 |
275 // Retries the job if needed and returns false. Otherwise returns true. | 275 // Retries the job if needed and returns false. Otherwise returns true. |
276 bool OnJobDone(JobID job_id, google_apis::GDataErrorCode error); | 276 bool OnJobDone(JobID job_id, google_apis::GDataErrorCode error); |
277 | 277 |
| 278 // Callback for job finishing with a FileListCallback. |
| 279 void OnGetFileListJobDone( |
| 280 JobID job_id, |
| 281 const google_apis::GetResourceListCallback& callback, |
| 282 google_apis::GDataErrorCode error, |
| 283 scoped_ptr<google_apis::FileList> file_list); |
| 284 |
278 // Callback for job finishing with a ChangeListCallback. | 285 // Callback for job finishing with a ChangeListCallback. |
279 void OnGetChangeListJobDone( | 286 void OnGetChangeListJobDone( |
280 JobID job_id, | 287 JobID job_id, |
281 const google_apis::GetResourceListCallback& callback, | 288 const google_apis::GetResourceListCallback& callback, |
282 google_apis::GDataErrorCode error, | 289 google_apis::GDataErrorCode error, |
283 scoped_ptr<google_apis::ChangeList> change_list); | 290 scoped_ptr<google_apis::ChangeList> change_list); |
284 | 291 |
285 // Callback for job finishing with a GetResourceListCallback. | |
286 void OnGetResourceListJobDone( | |
287 JobID job_id, | |
288 const google_apis::GetResourceListCallback& callback, | |
289 google_apis::GDataErrorCode error, | |
290 scoped_ptr<google_apis::ResourceList> resource_list); | |
291 | |
292 // Callback for job finishing with a GetResourceEntryCallback. | 292 // Callback for job finishing with a GetResourceEntryCallback. |
293 void OnGetResourceEntryJobDone( | 293 void OnGetResourceEntryJobDone( |
294 JobID job_id, | 294 JobID job_id, |
295 const google_apis::GetResourceEntryCallback& callback, | 295 const google_apis::GetResourceEntryCallback& callback, |
296 google_apis::GDataErrorCode error, | 296 google_apis::GDataErrorCode error, |
297 scoped_ptr<google_apis::ResourceEntry> entry); | 297 scoped_ptr<google_apis::ResourceEntry> entry); |
298 | 298 |
299 // Callback for job finishing with a AboutResourceCallback. | 299 // Callback for job finishing with a AboutResourceCallback. |
300 void OnGetAboutResourceJobDone( | 300 void OnGetAboutResourceJobDone( |
301 JobID job_id, | 301 JobID job_id, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 | 404 |
405 // Note: This should remain the last member so it'll be destroyed and | 405 // Note: This should remain the last member so it'll be destroyed and |
406 // invalidate its weak pointers before any other members are destroyed. | 406 // invalidate its weak pointers before any other members are destroyed. |
407 base::WeakPtrFactory<JobScheduler> weak_ptr_factory_; | 407 base::WeakPtrFactory<JobScheduler> weak_ptr_factory_; |
408 DISALLOW_COPY_AND_ASSIGN(JobScheduler); | 408 DISALLOW_COPY_AND_ASSIGN(JobScheduler); |
409 }; | 409 }; |
410 | 410 |
411 } // namespace drive | 411 } // namespace drive |
412 | 412 |
413 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_JOB_SCHEDULER_H_ | 413 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_JOB_SCHEDULER_H_ |
OLD | NEW |