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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 11313018: Prevent webview tags from navigating outside web-safe schemes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nit Created 8 years, 2 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 | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/public/browser/render_view_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 0aa2a724ed88dd34d8ebd6164723fa6040930003..96bed33c4603d1796920f817bff22be9899c3e83 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1957,14 +1957,8 @@ void WebContentsImpl::DidStartProvisionalLoadForFrame(
GURL validated_opener_url(opener_url);
RenderProcessHost* render_process_host =
render_view_host->GetProcess();
- RenderViewHost::FilterURL(
- render_process_host->GetID(),
- false,
- &validated_url);
- RenderViewHost::FilterURL(
- render_process_host->GetID(),
- true,
- &validated_opener_url);
+ RenderViewHost::FilterURL(render_process_host, false, &validated_url);
+ RenderViewHost::FilterURL(render_process_host, true, &validated_opener_url);
// Notify observers about the start of the provisional load.
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
@@ -1995,21 +1989,9 @@ void WebContentsImpl::DidRedirectProvisionalLoad(
GURL validated_opener_url(opener_url);
RenderProcessHost* render_process_host =
render_view_host->GetProcess();
- RenderViewHostImpl::FilterURL(
- ChildProcessSecurityPolicyImpl::GetInstance(),
- render_process_host->GetID(),
- false,
- &validated_source_url);
- RenderViewHostImpl::FilterURL(
- ChildProcessSecurityPolicyImpl::GetInstance(),
- render_process_host->GetID(),
- false,
- &validated_target_url);
- RenderViewHostImpl::FilterURL(
- ChildProcessSecurityPolicyImpl::GetInstance(),
- render_process_host->GetID(),
- true,
- &validated_opener_url);
+ RenderViewHost::FilterURL(render_process_host, false, &validated_source_url);
+ RenderViewHost::FilterURL(render_process_host, false, &validated_target_url);
+ RenderViewHost::FilterURL(render_process_host, true, &validated_opener_url);
NavigationEntry* entry;
if (page_id == -1) {
entry = controller_.GetPendingEntry();
@@ -2040,10 +2022,7 @@ void WebContentsImpl::DidFailProvisionalLoadWithError(
GURL validated_url(params.url);
RenderProcessHost* render_process_host =
render_view_host->GetProcess();
- RenderViewHost::FilterURL(
- render_process_host->GetID(),
- false,
- &validated_url);
+ RenderViewHost::FilterURL(render_process_host, false, &validated_url);
if (net::ERR_ABORTED == params.error_code) {
// EVIL HACK ALERT! Ignore failed loads when we're showing interstitials.
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/public/browser/render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698