Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Unified Diff: net/url_request/url_request.h

Issue 42541: Prioritize which HTTP requests get a socket first by adding a priority level ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_request_info.h ('k') | net/url_request/url_request.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request.h
===================================================================
--- net/url_request/url_request.h (revision 12453)
+++ net/url_request/url_request.h (working copy)
@@ -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,17 +16,15 @@
#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 @@
// 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 @@
// 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);
};
« no previous file with comments | « net/http/http_request_info.h ('k') | net/url_request/url_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698