OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_NAVIGATION_INTERCEPTION_INTERCEPT_NAVIGATION_THROTTLE_H_ | 5 #ifndef COMPONENTS_NAVIGATION_INTERCEPTION_INTERCEPT_NAVIGATION_THROTTLE_H_ |
6 #define COMPONENTS_NAVIGATION_INTERCEPTION_INTERCEPT_NAVIGATION_THROTTLE_H_ | 6 #define COMPONENTS_NAVIGATION_INTERCEPTION_INTERCEPT_NAVIGATION_THROTTLE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 // content::NavigationThrottle implementation: | 39 // content::NavigationThrottle implementation: |
40 ThrottleCheckResult WillStartRequest() override; | 40 ThrottleCheckResult WillStartRequest() override; |
41 ThrottleCheckResult WillRedirectRequest() override; | 41 ThrottleCheckResult WillRedirectRequest() override; |
42 | 42 |
43 private: | 43 private: |
44 ThrottleCheckResult CheckIfShouldIgnoreNavigation(bool is_redirect); | 44 ThrottleCheckResult CheckIfShouldIgnoreNavigation(bool is_redirect); |
45 | 45 |
46 // Called to perform the checks asynchronously | 46 // Called to perform the checks asynchronously |
47 void RunCallbackAsynchronously(const NavigationParams& navigation_params); | 47 void RunCallbackAsynchronously(const NavigationParams& navigation_params); |
48 void OnAsynchronousChecksPerformed(bool should_ignore_navigation); | 48 // TODO(clamy): remove |throttle_was_destroyed| once crbug.com/570200 is |
| 49 // fixed. |
| 50 void OnAsynchronousChecksPerformed(bool should_ignore_navigation, |
| 51 bool throttle_was_destroyed); |
49 | 52 |
50 CheckCallback should_ignore_callback_; | 53 CheckCallback should_ignore_callback_; |
51 | 54 |
52 // Whether the callback will be run synchronously or not. If the callback can | 55 // Whether the callback will be run synchronously or not. If the callback can |
53 // lead to the destruction of the WebContents, this should be false. | 56 // lead to the destruction of the WebContents, this should be false. |
54 // Otherwise this should be true. | 57 // Otherwise this should be true. |
55 const bool run_callback_synchronously_; | 58 const bool run_callback_synchronously_; |
56 | 59 |
57 base::WeakPtrFactory<InterceptNavigationThrottle> weak_factory_; | 60 base::WeakPtrFactory<InterceptNavigationThrottle> weak_factory_; |
58 | 61 |
59 DISALLOW_COPY_AND_ASSIGN(InterceptNavigationThrottle); | 62 DISALLOW_COPY_AND_ASSIGN(InterceptNavigationThrottle); |
60 }; | 63 }; |
61 | 64 |
62 } // namespace navigation_interception | 65 } // namespace navigation_interception |
63 | 66 |
64 #endif // COMPONENTS_NAVIGATION_INTERCEPTION_INTERCEPT_NAVIGATION_THROTTLE_H_ | 67 #endif // COMPONENTS_NAVIGATION_INTERCEPTION_INTERCEPT_NAVIGATION_THROTTLE_H_ |
OLD | NEW |