| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_queue.h" | 5 #include "chrome/browser/chromeos/drive/job_queue.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 | 9 |
| 10 namespace drive { | 10 namespace drive { |
| 11 | 11 |
| 12 JobQueue::JobQueue(size_t num_max_concurrent_jobs, | 12 JobQueue::JobQueue(size_t num_max_concurrent_jobs, |
| 13 size_t num_priority_levels) | 13 size_t num_priority_levels) |
| 14 : num_max_concurrent_jobs_(num_max_concurrent_jobs), | 14 : num_max_concurrent_jobs_(num_max_concurrent_jobs), |
| 15 queue_(num_priority_levels) { | 15 queue_(num_priority_levels) { |
| 16 } | 16 } |
| 17 | 17 |
| 18 JobQueue::~JobQueue() { | 18 JobQueue::~JobQueue() { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 | 59 |
| 60 size_t JobQueue::GetNumberOfJobs() const { | 60 size_t JobQueue::GetNumberOfJobs() const { |
| 61 size_t count = running_.size(); | 61 size_t count = running_.size(); |
| 62 for (size_t i = 0; i < queue_.size(); ++i) | 62 for (size_t i = 0; i < queue_.size(); ++i) |
| 63 count += queue_[i].size(); | 63 count += queue_[i].size(); |
| 64 return count; | 64 return count; |
| 65 } | 65 } |
| 66 | 66 |
| 67 } // namespace drive | 67 } // namespace drive |
| OLD | NEW |