summaryrefslogtreecommitdiffstats
path: root/net/url_request/url_request.h
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 20:42:55 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 20:42:55 +0000
commit725355a29e53a5bc0f37237b9be5023a35e0c09e (patch)
tree89338fa14de0636689c57716f8ffe1485540d3ea /net/url_request/url_request.h
parent78c3a37c716807e8f50444da64d6506632e13669 (diff)
downloadchromium_src-725355a29e53a5bc0f37237b9be5023a35e0c09e.zip
chromium_src-725355a29e53a5bc0f37237b9be5023a35e0c09e.tar.gz
chromium_src-725355a29e53a5bc0f37237b9be5023a35e0c09e.tar.bz2
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
Diffstat (limited to 'net/url_request/url_request.h')
-rw-r--r--net/url_request/url_request.h23
1 files changed, 17 insertions, 6 deletions
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 <string>
#include <vector>
+#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);
};