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

Side by Side Diff: content/browser/frame_host/navigation_handle_impl.cc

Issue 2060313002: Navigation throttle for the Safe Browsing Subresource Filter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pre-tab-activation
Patch Set: clamy@ comments Created 4 years, 5 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 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/frame_host/navigation_handle_impl.h" 5 #include "content/browser/frame_host/navigation_handle_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/browser/frame_host/frame_tree_node.h" 10 #include "content/browser/frame_host/frame_tree_node.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 WillRedirectRequest(new_url, new_method_is_post ? "POST" : "GET", 286 WillRedirectRequest(new_url, new_method_is_post ? "POST" : "GET",
287 new_referrer_url, new_is_external_protocol, 287 new_referrer_url, new_is_external_protocol,
288 scoped_refptr<net::HttpResponseHeaders>(), 288 scoped_refptr<net::HttpResponseHeaders>(),
289 base::Bind(&UpdateThrottleCheckResult, &result)); 289 base::Bind(&UpdateThrottleCheckResult, &result));
290 290
291 // Reset the callback to ensure it will not be called later. 291 // Reset the callback to ensure it will not be called later.
292 complete_callback_.Reset(); 292 complete_callback_.Reset();
293 return result; 293 return result;
294 } 294 }
295 295
296 NavigationThrottle::ThrottleCheckResult
297 NavigationHandleImpl::CallWillProcessResponseForTesting(
298 content::RenderFrameHost* render_frame_host) {
299 NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER;
300 WillProcessResponse(static_cast<RenderFrameHostImpl*>(render_frame_host),
301 scoped_refptr<net::HttpResponseHeaders>(),
302 base::Bind(&UpdateThrottleCheckResult, &result));
303
304 // Reset the callback to ensure it will not be called later.
305 complete_callback_.Reset();
306 return result;
307 }
308
296 NavigationData* NavigationHandleImpl::GetNavigationData() { 309 NavigationData* NavigationHandleImpl::GetNavigationData() {
297 return navigation_data_.get(); 310 return navigation_data_.get();
298 } 311 }
299 312
300 void NavigationHandleImpl::WillStartRequest( 313 void NavigationHandleImpl::WillStartRequest(
301 const std::string& method, 314 const std::string& method,
302 scoped_refptr<content::ResourceRequestBodyImpl> resource_request_body, 315 scoped_refptr<content::ResourceRequestBodyImpl> resource_request_body,
303 const Referrer& sanitized_referrer, 316 const Referrer& sanitized_referrer,
304 bool has_user_gesture, 317 bool has_user_gesture,
305 ui::PageTransition transition, 318 ui::PageTransition transition,
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 complete_callback_.Reset(); 540 complete_callback_.Reset();
528 541
529 if (!callback.is_null()) 542 if (!callback.is_null())
530 callback.Run(result); 543 callback.Run(result);
531 544
532 // No code after running the callback, as it might have resulted in our 545 // No code after running the callback, as it might have resulted in our
533 // destruction. 546 // destruction.
534 } 547 }
535 548
536 } // namespace content 549 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698