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

Side by Side Diff: chrome/browser/component/navigation_interception/intercept_navigation_resource_throttle.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, 1 month 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 | chrome/browser/profiles/profile_impl_io_data.cc » ('j') | 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 "chrome/browser/component/navigation_interception/intercept_navigation_ resource_throttle.h" 5 #include "chrome/browser/component/navigation_interception/intercept_navigation_ resource_throttle.h"
6 6
7 #include "content/public/browser/browser_thread.h" 7 #include "content/public/browser/browser_thread.h"
8 #include "content/public/browser/child_process_security_policy.h" 8 #include "content/public/browser/child_process_security_policy.h"
9 #include "content/public/browser/render_view_host.h" 9 #include "content/public/browser/render_view_host.h"
10 #include "content/public/browser/render_process_host.h" 10 #include "content/public/browser/render_process_host.h"
(...skipping 21 matching lines...) Expand all
32 InterceptNavigationResourceThrottle::CheckOnUIThreadCallback 32 InterceptNavigationResourceThrottle::CheckOnUIThreadCallback
33 should_ignore_callback, 33 should_ignore_callback,
34 base::Callback<void(bool)> callback) { 34 base::Callback<void(bool)> callback) {
35 35
36 bool should_ignore_navigation = false; 36 bool should_ignore_navigation = false;
37 RenderViewHost* rvh = 37 RenderViewHost* rvh =
38 RenderViewHost::FromID(render_process_id, render_view_id); 38 RenderViewHost::FromID(render_process_id, render_view_id);
39 39
40 if (rvh) { 40 if (rvh) {
41 GURL validated_url(url); 41 GURL validated_url(url);
42 RenderViewHost::FilterURL( 42 RenderViewHost::FilterURL(rvh->GetProcess(), false, &validated_url);
43 rvh->GetProcess()->GetID(),
44 false,
45 &validated_url);
46 43
47 should_ignore_navigation = should_ignore_callback.Run( 44 should_ignore_navigation = should_ignore_callback.Run(
48 rvh, validated_url, referrer, has_user_gesture); 45 rvh, validated_url, referrer, has_user_gesture);
49 } 46 }
50 47
51 BrowserThread::PostTask( 48 BrowserThread::PostTask(
52 BrowserThread::IO, 49 BrowserThread::IO,
53 FROM_HERE, 50 FROM_HERE,
54 base::Bind(callback, should_ignore_navigation)); 51 base::Bind(callback, should_ignore_navigation));
55 } 52 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 113 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
117 114
118 if (should_ignore_navigation) { 115 if (should_ignore_navigation) {
119 controller()->CancelAndIgnore(); 116 controller()->CancelAndIgnore();
120 } else { 117 } else {
121 controller()->Resume(); 118 controller()->Resume();
122 } 119 }
123 } 120 }
124 121
125 } // namespace navigation_interception 122 } // namespace navigation_interception
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_impl_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698