summaryrefslogtreecommitdiffstats
path: root/net/base/host_resolver_impl.cc
diff options
context:
space:
mode:
authorszym@chromium.org <szym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-24 21:09:05 +0000
committerszym@chromium.org <szym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-24 21:09:05 +0000
commit31ae7abec500e5d497079745490d8ba4986b1ba2 (patch)
treec5b3a979b1b540b8398fb21285a2154957ac7cd7 /net/base/host_resolver_impl.cc
parent0da2ecf6b25b9b18ab3f009e8ba2181b09735b6f (diff)
downloadchromium_src-31ae7abec500e5d497079745490d8ba4986b1ba2.zip
chromium_src-31ae7abec500e5d497079745490d8ba4986b1ba2.tar.gz
chromium_src-31ae7abec500e5d497079745490d8ba4986b1ba2.tar.bz2
[net] Change order of RequestPriority to natural: higher > lower
BUG=124683 TEST=./net_unittests Review URL: http://codereview.chromium.org/10185007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133766 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/host_resolver_impl.cc')
-rw-r--r--net/base/host_resolver_impl.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc
index 534f3a4..0525459 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: