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

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: adressing engedy@ 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/devtools/render_frame_devtools_agent_host.h" 10 #include "content/browser/devtools/render_frame_devtools_agent_host.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 WillRedirectRequest(new_url, new_method_is_post ? "POST" : "GET", 287 WillRedirectRequest(new_url, new_method_is_post ? "POST" : "GET",
288 new_referrer_url, new_is_external_protocol, 288 new_referrer_url, new_is_external_protocol,
289 scoped_refptr<net::HttpResponseHeaders>(), 289 scoped_refptr<net::HttpResponseHeaders>(),
290 base::Bind(&UpdateThrottleCheckResult, &result)); 290 base::Bind(&UpdateThrottleCheckResult, &result));
291 291
292 // Reset the callback to ensure it will not be called later. 292 // Reset the callback to ensure it will not be called later.
293 complete_callback_.Reset(); 293 complete_callback_.Reset();
294 return result; 294 return result;
295 } 295 }
296 296
297 NavigationThrottle::ThrottleCheckResult
298 NavigationHandleImpl::CallWillProcessResponseForTesting(
299 content::RenderFrameHost* render_frame_host) {
300 NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER;
301 WillProcessResponse(static_cast<RenderFrameHostImpl*>(render_frame_host),
302 scoped_refptr<net::HttpResponseHeaders>(),
303 base::Bind(&UpdateThrottleCheckResult, &result));
304
305 // Reset the callback to ensure it will not be called later.
306 complete_callback_.Reset();
307 return result;
308 }
309
297 NavigationData* NavigationHandleImpl::GetNavigationData() { 310 NavigationData* NavigationHandleImpl::GetNavigationData() {
298 return navigation_data_.get(); 311 return navigation_data_.get();
299 } 312 }
300 313
301 void NavigationHandleImpl::WillStartRequest( 314 void NavigationHandleImpl::WillStartRequest(
302 const std::string& method, 315 const std::string& method,
303 scoped_refptr<content::ResourceRequestBodyImpl> resource_request_body, 316 scoped_refptr<content::ResourceRequestBodyImpl> resource_request_body,
304 const Referrer& sanitized_referrer, 317 const Referrer& sanitized_referrer,
305 bool has_user_gesture, 318 bool has_user_gesture,
306 ui::PageTransition transition, 319 ui::PageTransition transition,
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 throttles_to_register.end()); 549 throttles_to_register.end());
537 throttles_to_register.weak_clear(); 550 throttles_to_register.weak_clear();
538 } 551 }
539 std::unique_ptr<NavigationThrottle> devtools_throttle = 552 std::unique_ptr<NavigationThrottle> devtools_throttle =
540 RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this); 553 RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this);
541 if (devtools_throttle) 554 if (devtools_throttle)
542 throttles_.push_back(devtools_throttle.release()); 555 throttles_.push_back(devtools_throttle.release());
543 } 556 }
544 557
545 } // namespace content 558 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.h ('k') | content/public/browser/navigation_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698