| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/url_request/url_request_http_job.h" | 5 #include "net/url_request/url_request_http_job.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 | 302 |
| 303 void URLRequestHttpJob::SetPriority(RequestPriority priority) { | 303 void URLRequestHttpJob::SetPriority(RequestPriority priority) { |
| 304 priority_ = priority; | 304 priority_ = priority; |
| 305 if (transaction_) | 305 if (transaction_) |
| 306 transaction_->SetPriority(priority_); | 306 transaction_->SetPriority(priority_); |
| 307 } | 307 } |
| 308 | 308 |
| 309 void URLRequestHttpJob::Start() { | 309 void URLRequestHttpJob::Start() { |
| 310 DCHECK(!transaction_.get()); | 310 DCHECK(!transaction_.get()); |
| 311 | 311 |
| 312 // Ensure that we do not send username and password fields in the referrer. | 312 // URLRequest::SetReferrer ensures that we do not send username and password |
| 313 GURL referrer(request_->GetSanitizedReferrer()); | 313 // fields in the referrer. |
| 314 GURL referrer(request_->referrer()); |
| 314 | 315 |
| 315 request_info_.url = request_->url(); | 316 request_info_.url = request_->url(); |
| 316 request_info_.method = request_->method(); | 317 request_info_.method = request_->method(); |
| 317 request_info_.load_flags = request_->load_flags(); | 318 request_info_.load_flags = request_->load_flags(); |
| 318 request_info_.request_id = request_->identifier(); | 319 request_info_.request_id = request_->identifier(); |
| 319 | 320 |
| 320 // Strip Referer from request_info_.extra_headers to prevent, e.g., plugins | 321 // Strip Referer from request_info_.extra_headers to prevent, e.g., plugins |
| 321 // from overriding headers that are controlled using other means. Otherwise a | 322 // from overriding headers that are controlled using other means. Otherwise a |
| 322 // plugin could set a referrer although sending the referrer is inhibited. | 323 // plugin could set a referrer although sending the referrer is inhibited. |
| 323 request_info_.extra_headers.RemoveHeader(HttpRequestHeaders::kReferer); | 324 request_info_.extra_headers.RemoveHeader(HttpRequestHeaders::kReferer); |
| (...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1576 | 1577 |
| 1577 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1578 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
| 1578 awaiting_callback_ = false; | 1579 awaiting_callback_ = false; |
| 1579 } | 1580 } |
| 1580 | 1581 |
| 1581 void URLRequestHttpJob::OnDetachRequest() { | 1582 void URLRequestHttpJob::OnDetachRequest() { |
| 1582 http_transaction_delegate_->OnDetachRequest(); | 1583 http_transaction_delegate_->OnDetachRequest(); |
| 1583 } | 1584 } |
| 1584 | 1585 |
| 1585 } // namespace net | 1586 } // namespace net |
| OLD | NEW |