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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 // Our consumer should have made sure that this is a safe referrer. See for | 263 // Our consumer should have made sure that this is a safe referrer. See for |
264 // instance WebCore::FrameLoader::HideReferrer. | 264 // instance WebCore::FrameLoader::HideReferrer. |
265 if (referrer.is_valid()) { | 265 if (referrer.is_valid()) { |
266 request_info_.extra_headers.SetHeader(HttpRequestHeaders::kReferer, | 266 request_info_.extra_headers.SetHeader(HttpRequestHeaders::kReferer, |
267 referrer.spec()); | 267 referrer.spec()); |
268 } | 268 } |
269 | 269 |
270 request_info_.extra_headers.SetHeaderIfMissing( | 270 request_info_.extra_headers.SetHeaderIfMissing( |
271 HttpRequestHeaders::kUserAgent, | 271 HttpRequestHeaders::kUserAgent, |
272 http_user_agent_settings_ ? | 272 http_user_agent_settings_ ? |
273 http_user_agent_settings_->GetUserAgent(request_->url()) : | 273 http_user_agent_settings_->GetUserAgent() : std::string()); |
274 std::string()); | |
275 | 274 |
276 AddExtraHeaders(); | 275 AddExtraHeaders(); |
277 AddCookieHeaderAndStart(); | 276 AddCookieHeaderAndStart(); |
278 } | 277 } |
279 | 278 |
280 void URLRequestHttpJob::Kill() { | 279 void URLRequestHttpJob::Kill() { |
281 if (!transaction_.get()) | 280 if (!transaction_.get()) |
282 return; | 281 return; |
283 | 282 |
284 weak_factory_.InvalidateWeakPtrs(); | 283 weak_factory_.InvalidateWeakPtrs(); |
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1466 return override_response_headers_.get() ? | 1465 return override_response_headers_.get() ? |
1467 override_response_headers_.get() : | 1466 override_response_headers_.get() : |
1468 transaction_->GetResponseInfo()->headers.get(); | 1467 transaction_->GetResponseInfo()->headers.get(); |
1469 } | 1468 } |
1470 | 1469 |
1471 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1470 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
1472 awaiting_callback_ = false; | 1471 awaiting_callback_ = false; |
1473 } | 1472 } |
1474 | 1473 |
1475 } // namespace net | 1474 } // namespace net |
OLD | NEW |