| 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 #include "chrome/browser/chromeos/drive/job_scheduler.h" | 5 #include "chrome/browser/chromeos/drive/job_scheduler.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 DoJobLoop(GetJobQueueType(job->job_info.job_type)); | 708 DoJobLoop(GetJobQueueType(job->job_info.job_type)); |
| 709 } | 709 } |
| 710 | 710 |
| 711 void JobScheduler::QueueJob(JobID job_id) { | 711 void JobScheduler::QueueJob(JobID job_id) { |
| 712 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 712 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 713 | 713 |
| 714 JobEntry* job_entry = job_map_.Lookup(job_id); | 714 JobEntry* job_entry = job_map_.Lookup(job_id); |
| 715 DCHECK(job_entry); | 715 DCHECK(job_entry); |
| 716 const JobInfo& job_info = job_entry->job_info; | 716 const JobInfo& job_info = job_entry->job_info; |
| 717 | 717 |
| 718 QueueType queue_type = GetJobQueueType(job_info.job_type); | 718 const QueueType queue_type = GetJobQueueType(job_info.job_type); |
| 719 queue_[queue_type]->Push(job_id, job_entry->context.type); | 719 queue_[queue_type]->Push(job_id, job_entry->context.type); |
| 720 | 720 |
| 721 const std::string retry_prefix = job_entry->retry_count > 0 ? | 721 const std::string retry_prefix = job_entry->retry_count > 0 ? |
| 722 base::StringPrintf(" (retry %d)", job_entry->retry_count) : ""; | 722 base::StringPrintf(" (retry %d)", job_entry->retry_count) : ""; |
| 723 logger_->Log(logging::LOG_INFO, | 723 logger_->Log(logging::LOG_INFO, |
| 724 "Job queued%s: %s - %s", | 724 "Job queued%s: %s - %s", |
| 725 retry_prefix.c_str(), | 725 retry_prefix.c_str(), |
| 726 job_info.ToString().c_str(), | 726 job_info.ToString().c_str(), |
| 727 GetQueueInfo(queue_type).c_str()); | 727 GetQueueInfo(queue_type).c_str()); |
| 728 } | 728 } |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 case FILE_QUEUE: | 1133 case FILE_QUEUE: |
| 1134 return "FILE_QUEUE"; | 1134 return "FILE_QUEUE"; |
| 1135 case NUM_QUEUES: | 1135 case NUM_QUEUES: |
| 1136 break; // This value is just a sentinel. Should never be used. | 1136 break; // This value is just a sentinel. Should never be used. |
| 1137 } | 1137 } |
| 1138 NOTREACHED(); | 1138 NOTREACHED(); |
| 1139 return ""; | 1139 return ""; |
| 1140 } | 1140 } |
| 1141 | 1141 |
| 1142 } // namespace drive | 1142 } // namespace drive |
| OLD | NEW |