| 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 "chrome/browser/automation/url_request_automation_job.h" | 5 #include "chrome/browser/automation/url_request_automation_job.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 net::HttpRequestHeaders::kAcceptLanguage) && | 465 net::HttpRequestHeaders::kAcceptLanguage) && |
| 466 http_user_agent_settings_) { | 466 http_user_agent_settings_) { |
| 467 std::string accept_language = | 467 std::string accept_language = |
| 468 http_user_agent_settings_->GetAcceptLanguage(); | 468 http_user_agent_settings_->GetAcceptLanguage(); |
| 469 if (!accept_language.empty()) { | 469 if (!accept_language.empty()) { |
| 470 new_request_headers.SetHeader(net::HttpRequestHeaders::kAcceptLanguage, | 470 new_request_headers.SetHeader(net::HttpRequestHeaders::kAcceptLanguage, |
| 471 accept_language); | 471 accept_language); |
| 472 } | 472 } |
| 473 } | 473 } |
| 474 | 474 |
| 475 // Ensure that we do not send username and password fields in the referrer. | 475 // URLRequest::SetReferrer() ensures that we do not send username and |
| 476 GURL referrer(request_->GetSanitizedReferrer()); | 476 // password fields in the referrer. |
| 477 GURL referrer(request_->referrer()); |
| 477 | 478 |
| 478 // The referrer header must be suppressed if the preceding URL was | 479 // The referrer header must be suppressed if the preceding URL was |
| 479 // a secure one and the new one is not. | 480 // a secure one and the new one is not. |
| 480 if (referrer.SchemeIsSecure() && !request_->url().SchemeIsSecure()) { | 481 if (referrer.SchemeIsSecure() && !request_->url().SchemeIsSecure()) { |
| 481 DVLOG(1) << "Suppressing referrer header since going from secure to " | 482 DVLOG(1) << "Suppressing referrer header since going from secure to " |
| 482 "non-secure"; | 483 "non-secure"; |
| 483 referrer = GURL(); | 484 referrer = GURL(); |
| 484 } | 485 } |
| 485 | 486 |
| 486 // Get the resource type (main_frame/script/image/stylesheet etc. | 487 // Get the resource type (main_frame/script/image/stylesheet etc. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 if (!is_done()) { | 532 if (!is_done()) { |
| 532 NotifyDone(request_status_); | 533 NotifyDone(request_status_); |
| 533 } | 534 } |
| 534 // Reset any pending reads. | 535 // Reset any pending reads. |
| 535 if (pending_buf_) { | 536 if (pending_buf_) { |
| 536 pending_buf_ = NULL; | 537 pending_buf_ = NULL; |
| 537 pending_buf_size_ = 0; | 538 pending_buf_size_ = 0; |
| 538 NotifyReadComplete(0); | 539 NotifyReadComplete(0); |
| 539 } | 540 } |
| 540 } | 541 } |
| OLD | NEW |