OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |