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

Unified Diff: content/browser/frame_host/navigation_handle_impl.h

Issue 1616943003: Teach navigation throttles how to cancel requests in WillProcessResponse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 11 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
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_handle_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_handle_impl.h
diff --git a/content/browser/frame_host/navigation_handle_impl.h b/content/browser/frame_host/navigation_handle_impl.h
index 6248b18accd8b00aeed381575909ca6fac07f16f..f5ce726575ac464eb8cfe115cfa0aa4f663afe63 100644
--- a/content/browser/frame_host/navigation_handle_impl.h
+++ b/content/browser/frame_host/navigation_handle_impl.h
@@ -162,6 +162,18 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
scoped_refptr<net::HttpResponseHeaders> response_headers,
const ThrottleChecksFinishedCallback& callback);
+ // Called when the URLRequest has delivered response headers and metadata.
+ // |callback| will be called when all throttle checks have completed,
+ // allowing the caller to cancel the navigation or let it proceed.
+ // NavigationHandle will not call |callback| with a result of DEFER.
+ // If the result is PROCEED, then 'ReadyToCommitNavigation' will be called
+ // with |render_frame_host| and |response_headers| just before calling
+ // |callback|.
+ void WillProcessResponse(
+ RenderFrameHostImpl* render_frame_host,
+ scoped_refptr<net::HttpResponseHeaders> response_headers,
+ const ThrottleChecksFinishedCallback& callback);
+
// Returns the FrameTreeNode this navigation is happening in.
FrameTreeNode* frame_tree_node() { return frame_tree_node_; }
@@ -194,6 +206,8 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
WILL_REDIRECT_REQUEST,
DEFERRING_REDIRECT,
CANCELING,
+ WILL_PROCESS_RESPONSE,
+ DEFERRING_RESPONSE,
READY_TO_COMMIT,
DID_COMMIT,
DID_COMMIT_ERROR_PAGE,
@@ -205,6 +219,7 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
NavigationThrottle::ThrottleCheckResult CheckWillStartRequest();
NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest();
+ NavigationThrottle::ThrottleCheckResult CheckWillProcessResponse();
// Helper function to run and reset the |complete_callback_|. This marks the
// end of a round of NavigationThrottleChecks.
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_handle_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698