Chromium Code Reviews| 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 // Ensure that we do not send username and password fields in the referrer. |
|
pauljensen
2013/03/15 21:50:00
This comment doesn't make as much sense now that t
mef
2013/03/18 16:42:07
Done.
| |
| 872 GURL referrer(request_->GetSanitizedReferrer()); | 872 GURL referrer(request_->referrer()); |
| 873 | 873 |
| 874 request_info_.url = request_->url(); | 874 request_info_.url = request_->url(); |
| 875 request_info_.method = request_->method(); | 875 request_info_.method = request_->method(); |
| 876 request_info_.load_flags = request_->load_flags(); | 876 request_info_.load_flags = request_->load_flags(); |
| 877 request_info_.priority = request_->priority(); | 877 request_info_.priority = request_->priority(); |
| 878 request_info_.request_id = request_->identifier(); | 878 request_info_.request_id = request_->identifier(); |
| 879 | 879 |
| 880 // Strip Referer from request_info_.extra_headers to prevent, e.g., plugins | 880 // Strip Referer from request_info_.extra_headers to prevent, e.g., plugins |
| 881 // from overriding headers that are controlled using other means. Otherwise a | 881 // from overriding headers that are controlled using other means. Otherwise a |
| 882 // plugin could set a referrer although sending the referrer is inhibited. | 882 // 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 | 1576 |
| 1577 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1577 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
| 1578 awaiting_callback_ = false; | 1578 awaiting_callback_ = false; |
| 1579 } | 1579 } |
| 1580 | 1580 |
| 1581 void URLRequestHttpJob::OnDetachRequest() { | 1581 void URLRequestHttpJob::OnDetachRequest() { |
| 1582 http_transaction_delegate_->OnDetachRequest(); | 1582 http_transaction_delegate_->OnDetachRequest(); |
| 1583 } | 1583 } |
| 1584 | 1584 |
| 1585 } // namespace net | 1585 } // namespace net |
| OLD | NEW |