| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "net/base/host_resolver_impl.h" | 5 #include "net/base/host_resolver_impl.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <Winsock2.h> | 8 #include <Winsock2.h> |
| 9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
| 10 #include <netdb.h> | 10 #include <netdb.h> |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 | 553 |
| 554 DISALLOW_COPY_AND_ASSIGN(IPv6ProbeJob); | 554 DISALLOW_COPY_AND_ASSIGN(IPv6ProbeJob); |
| 555 }; | 555 }; |
| 556 | 556 |
| 557 //----------------------------------------------------------------------------- | 557 //----------------------------------------------------------------------------- |
| 558 | 558 |
| 559 // We rely on the priority enum values being sequential having starting at 0, | 559 // We rely on the priority enum values being sequential having starting at 0, |
| 560 // and increasing for lower priorities. | 560 // and increasing for lower priorities. |
| 561 COMPILE_ASSERT(HIGHEST == 0u && | 561 COMPILE_ASSERT(HIGHEST == 0u && |
| 562 LOWEST > HIGHEST && | 562 LOWEST > HIGHEST && |
| 563 NUM_PRIORITIES > LOWEST, | 563 IDLE > LOWEST && |
| 564 NUM_PRIORITIES > IDLE, |
| 564 priority_indexes_incompatible); | 565 priority_indexes_incompatible); |
| 565 | 566 |
| 566 // JobPool contains all the information relating to queued requests, including | 567 // JobPool contains all the information relating to queued requests, including |
| 567 // the limits on how many jobs are allowed to be used for this category of | 568 // the limits on how many jobs are allowed to be used for this category of |
| 568 // requests. | 569 // requests. |
| 569 class HostResolverImpl::JobPool { | 570 class HostResolverImpl::JobPool { |
| 570 public: | 571 public: |
| 571 JobPool(size_t max_outstanding_jobs, size_t max_pending_requests) | 572 JobPool(size_t max_outstanding_jobs, size_t max_pending_requests) |
| 572 : num_outstanding_jobs_(0u) { | 573 : num_outstanding_jobs_(0u) { |
| 573 SetConstraints(max_outstanding_jobs, max_pending_requests); | 574 SetConstraints(max_outstanding_jobs, max_pending_requests); |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1166 if (r == req) | 1167 if (r == req) |
| 1167 return error; | 1168 return error; |
| 1168 | 1169 |
| 1169 r->OnComplete(error, AddressList()); | 1170 r->OnComplete(error, AddressList()); |
| 1170 } | 1171 } |
| 1171 | 1172 |
| 1172 return ERR_IO_PENDING; | 1173 return ERR_IO_PENDING; |
| 1173 } | 1174 } |
| 1174 | 1175 |
| 1175 } // namespace net | 1176 } // namespace net |
| OLD | NEW |