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

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

Issue 1414723008: Add a way to cancel deferred navigations in NavigationHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 1 month 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 6f46707108e531ceac132639638d387611e5710f..a72e774e78dad5b6e13a1258daa021a19e521e27 100644
--- a/content/browser/frame_host/navigation_handle_impl.h
+++ b/content/browser/frame_host/navigation_handle_impl.h
@@ -76,6 +76,8 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
bool HasCommitted() override;
bool IsErrorPage() override;
void Resume() override;
+ void CancelDeferredNavigation(
+ NavigationThrottle::ThrottleCheckResult result) override;
void RegisterThrottleForTesting(
scoped_ptr<NavigationThrottle> navigation_throttle) override;
NavigationThrottle::ThrottleCheckResult CallWillStartRequestForTesting(
@@ -156,6 +158,7 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
DEFERRING_START,
WILL_REDIRECT_REQUEST,
DEFERRING_REDIRECT,
+ CANCELING,
READY_TO_COMMIT,
DID_COMMIT,
DID_COMMIT_ERROR_PAGE,
@@ -167,6 +170,10 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
NavigationThrottle::ThrottleCheckResult CheckWillStartRequest();
NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest();
+ // Helper function to run and reset the |complete_callback_|. This marks the
+ // end of a round of NavigationThrottleChecks.
+ void RunCompleteCallback(NavigationThrottle::ThrottleCheckResult result);
+
// Used in tests.
State state() const { return state_; }

Powered by Google App Engine
This is Rietveld 408576698