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

Unified Diff: content/browser/frame_host/navigation_request.cc

Issue 2698393002: Allow asynchronous deferral in NavigationSimulator (Closed)
Patch Set: Just return the throttle check on Start/Redirect/COmmit Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigation_request.cc
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index 39d1cdda2295ceea1f59a44cc804be47a981b169..dd430368dca635eb7ad1b437d759224d59cbcd50 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -15,7 +15,6 @@
#include "content/browser/frame_host/frame_tree.h"
#include "content/browser/frame_host/frame_tree_node.h"
#include "content/browser/frame_host/navigation_controller_impl.h"
-#include "content/browser/frame_host/navigation_handle_impl.h"
#include "content/browser/frame_host/navigation_request_info.h"
#include "content/browser/frame_host/navigator.h"
#include "content/browser/frame_host/navigator_impl.h"
@@ -604,8 +603,8 @@ void NavigationRequest::OnStartChecksComplete(
DCHECK(result != NavigationThrottle::DEFER);
DCHECK(result != NavigationThrottle::BLOCK_RESPONSE);
- if (on_start_checks_complete_closure_)
- on_start_checks_complete_closure_.Run();
+ if (on_checks_complete_callback_)
+ on_checks_complete_callback_.Run(result);
// Abort the request if needed. This will destroy the NavigationRequest.
if (result == NavigationThrottle::CANCEL_AND_IGNORE ||
@@ -704,6 +703,8 @@ void NavigationRequest::OnRedirectChecksComplete(
DCHECK(result != NavigationThrottle::DEFER);
DCHECK(result != NavigationThrottle::BLOCK_RESPONSE);
+ if (on_checks_complete_callback_)
+ on_checks_complete_callback_.Run(result);
// Abort the request if needed. This will destroy the NavigationRequest.
if (result == NavigationThrottle::CANCEL_AND_IGNORE ||
result == NavigationThrottle::CANCEL) {
@@ -722,6 +723,9 @@ void NavigationRequest::OnWillProcessResponseChecksComplete(
NavigationThrottle::ThrottleCheckResult result) {
DCHECK(result != NavigationThrottle::DEFER);
+ if (on_checks_complete_callback_)
+ on_checks_complete_callback_.Run(result);
+
// Abort the request if needed. This includes requests that were blocked by
// NavigationThrottles and requests that should not commit (e.g. downloads,
// 204/205s). This will destroy the NavigationRequest.

Powered by Google App Engine
This is Rietveld 408576698