Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: chrome/browser/automation/url_request_automation_job.cc

Issue 12569007: Remove URL fragment from referrer HTTP header when opening link using "Open Link in New Tab" option. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert testserver.py changes Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 // Ensure that we do not send username and password fields in the referrer.
pauljensen 2013/03/14 18:53:44 This comment doesn't make as much sense now that t
mef 2013/03/14 20:31:38 Done.
486 GURL referrer(request_->GetSanitizedReferrer()); 486 GURL referrer(request_->referrer());
487 487
488 // The referrer header must be suppressed if the preceding URL was 488 // The referrer header must be suppressed if the preceding URL was
489 // a secure one and the new one is not. 489 // a secure one and the new one is not.
490 if (referrer.SchemeIsSecure() && !request_->url().SchemeIsSecure()) { 490 if (referrer.SchemeIsSecure() && !request_->url().SchemeIsSecure()) {
491 DVLOG(1) << "Suppressing referrer header since going from secure to " 491 DVLOG(1) << "Suppressing referrer header since going from secure to "
492 "non-secure"; 492 "non-secure";
493 referrer = GURL(); 493 referrer = GURL();
494 } 494 }
495 495
496 // Get the resource type (main_frame/script/image/stylesheet etc. 496 // Get the resource type (main_frame/script/image/stylesheet etc.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 if (!is_done()) { 541 if (!is_done()) {
542 NotifyDone(request_status_); 542 NotifyDone(request_status_);
543 } 543 }
544 // Reset any pending reads. 544 // Reset any pending reads.
545 if (pending_buf_) { 545 if (pending_buf_) {
546 pending_buf_ = NULL; 546 pending_buf_ = NULL;
547 pending_buf_size_ = 0; 547 pending_buf_size_ = 0;
548 NotifyReadComplete(0); 548 NotifyReadComplete(0);
549 } 549 }
550 } 550 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/chrome_network_delegate.cc » ('j') | chrome/browser/tab_contents/render_view_context_menu.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698