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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 380 | 380 |
| 381 // Our consumer should have made sure that this is a safe referrer. See for | 381 // Our consumer should have made sure that this is a safe referrer. See for |
| 382 // instance WebCore::FrameLoader::HideReferrer. | 382 // instance WebCore::FrameLoader::HideReferrer. |
| 383 if (referrer.is_valid()) { | 383 if (referrer.is_valid()) { |
| 384 request_info_.extra_headers.SetHeader(HttpRequestHeaders::kReferer, | 384 request_info_.extra_headers.SetHeader(HttpRequestHeaders::kReferer, |
| 385 referrer.spec()); | 385 referrer.spec()); |
| 386 } | 386 } |
| 387 | 387 |
| 388 request_info_.token_binding_referrer = request_->token_binding_referrer(); | 388 request_info_.token_binding_referrer = request_->token_binding_referrer(); |
| 389 | 389 |
| 390 if (request_->has_default_user_agent()) { | |
| 391 request_info_.extra_headers.SetHeaderIfMissing( | |
| 392 HttpRequestHeaders::kUserAgent, request_->default_user_agent()); | |
|
mmenke
2016/08/21 14:37:39
I really don't think we need two different wants t
tyoshino (SeeGerritForStatus)
2016/08/23 10:01:47
Right. I'd like to propagate DevTools' User-Agent
mmenke
2016/08/23 14:54:33
Could ServiceWorker just hide the header it passes
tyoshino (SeeGerritForStatus)
2016/08/25 04:11:34
I think embedding everything into the header holde
mmenke
2016/08/25 04:17:01
SGTM. I think it's also worth noting that the beh
| |
| 393 } | |
| 394 | |
| 390 request_info_.extra_headers.SetHeaderIfMissing( | 395 request_info_.extra_headers.SetHeaderIfMissing( |
| 391 HttpRequestHeaders::kUserAgent, | 396 HttpRequestHeaders::kUserAgent, |
| 392 http_user_agent_settings_ ? | 397 http_user_agent_settings_ ? |
| 393 http_user_agent_settings_->GetUserAgent() : std::string()); | 398 http_user_agent_settings_->GetUserAgent() : std::string()); |
| 394 | 399 |
| 395 AddExtraHeaders(); | 400 AddExtraHeaders(); |
| 396 AddCookieHeaderAndStart(); | 401 AddCookieHeaderAndStart(); |
| 397 } | 402 } |
| 398 | 403 |
| 399 void URLRequestHttpJob::Kill() { | 404 void URLRequestHttpJob::Kill() { |
| (...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1608 // Notify NetworkQualityEstimator. | 1613 // Notify NetworkQualityEstimator. |
| 1609 if (request()) { | 1614 if (request()) { |
| 1610 NetworkQualityEstimator* network_quality_estimator = | 1615 NetworkQualityEstimator* network_quality_estimator = |
| 1611 request()->context()->network_quality_estimator(); | 1616 request()->context()->network_quality_estimator(); |
| 1612 if (network_quality_estimator) | 1617 if (network_quality_estimator) |
| 1613 network_quality_estimator->NotifyURLRequestDestroyed(*request()); | 1618 network_quality_estimator->NotifyURLRequestDestroyed(*request()); |
| 1614 } | 1619 } |
| 1615 } | 1620 } |
| 1616 | 1621 |
| 1617 } // namespace net | 1622 } // namespace net |
| OLD | NEW |