Index: chrome/browser/chromeos/drive/job_scheduler.cc |
diff --git a/chrome/browser/chromeos/drive/job_scheduler.cc b/chrome/browser/chromeos/drive/job_scheduler.cc |
index b3a4edcaf56da346ea1902d8f4b216b400106420..2be9669db0f09c60e6a4dd0b469594c0547e92c0 100644 |
--- a/chrome/browser/chromeos/drive/job_scheduler.cc |
+++ b/chrome/browser/chromeos/drive/job_scheduler.cc |
@@ -3,8 +3,6 @@ |
// found in the LICENSE file. |
#include "chrome/browser/chromeos/drive/job_scheduler.h" |
- |
-#include <algorithm> |
#include "base/files/file_util.h" |
#include "base/message_loop/message_loop.h" |
@@ -744,9 +742,7 @@ |
const JobInfo& job_info = job_entry->job_info; |
const QueueType queue_type = GetJobQueueType(job_info.job_type); |
- const bool batchable = job_info.job_type == TYPE_UPLOAD_EXISTING_FILE || |
- job_info.job_type == TYPE_UPLOAD_NEW_FILE; |
- queue_[queue_type]->Push(job_id, job_entry->context.type, batchable, |
+ queue_[queue_type]->Push(job_id, job_entry->context.type, false, |
job_info.num_total_bytes); |
// Temporary histogram for crbug.com/229650. |
@@ -806,28 +802,25 @@ |
if (job_ids.empty()) |
return; |
- if (job_ids.size() > 1) |
- uploader_->StartBatchProcessing(); |
- |
- for (JobID job_id : job_ids) { |
- JobEntry* entry = job_map_.Lookup(job_id); |
- DCHECK(entry); |
- |
- JobInfo* job_info = &entry->job_info; |
- job_info->state = STATE_RUNNING; |
- job_info->start_time = now; |
- NotifyJobUpdated(*job_info); |
- |
- entry->cancel_callback = entry->task.Run(); |
- logger_->Log(logging::LOG_INFO, "Job started: %s - %s", |
- job_info->ToString().c_str(), |
- GetQueueInfo(queue_type).c_str()); |
- } |
- |
- if (job_ids.size() > 1) |
- uploader_->StopBatchProcessing(); |
+ // TODO(hirono): Currently all requests are not batchable. So the queue always |
+ // return just 1 job. |
+ DCHECK_EQ(1u, job_ids.size()); |
+ JobEntry* entry = job_map_.Lookup(job_ids.front()); |
+ DCHECK(entry); |
+ |
+ JobInfo* job_info = &entry->job_info; |
+ job_info->state = STATE_RUNNING; |
+ job_info->start_time = now; |
+ NotifyJobUpdated(*job_info); |
+ |
+ entry->cancel_callback = entry->task.Run(); |
UpdateWait(); |
+ |
+ logger_->Log(logging::LOG_INFO, |
+ "Job started: %s - %s", |
+ job_info->ToString().c_str(), |
+ GetQueueInfo(queue_type).c_str()); |
} |
int JobScheduler::GetCurrentAcceptedPriority(QueueType queue_type) { |