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

Unified Diff: net/base/host_resolver_impl.cc

Issue 10185007: [net] Change order of RequestPriority to natural: higher > lower (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use MINIMUM_PRIORITY instead of 0. Created 8 years, 8 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 | net/base/prioritized_dispatcher.h » ('j') | net/base/prioritized_dispatcher.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/host_resolver_impl.cc
diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc
index 534f3a49721700258f403814a33166b7f2fb0a52..0525459591a9d09606b2974c2e962d1d837988e3 100644
--- a/net/base/host_resolver_impl.cc
+++ b/net/base/host_resolver_impl.cc
@@ -389,7 +389,7 @@ class PriorityTracker {
void Add(RequestPriority req_priority) {
++total_count_;
++counts_[req_priority];
- if (highest_priority_ > req_priority)
+ if (highest_priority_ < req_priority)
highest_priority_ = req_priority;
}
@@ -399,14 +399,12 @@ class PriorityTracker {
--total_count_;
--counts_[req_priority];
size_t i;
- for (i = highest_priority_; i < NUM_PRIORITIES && !counts_[i]; ++i);
+ for (i = highest_priority_; i > MINIMUM_PRIORITY && !counts_[i]; --i);
highest_priority_ = static_cast<RequestPriority>(i);
- // In absence of requests set default.
- if (highest_priority_ == NUM_PRIORITIES) {
- DCHECK_EQ(0u, total_count_);
- highest_priority_ = IDLE;
- }
+ // In absence of requests, default to MINIMUM_PRIORITY.
+ if (total_count_ == 0)
+ DCHECK_EQ(MINIMUM_PRIORITY, highest_priority_);
}
private:
« no previous file with comments | « no previous file | net/base/prioritized_dispatcher.h » ('j') | net/base/prioritized_dispatcher.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698