From 68ad3eeffee6a1e4972b099bffdef17b7d99624d Mon Sep 17 00:00:00 2001 From: "eroman@chromium.org" Date: Sat, 30 Jan 2010 03:45:39 +0000 Subject: 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 --- net/base/host_resolver.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'net/base/host_resolver.h') 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 { 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 { 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 { // 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_; -- cgit v1.1