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

Unified Diff: chrome/browser/chromeos/file_system_provider/queue.cc

Issue 925873002: Fix a queue for FSP API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/file_system_provider/queue_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/file_system_provider/queue.cc
diff --git a/chrome/browser/chromeos/file_system_provider/queue.cc b/chrome/browser/chromeos/file_system_provider/queue.cc
index 96cbad4880bea2aaa571eef812eb74d79eb03322..4c3ebe8aae6efeca8f65d98d10d7c07f9fe80f99 100644
--- a/chrome/browser/chromeos/file_system_provider/queue.cc
+++ b/chrome/browser/chromeos/file_system_provider/queue.cc
@@ -75,11 +75,12 @@ void Queue::Remove(size_t token) {
}
void Queue::MaybeRun() {
- if (executed_.size() == max_in_parallel_ || !pending_.size()) {
+ if (executed_.size() + completed_.size() == max_in_parallel_ ||
+ !pending_.size()) {
return;
}
- DCHECK_GT(max_in_parallel_, executed_.size());
+ DCHECK_GT(max_in_parallel_, executed_.size() + completed_.size());
Task task = pending_.front();
pending_.pop_front();
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_system_provider/queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698