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 "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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 475 if (!new_request_headers.HasHeader( | 475 if (!new_request_headers.HasHeader( |
| 476 net::HttpRequestHeaders::kAcceptCharset) && | 476 net::HttpRequestHeaders::kAcceptCharset) && |
| 477 http_user_agent_settings_) { | 477 http_user_agent_settings_) { |
| 478 std::string accept_charset = http_user_agent_settings_->GetAcceptCharset(); | 478 std::string accept_charset = http_user_agent_settings_->GetAcceptCharset(); |
| 479 if (!accept_charset.empty()) { | 479 if (!accept_charset.empty()) { |
| 480 new_request_headers.SetHeader(net::HttpRequestHeaders::kAcceptCharset, | 480 new_request_headers.SetHeader(net::HttpRequestHeaders::kAcceptCharset, |
| 481 accept_charset); | 481 accept_charset); |
| 482 } | 482 } |
| 483 } | 483 } |
| 484 | 484 |
| 485 // Ensure that we do not send username and password fields in the referrer. | 485 // URLRequest::SetReferrer() ensures that |
|
pauljensen
2013/03/15 21:50:00
Can you move more words onto this line to bring it
mef
2013/03/18 16:42:07
Done.
| |
| 486 GURL referrer(request_->GetSanitizedReferrer()); | 486 // we do not send username and password fields in the referrer. |
| 487 GURL referrer(request_->referrer()); | |
| 487 | 488 |
| 488 // The referrer header must be suppressed if the preceding URL was | 489 // The referrer header must be suppressed if the preceding URL was |
| 489 // a secure one and the new one is not. | 490 // a secure one and the new one is not. |
| 490 if (referrer.SchemeIsSecure() && !request_->url().SchemeIsSecure()) { | 491 if (referrer.SchemeIsSecure() && !request_->url().SchemeIsSecure()) { |
| 491 DVLOG(1) << "Suppressing referrer header since going from secure to " | 492 DVLOG(1) << "Suppressing referrer header since going from secure to " |
| 492 "non-secure"; | 493 "non-secure"; |
| 493 referrer = GURL(); | 494 referrer = GURL(); |
| 494 } | 495 } |
| 495 | 496 |
| 496 // Get the resource type (main_frame/script/image/stylesheet etc. | 497 // Get the resource type (main_frame/script/image/stylesheet etc. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 541 if (!is_done()) { | 542 if (!is_done()) { |
| 542 NotifyDone(request_status_); | 543 NotifyDone(request_status_); |
| 543 } | 544 } |
| 544 // Reset any pending reads. | 545 // Reset any pending reads. |
| 545 if (pending_buf_) { | 546 if (pending_buf_) { |
| 546 pending_buf_ = NULL; | 547 pending_buf_ = NULL; |
| 547 pending_buf_size_ = 0; | 548 pending_buf_size_ = 0; |
| 548 NotifyReadComplete(0); | 549 NotifyReadComplete(0); |
| 549 } | 550 } |
| 550 } | 551 } |
| OLD | NEW |