OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/browser/loader/navigation_resource_throttle.h" | 5 #include "content/browser/loader/navigation_resource_throttle.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 DCHECK_NE(result, NavigationThrottle::DEFER); | 39 DCHECK_NE(result, NavigationThrottle::DEFER); |
40 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 40 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
41 base::Bind(callback, result)); | 41 base::Bind(callback, result)); |
42 } | 42 } |
43 | 43 |
44 void CheckWillStartRequestOnUIThread( | 44 void CheckWillStartRequestOnUIThread( |
45 UIChecksPerformedCallback callback, | 45 UIChecksPerformedCallback callback, |
46 int render_process_id, | 46 int render_process_id, |
47 int render_frame_host_id, | 47 int render_frame_host_id, |
48 const std::string& method, | 48 const std::string& method, |
49 const scoped_refptr<content::ResourceRequestBody>& resource_request_body, | 49 const scoped_refptr<content::ResourceRequestBodyImpl>& |
| 50 resource_request_body, |
50 const Referrer& sanitized_referrer, | 51 const Referrer& sanitized_referrer, |
51 bool has_user_gesture, | 52 bool has_user_gesture, |
52 ui::PageTransition transition, | 53 ui::PageTransition transition, |
53 bool is_external_protocol) { | 54 bool is_external_protocol) { |
54 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 55 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
55 RenderFrameHostImpl* render_frame_host = | 56 RenderFrameHostImpl* render_frame_host = |
56 RenderFrameHostImpl::FromID(render_process_id, render_frame_host_id); | 57 RenderFrameHostImpl::FromID(render_process_id, render_frame_host_id); |
57 if (!render_frame_host) { | 58 if (!render_frame_host) { |
58 SendCheckResultToIOThread(callback, NavigationThrottle::PROCEED); | 59 SendCheckResultToIOThread(callback, NavigationThrottle::PROCEED); |
59 return; | 60 return; |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 } else if (result == NavigationThrottle::CANCEL) { | 270 } else if (result == NavigationThrottle::CANCEL) { |
270 controller()->Cancel(); | 271 controller()->Cancel(); |
271 } else if (result == NavigationThrottle::BLOCK_REQUEST) { | 272 } else if (result == NavigationThrottle::BLOCK_REQUEST) { |
272 controller()->CancelWithError(net::ERR_BLOCKED_BY_CLIENT); | 273 controller()->CancelWithError(net::ERR_BLOCKED_BY_CLIENT); |
273 } else { | 274 } else { |
274 controller()->Resume(); | 275 controller()->Resume(); |
275 } | 276 } |
276 } | 277 } |
277 | 278 |
278 } // namespace content | 279 } // namespace content |
OLD | NEW |