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

Side by Side Diff: net/url_request/url_request.cc

Issue 106683004: Revert of Add a check that we don't send a secure referrer to an insecure URL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "net/url_request/url_request.h" 5 #include "net/url_request/url_request.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/debug/dump_without_crashing.h"
12 #include "base/debug/stack_trace.h" 11 #include "base/debug/stack_trace.h"
13 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
14 #include "base/memory/singleton.h" 13 #include "base/memory/singleton.h"
15 #include "base/message_loop/message_loop.h" 14 #include "base/message_loop/message_loop.h"
16 #include "base/metrics/histogram.h" 15 #include "base/metrics/histogram.h"
17 #include "base/metrics/stats_counters.h" 16 #include "base/metrics/stats_counters.h"
18 #include "base/stl_util.h" 17 #include "base/stl_util.h"
19 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
20 #include "base/synchronization/lock.h" 19 #include "base/synchronization/lock.h"
21 #include "base/values.h" 20 #include "base/values.h"
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 job_->SetPriority(priority_); 677 job_->SetPriority(priority_);
679 678
680 if (upload_data_stream_.get()) 679 if (upload_data_stream_.get())
681 job_->SetUpload(upload_data_stream_.get()); 680 job_->SetUpload(upload_data_stream_.get());
682 681
683 is_pending_ = true; 682 is_pending_ = true;
684 is_redirecting_ = false; 683 is_redirecting_ = false;
685 684
686 response_info_.was_cached = false; 685 response_info_.was_cached = false;
687 686
688 // If the referrer is secure, but the requested URL is not, the referrer
689 // policy should be something non-default. If you hit this, please file a
690 // bug.
691 if (referrer_policy_ ==
692 CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE &&
693 GURL(referrer_).SchemeIsSecure() && !url().SchemeIsSecure()) {
694 DLOG(FATAL) << "Trying to send secure referrer for insecure load";
695 base::debug::DumpWithoutCrashing();
696 referrer_.clear();
697 }
698
699 // Don't allow errors to be sent from within Start(). 687 // Don't allow errors to be sent from within Start().
700 // TODO(brettw) this may cause NotifyDone to be sent synchronously, 688 // TODO(brettw) this may cause NotifyDone to be sent synchronously,
701 // we probably don't want this: they should be sent asynchronously so 689 // we probably don't want this: they should be sent asynchronously so
702 // the caller does not get reentered. 690 // the caller does not get reentered.
703 job_->Start(); 691 job_->Start();
704 } 692 }
705 693
706 void URLRequest::Restart() { 694 void URLRequest::Restart() {
707 // Should only be called if the original job didn't make any progress. 695 // Should only be called if the original job didn't make any progress.
708 DCHECK(job_.get() && !job_->has_response_started()); 696 DCHECK(job_.get() && !job_->has_response_started());
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 new base::debug::StackTrace(NULL, 0); 1191 new base::debug::StackTrace(NULL, 0);
1204 *stack_trace_copy = stack_trace; 1192 *stack_trace_copy = stack_trace;
1205 stack_trace_.reset(stack_trace_copy); 1193 stack_trace_.reset(stack_trace_copy);
1206 } 1194 }
1207 1195
1208 const base::debug::StackTrace* URLRequest::stack_trace() const { 1196 const base::debug::StackTrace* URLRequest::stack_trace() const {
1209 return stack_trace_.get(); 1197 return stack_trace_.get();
1210 } 1198 }
1211 1199
1212 } // namespace net 1200 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698