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

Unified Diff: content/child/resource_dispatcher.cc

Issue 105853004: Add a renderer side version of the referrer check in the net library (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 6 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/resource_dispatcher.cc
diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc
index 3da70c331b6dd391c79474f018086bc7ac75bbbd..70197b56ef77f30846187d53db59300b87b0575c 100644
--- a/content/child/resource_dispatcher.cc
+++ b/content/child/resource_dispatcher.cc
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/debug/alias.h"
+#include "base/debug/dump_without_crashing.h"
#include "base/files/file_path.h"
#include "base/memory/shared_memory.h"
#include "base/message_loop/message_loop.h"
@@ -117,6 +118,19 @@ IPCResourceLoaderBridge::IPCResourceLoaderBridge(
request_.first_party_for_cookies = request_info.first_party_for_cookies;
request_.referrer = request_info.referrer;
request_.referrer_policy = request_info.referrer_policy;
+ if (request_info.referrer_policy == blink::WebReferrerPolicyDefault &&
+ request_info.referrer.SchemeIsSecure() &&
+ !request_info.url.SchemeIsSecure()) {
+ // TODO(jochen): Remove before beta branches. http://crbug.com/331097
+ char url_buf[128];
+ base::strlcpy(url_buf, request_info.url.spec().c_str(), arraysize(url_buf));
+ base::debug::Alias(url_buf);
+ char ref_buf[128];
+ base::strlcpy(
+ ref_buf, request_info.referrer.spec().c_str(), arraysize(ref_buf));
+ base::debug::Alias(ref_buf);
+ base::debug::DumpWithoutCrashing();
+ }
request_.headers = request_info.headers;
request_.load_flags = request_info.load_flags;
request_.origin_pid = request_info.requestor_pid;
« 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