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

Side by Side Diff: chrome/browser/chromeos/drive/job_queue.h

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/job_queue.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_JOB_QUEUE_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_JOB_QUEUE_H_
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_JOB_QUEUE_H_ 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_JOB_QUEUE_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 28 matching lines...) Expand all
39 // Marks a running job |id| as finished running. This decreases the count 39 // Marks a running job |id| as finished running. This decreases the count
40 // of running parallel jobs and makes room for other jobs to be popped. 40 // of running parallel jobs and makes room for other jobs to be popped.
41 void MarkFinished(JobID id); 41 void MarkFinished(JobID id);
42 42
43 // Generates a string representing the internal state for logging. 43 // Generates a string representing the internal state for logging.
44 std::string ToString() const; 44 std::string ToString() const;
45 45
46 // Gets the total number of jobs in the queue. 46 // Gets the total number of jobs in the queue.
47 size_t GetNumberOfJobs() const; 47 size_t GetNumberOfJobs() const;
48 48
49 // Removes the job from the queue.
50 void Remove(JobID id);
51
49 private: 52 private:
50 size_t num_max_concurrent_jobs_; 53 size_t num_max_concurrent_jobs_;
51 std::vector<std::deque<JobID> > queue_; 54 std::vector<std::deque<JobID> > queue_;
52 std::set<JobID> running_; 55 std::set<JobID> running_;
53 56
54 DISALLOW_COPY_AND_ASSIGN(JobQueue); 57 DISALLOW_COPY_AND_ASSIGN(JobQueue);
55 }; 58 };
56 59
57 } // namespace drive 60 } // namespace drive
58 61
59 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_JOB_QUEUE_H_ 62 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_JOB_QUEUE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/job_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698