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

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

Issue 17101020: Support cancellation of non-yet-running jobs in drive::JobScheduler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix failures in tests. Created 7 years, 6 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 | « chrome/browser/chromeos/drive/job_queue.h ('k') | chrome/browser/chromeos/drive/job_queue_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/job_queue.cc
diff --git a/chrome/browser/chromeos/drive/job_queue.cc b/chrome/browser/chromeos/drive/job_queue.cc
index 40a9ed60b8d391e0f3ac50e093ab251969cd3441..499312d0f0c97a8e3b66a1253883402131b52134 100644
--- a/chrome/browser/chromeos/drive/job_queue.cc
+++ b/chrome/browser/chromeos/drive/job_queue.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/chromeos/drive/job_queue.h"
+#include <algorithm>
+
#include "base/logging.h"
#include "base/strings/stringprintf.h"
@@ -64,4 +66,15 @@ size_t JobQueue::GetNumberOfJobs() const {
return count;
}
+void JobQueue::Remove(JobID id) {
+ for (size_t i = 0; i < queue_.size(); ++i) {
+ std::deque<JobID>::iterator iter =
+ std::find(queue_[i].begin(), queue_[i].end(), id);
+ if (iter != queue_[i].end()) {
+ queue_[i].erase(iter);
+ break;
+ }
+ }
+}
+
} // namespace drive
« no previous file with comments | « chrome/browser/chromeos/drive/job_queue.h ('k') | chrome/browser/chromeos/drive/job_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698