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

Unified Diff: chrome/browser/chromeos/drive/drive_scheduler.cc

Issue 14367010: Fire event notification from DriveScheduler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/drive_scheduler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/drive_scheduler.cc
diff --git a/chrome/browser/chromeos/drive/drive_scheduler.cc b/chrome/browser/chromeos/drive/drive_scheduler.cc
index fbb553f61208393b29c4635b9ea79ac99d12ebaf..3f2cd463ca520bc2b7299b901ab0e479dfd450fa 100644
--- a/chrome/browser/chromeos/drive/drive_scheduler.cc
+++ b/chrome/browser/chromeos/drive/drive_scheduler.cc
@@ -366,6 +366,7 @@ void DriveScheduler::StartNewJob(scoped_ptr<QueueEntry> job, JobType type) {
job_info->file_path = job->drive_file_path;
QueueJob(job.Pass());
+ NotifyJobAdded(*job_info);
StartJobLoop(GetJobQueueType(type));
}
@@ -411,6 +412,7 @@ void DriveScheduler::DoJobLoop(QueueType queue_type) {
JobInfo* job_info = job_map_.Lookup(queue_entry->job_id);
DCHECK(job_info);
job_info->state = STATE_RUNNING;
+ NotifyJobUpdated(*job_info);
// The some arguments are evaluated after bind, so we copy the pointer to the
// QueueEntry
@@ -694,6 +696,7 @@ scoped_ptr<DriveScheduler::QueueEntry> DriveScheduler::OnJobDone(
// Retry, depending on the error.
if (error == DRIVE_FILE_ERROR_THROTTLED) {
job_info->state = STATE_RETRY;
+ NotifyJobUpdated(*job_info);
// Requeue the job.
QueueJob(queue_entry.Pass());
@@ -702,6 +705,7 @@ scoped_ptr<DriveScheduler::QueueEntry> DriveScheduler::OnJobDone(
return scoped_ptr<DriveScheduler::QueueEntry>();
} else {
+ NotifyJobDone(*job_info, error);
// The job has finished, no retry will happen in the scheduler. Now we can
// remove the job info from the map. This is the only place of the removal.
job_map_.Remove(queue_entry->job_id);
@@ -863,6 +867,7 @@ void DriveScheduler::UpdateProgress(JobID job_id, int64 progress, int64 total) {
job_info->num_completed_bytes = progress;
job_info->num_total_bytes = total;
+ NotifyJobUpdated(*job_info);
}
void DriveScheduler::OnConnectionTypeChanged(
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/drive_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698