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

Side by Side Diff: components/navigation_interception/intercept_navigation_resource_throttle.cc

Issue 898613004: Sanitize referrers before we create them (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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 "components/navigation_interception/intercept_navigation_resource_throt tle.h" 5 #include "components/navigation_interception/intercept_navigation_resource_throt tle.h"
6 6
7 #include "components/navigation_interception/navigation_params.h" 7 #include "components/navigation_interception/navigation_params.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "content/public/browser/child_process_security_policy.h" 9 #include "content/public/browser/child_process_security_policy.h"
10 #include "content/public/browser/render_frame_host.h" 10 #include "content/public/browser/render_frame_host.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 return false; 110 return false;
111 111
112 int render_process_id, render_frame_id; 112 int render_process_id, render_frame_id;
113 if (!info->GetAssociatedRenderFrame(&render_process_id, &render_frame_id)) 113 if (!info->GetAssociatedRenderFrame(&render_process_id, &render_frame_id))
114 return false; 114 return false;
115 115
116 bool is_external_protocol = 116 bool is_external_protocol =
117 !info->GetContext()->GetRequestContext()->job_factory()->IsHandledURL( 117 !info->GetContext()->GetRequestContext()->job_factory()->IsHandledURL(
118 url); 118 url);
119 NavigationParams navigation_params( 119 NavigationParams navigation_params(
120 url, Referrer(GURL(request_->referrer()), info->GetReferrerPolicy()), 120 url,
121 Referrer::SanitizeForRequest(
122 url, Referrer(GURL(request_->referrer()), info->GetReferrerPolicy())),
121 info->HasUserGesture(), method == "POST", info->GetPageTransition(), 123 info->HasUserGesture(), method == "POST", info->GetPageTransition(),
122 is_redirect, is_external_protocol); 124 is_redirect, is_external_protocol);
123 125
124 BrowserThread::PostTask( 126 BrowserThread::PostTask(
125 BrowserThread::UI, 127 BrowserThread::UI,
126 FROM_HERE, 128 FROM_HERE,
127 base::Bind( 129 base::Bind(
128 &CheckIfShouldIgnoreNavigationOnUIThread, 130 &CheckIfShouldIgnoreNavigationOnUIThread,
129 render_process_id, 131 render_process_id,
130 render_frame_id, 132 render_frame_id,
(...skipping 13 matching lines...) Expand all
144 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 146 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
145 147
146 if (should_ignore_navigation) { 148 if (should_ignore_navigation) {
147 controller()->CancelAndIgnore(); 149 controller()->CancelAndIgnore();
148 } else { 150 } else {
149 controller()->Resume(); 151 controller()->Resume();
150 } 152 }
151 } 153 }
152 154
153 } // namespace navigation_interception 155 } // namespace navigation_interception
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698