| 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 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 | 861 |
| 862 void URLRequestHttpJob::SetExtraRequestHeaders( | 862 void URLRequestHttpJob::SetExtraRequestHeaders( |
| 863 const HttpRequestHeaders& headers) { | 863 const HttpRequestHeaders& headers) { |
| 864 DCHECK(!transaction_.get()) << "cannot change once started"; | 864 DCHECK(!transaction_.get()) << "cannot change once started"; |
| 865 request_info_.extra_headers.CopyFrom(headers); | 865 request_info_.extra_headers.CopyFrom(headers); |
| 866 } | 866 } |
| 867 | 867 |
| 868 void URLRequestHttpJob::Start() { | 868 void URLRequestHttpJob::Start() { |
| 869 DCHECK(!transaction_.get()); | 869 DCHECK(!transaction_.get()); |
| 870 | 870 |
| 871 // Ensure that we do not send username and password fields in the referrer. | 871 // URLReques::SetReferrer ensures that we do not send username and password |
| 872 GURL referrer(request_->GetSanitizedReferrer()); | 872 // fields in the referrer. |
| 873 GURL referrer(request_->referrer()); |
| 873 | 874 |
| 874 request_info_.url = request_->url(); | 875 request_info_.url = request_->url(); |
| 875 request_info_.method = request_->method(); | 876 request_info_.method = request_->method(); |
| 876 request_info_.load_flags = request_->load_flags(); | 877 request_info_.load_flags = request_->load_flags(); |
| 877 request_info_.priority = request_->priority(); | 878 request_info_.priority = request_->priority(); |
| 878 request_info_.request_id = request_->identifier(); | 879 request_info_.request_id = request_->identifier(); |
| 879 | 880 |
| 880 // Strip Referer from request_info_.extra_headers to prevent, e.g., plugins | 881 // Strip Referer from request_info_.extra_headers to prevent, e.g., plugins |
| 881 // from overriding headers that are controlled using other means. Otherwise a | 882 // from overriding headers that are controlled using other means. Otherwise a |
| 882 // plugin could set a referrer although sending the referrer is inhibited. | 883 // plugin could set a referrer although sending the referrer is inhibited. |
| (...skipping 693 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 |