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

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

Issue 2696493003: Introduce SubframeNavigationFilteringThrottle (Closed)
Patch Set: s/proceed2/allowed2/ (trybots prev) 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_handle_impl.h
diff --git a/content/browser/frame_host/navigation_handle_impl.h b/content/browser/frame_host/navigation_handle_impl.h
index 3a460592222cbb92be3cf6bd10c8fc36d129ff6e..02a7625f2182b704cc81344dd8bcc7fc7e72afee 100644
--- a/content/browser/frame_host/navigation_handle_impl.h
+++ b/content/browser/frame_host/navigation_handle_impl.h
@@ -131,22 +131,24 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
const Referrer& sanitized_referrer,
bool has_user_gesture,
ui::PageTransition transition,
- bool is_external_protocol) override;
+ bool is_external_protocol,
+ const ThrottleChecksFinishedCallback& complete_callback) override;
NavigationThrottle::ThrottleCheckResult CallWillRedirectRequestForTesting(
const GURL& new_url,
bool new_method_is_post,
const GURL& new_referrer_url,
- bool new_is_external_protocol) override;
+ bool new_is_external_protocol,
+ const ThrottleChecksFinishedCallback& complete_callback) override;
NavigationThrottle::ThrottleCheckResult CallWillProcessResponseForTesting(
RenderFrameHost* render_frame_host,
- const std::string& raw_response_header) override;
+ const std::string& raw_response_header,
+ const ThrottleChecksFinishedCallback& complete_callback) override;
void CallDidCommitNavigationForTesting(const GURL& url) override;
bool WasStartedFromContextMenu() const override;
const GURL& GetSearchableFormURL() override;
const std::string& GetSearchableFormEncoding() override;
ReloadType GetReloadType() override;
const GlobalRequestID& GetGlobalRequestID() override;
-
NavigationData* GetNavigationData() override;
// The NavigatorDelegate to notify/query for various navigation events.
@@ -223,13 +225,12 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
return appcache_handle_.get();
}
- typedef base::Callback<void(NavigationThrottle::ThrottleCheckResult)>
- ThrottleChecksFinishedCallback;
-
// Called when the URLRequest will start in the network stack. |callback|
// will be called when all throttle checks have completed. This will allow
// the caller to cancel the navigation or let it proceed.
- void WillStartRequest(
+ // Returns the synchronous throttle check result, or DEFER if it is being
+ // calculated asynchronously.
+ NavigationThrottle::ThrottleCheckResult WillStartRequest(
clamy 2017/02/15 16:37:22 I'm don't really like having the result be returne
Charlie Harrison 2017/02/15 16:42:12 What would you prefer? One idea is to have the cal
clamy 2017/02/16 14:10:43 I really don't want to be modifying the semantic o
const std::string& method,
scoped_refptr<content::ResourceRequestBodyImpl> resource_request_body,
const Referrer& sanitized_referrer,
@@ -244,7 +245,9 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
// |callback| will be called when all throttles check have completed. This
// will allow the caller to cancel the navigation or let it proceed.
// This will also inform the delegate that the request was redirected.
- void WillRedirectRequest(
+ // Returns the synchronous throttle check result, or DEFER if it is being
+ // calculated asynchronously.
+ NavigationThrottle::ThrottleCheckResult WillRedirectRequest(
const GURL& new_url,
const std::string& new_method,
const GURL& new_referrer_url,
@@ -261,8 +264,10 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
// with |render_frame_host| and |response_headers| just before calling
// |callback|. Should a transfer navigation happen, |transfer_callback| will
// be run on the IO thread.
+ // Returns the synchronous throttle check result, or DEFER if it is being
+ // calculated asynchronously.
// PlzNavigate: transfer navigations are not possible.
- void WillProcessResponse(
+ NavigationThrottle::ThrottleCheckResult WillProcessResponse(
RenderFrameHostImpl* render_frame_host,
scoped_refptr<net::HttpResponseHeaders> response_headers,
net::HttpResponseInfo::ConnectionInfo connection_info,

Powered by Google App Engine
This is Rietveld 408576698