diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-30 03:45:39 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-30 03:45:39 +0000 |
commit | 68ad3eeffee6a1e4972b099bffdef17b7d99624d (patch) | |
tree | f7f51c2f3eab08b753c09747da4c0643d56efda6 /net/base/host_resolver.h | |
parent | b3c9564b04438c11e46807ddb5dec21bb2dd50d7 (diff) | |
download | chromium_src-68ad3eeffee6a1e4972b099bffdef17b7d99624d.zip chromium_src-68ad3eeffee6a1e4972b099bffdef17b7d99624d.tar.gz chromium_src-68ad3eeffee6a1e4972b099bffdef17b7d99624d.tar.bz2 |
Add mechanism for global queueing and prioritization of DNS.
Currently this limit is very high (50), but it can be tuned through a variable.
BUG=9598
TEST=
HostResolverImplTest.HigherPriorityRequestsStartedFirst
HostResolverImplTest.CancelPendingRequest
HostResolverImplTest.QueueOverflow
Review URL: http://codereview.chromium.org/542086
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37608 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/host_resolver.h')
-rw-r--r-- | net/base/host_resolver.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/base/host_resolver.h b/net/base/host_resolver.h index 8a88402..0bcbbe8 100644 --- a/net/base/host_resolver.h +++ b/net/base/host_resolver.h @@ -11,6 +11,7 @@ #include "googleurl/src/gurl.h" #include "net/base/address_family.h" #include "net/base/completion_callback.h" +#include "net/base/request_priority.h" class MessageLoop; @@ -40,7 +41,8 @@ class HostResolver : public base::RefCountedThreadSafe<HostResolver> { address_family_(ADDRESS_FAMILY_UNSPECIFIED), port_(port), allow_cached_response_(true), - is_speculative_(false) {} + is_speculative_(false), + priority_(MEDIUM) {} const int port() const { return port_; } const std::string& hostname() const { return hostname_; } @@ -56,6 +58,9 @@ class HostResolver : public base::RefCountedThreadSafe<HostResolver> { bool is_speculative() const { return is_speculative_; } void set_is_speculative(bool b) { is_speculative_ = b; } + RequestPriority priority() const { return priority_; } + void set_priority(RequestPriority priority) { priority_ = priority; } + const GURL& referrer() const { return referrer_; } void set_referrer(const GURL& referrer) { referrer_ = referrer; } @@ -75,6 +80,9 @@ class HostResolver : public base::RefCountedThreadSafe<HostResolver> { // Whether this request was started by the DNS prefetcher. bool is_speculative_; + // The priority for the request. + RequestPriority priority_; + // Optional data for consumption by observers. This is the URL of the // page that lead us to the navigation, for DNS prefetcher's benefit. GURL referrer_; |