| Index: net/base/prioritized_dispatcher.cc
|
| ===================================================================
|
| --- net/base/prioritized_dispatcher.cc (revision 212872)
|
| +++ net/base/prioritized_dispatcher.cc (working copy)
|
| @@ -45,6 +45,18 @@
|
| return queue_.Insert(job, priority);
|
| }
|
|
|
| +PrioritizedDispatcher::Handle PrioritizedDispatcher::AddAtHead(
|
| + Job* job, Priority priority) {
|
| + DCHECK(job);
|
| + DCHECK_LT(priority, num_priorities());
|
| + if (num_running_jobs_ < max_running_jobs_[priority]) {
|
| + ++num_running_jobs_;
|
| + job->Start();
|
| + return Handle();
|
| + }
|
| + return queue_.InsertAtFront(job, priority);
|
| +}
|
| +
|
| void PrioritizedDispatcher::Cancel(const Handle& handle) {
|
| queue_.Erase(handle);
|
| }
|
|
|