Index: components/navigation_interception/intercept_navigation_throttle.h |
diff --git a/components/navigation_interception/intercept_navigation_throttle.h b/components/navigation_interception/intercept_navigation_throttle.h |
index 0b7f74605378266e5e09a549127d53639e1617a4..7ce296380e6c428b5939017b7acb873139aa18a9 100644 |
--- a/components/navigation_interception/intercept_navigation_throttle.h |
+++ b/components/navigation_interception/intercept_navigation_throttle.h |
@@ -31,7 +31,8 @@ class InterceptNavigationThrottle : public content::NavigationThrottle { |
CheckCallback; |
InterceptNavigationThrottle(content::NavigationHandle* navigation_handle, |
- CheckCallback should_ignore_callback); |
+ CheckCallback should_ignore_callback, |
+ bool run_callback_synchronously); |
~InterceptNavigationThrottle() override; |
// content::NavigationThrottle implementation: |
@@ -41,8 +42,19 @@ class InterceptNavigationThrottle : public content::NavigationThrottle { |
private: |
ThrottleCheckResult CheckIfShouldIgnoreNavigation(bool is_redirect); |
+ // Called to perform the checks asynchronously |
+ void RunCallbackAsynchronously(const NavigationParams& navigation_params); |
+ void OnAsynchronousChecksPerformed(bool should_ignore_navigation); |
+ |
CheckCallback should_ignore_callback_; |
+ // Whether the callback will be run synchronously or not. If the callback can |
+ // lead to the destruction of the WebContents, this should be false. |
+ // Otherwise this should be true. |
+ const bool run_callback_synchronously_; |
+ |
+ base::WeakPtrFactory<InterceptNavigationThrottle> weak_factory_; |
+ |
DISALLOW_COPY_AND_ASSIGN(InterceptNavigationThrottle); |
}; |