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

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: rebase && 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 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::InitServiceWorkerHandle( 314 void NavigationHandleImpl::InitServiceWorkerHandle(
302 ServiceWorkerContextWrapper* service_worker_context) { 315 ServiceWorkerContextWrapper* service_worker_context) {
303 DCHECK(IsBrowserSideNavigationEnabled()); 316 DCHECK(IsBrowserSideNavigationEnabled());
304 service_worker_handle_.reset( 317 service_worker_handle_.reset(
305 new ServiceWorkerNavigationHandle(service_worker_context)); 318 new ServiceWorkerNavigationHandle(service_worker_context));
306 } 319 }
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 complete_callback_.Reset(); 548 complete_callback_.Reset();
536 549
537 if (!callback.is_null()) 550 if (!callback.is_null())
538 callback.Run(result); 551 callback.Run(result);
539 552
540 // No code after running the callback, as it might have resulted in our 553 // No code after running the callback, as it might have resulted in our
541 // destruction. 554 // destruction.
542 } 555 }
543 556
544 } // namespace content 557 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698