From 725355a29e53a5bc0f37237b9be5023a35e0c09e Mon Sep 17 00:00:00 2001 From: "willchan@chromium.org" Date: Wed, 25 Mar 2009 20:42:55 +0000 Subject: Reverting 12479 which reverted 12470. This change is the same as 12470, except with HttpRequestInfo::priority initialized in the initializer list, which should fix the purify errors. Review URL: http://codereview.chromium.org/53066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12490 0039d316-1c4b-4281-b951-d872f2087c98 --- net/url_request/url_request.h | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'net/url_request/url_request.h') diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h index a16080f..d45e510 100644 --- a/net/url_request/url_request.h +++ b/net/url_request/url_request.h @@ -8,6 +8,7 @@ #include #include +#include "base/logging.h" #include "base/ref_counted.h" #include "googleurl/src/gurl.h" #include "net/base/load_states.h" @@ -15,16 +16,14 @@ #include "net/url_request/url_request_status.h" namespace base { - class Time; -} +class Time; +} // namespace base namespace net { - class IOBuffer; class UploadData; class X509Certificate; - -} +} // namespace net class URLRequestContext; class URLRequestJob; @@ -431,12 +430,20 @@ class URLRequest { // Returns the expected content size if available int64 GetExpectedContentSize() const; + // Returns the priority level for this request. A larger value indicates + // higher priority. Negative values are not used. + int priority() const { return priority_; } + void set_priority(int priority) { + DCHECK_GE(priority, 0); + priority_ = priority; + } + protected: // Allow the URLRequestJob class to control the is_pending() flag. void set_is_pending(bool value) { is_pending_ = value; } // Allow the URLRequestJob class to set our status too - void set_status(const URLRequestStatus &value) { status_ = value; } + void set_status(const URLRequestStatus& value) { status_ = value; } // Allow the URLRequestJob to redirect this request. Returns net::OK if // successful, otherwise an error code is returned. @@ -505,6 +512,10 @@ class URLRequest { // first transaction in a request involving redirects. uint64 final_upload_progress_; + // The priority level for this request. Objects like ClientSocketPool use + // this to determine which URLRequest to allocate sockets to first. + int priority_; + DISALLOW_COPY_AND_ASSIGN(URLRequest); }; -- cgit v1.1