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

Unified Diff: net/base/prioritized_dispatcher.cc

Issue 19498003: [net/dns] Perform A/AAAA queries for AF_UNSPEC resolutions in parallel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Add space Created 7 years, 5 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
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);
}

Powered by Google App Engine
This is Rietveld 408576698