Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Side by Side Diff: chrome/browser/chromeos/drive/job_scheduler.h

Issue 17101020: Support cancellation of non-yet-running jobs in drive::JobScheduler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix failures in tests. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 ClientContext context; 201 ClientContext context;
202 202
203 // The number of times the jobs is retried due to server errors. 203 // The number of times the jobs is retried due to server errors.
204 int retry_count; 204 int retry_count;
205 205
206 // The callback to start the job. Called each time it is retry. 206 // The callback to start the job. Called each time it is retry.
207 base::Callback<google_apis::CancelCallback()> task; 207 base::Callback<google_apis::CancelCallback()> task;
208 208
209 // The callback to cancel the running job. It is returned from task.Run(). 209 // The callback to cancel the running job. It is returned from task.Run().
210 google_apis::CancelCallback cancel_callback; 210 google_apis::CancelCallback cancel_callback;
211
212 // The callback to notify an error to the client of JobScheduler.
213 // This is used to notify cancel of a job that is not running yet.
214 base::Callback<void(google_apis::GDataErrorCode)> abort_callback;
211 }; 215 };
212 216
213 // Parameters for DriveUploader::ResumeUploadFile. 217 // Parameters for DriveUploader::ResumeUploadFile.
214 struct ResumeUploadParams; 218 struct ResumeUploadParams;
215 219
216 // Creates a new job and add it to the job map. 220 // Creates a new job and add it to the job map.
217 JobEntry* CreateNewJob(JobType type); 221 JobEntry* CreateNewJob(JobType type);
218 222
219 // Adds the specified job to the queue and starts the job loop for the queue 223 // Adds the specified job to the queue and starts the job loop for the queue
220 // if needed. 224 // if needed.
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 343
340 // Note: This should remain the last member so it'll be destroyed and 344 // Note: This should remain the last member so it'll be destroyed and
341 // invalidate its weak pointers before any other members are destroyed. 345 // invalidate its weak pointers before any other members are destroyed.
342 base::WeakPtrFactory<JobScheduler> weak_ptr_factory_; 346 base::WeakPtrFactory<JobScheduler> weak_ptr_factory_;
343 DISALLOW_COPY_AND_ASSIGN(JobScheduler); 347 DISALLOW_COPY_AND_ASSIGN(JobScheduler);
344 }; 348 };
345 349
346 } // namespace drive 350 } // namespace drive
347 351
348 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_JOB_SCHEDULER_H_ 352 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_JOB_SCHEDULER_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/job_queue_unittest.cc ('k') | chrome/browser/chromeos/drive/job_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698