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

Unified Diff: net/url_request/url_request.cc

Issue 12701011: [Net] Propagate priority changes from URLRequest to HttpTransaction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix leaks Created 7 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/url_request/url_request.h ('k') | net/url_request/url_request_ftp_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request.cc
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 5e426d1e9ac26cf55adf6f9a17606acd331ab13e..245f389713e5ce4e6f332609ca514016ac6016f1 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -526,6 +526,7 @@ void URLRequest::StartJob(URLRequestJob* job) {
job_ = job;
job_->SetExtraRequestHeaders(extra_request_headers_);
+ job_->SetPriority(priority_);
if (upload_data_stream_.get())
job_->SetUpload(upload_data_stream_.get());
@@ -828,6 +829,20 @@ int64 URLRequest::GetExpectedContentSize() const {
return expected_content_size;
}
+void URLRequest::SetPriority(RequestPriority priority) {
+ DCHECK_GE(priority, MINIMUM_PRIORITY);
+ DCHECK_LT(priority, NUM_PRIORITIES);
+ if (priority_ == priority)
+ return;
+
+ priority_ = priority;
+ if (job_) {
+ net_log_.AddEvent(NetLog::TYPE_URL_REQUEST_SET_PRIORITY,
+ NetLog::IntegerCallback("priority", priority_));
+ job_->SetPriority(priority_);
+ }
+}
+
bool URLRequest::GetHSTSRedirect(GURL* redirect_url) const {
const GURL& url = this->url();
if (!url.SchemeIs("http"))
« no previous file with comments | « net/url_request/url_request.h ('k') | net/url_request/url_request_ftp_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698