| 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 CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_ |
| 7 | 7 |
| 8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // If the NavigationHandle is destroyed while the navigation is deferred, | 25 // If the NavigationHandle is destroyed while the navigation is deferred, |
| 26 // the navigation will be canceled in the network stack. | 26 // the navigation will be canceled in the network stack. |
| 27 DEFER, | 27 DEFER, |
| 28 | 28 |
| 29 // Cancels the navigation. | 29 // Cancels the navigation. |
| 30 CANCEL, | 30 CANCEL, |
| 31 | 31 |
| 32 // Cancels the navigation and makes the requester of the navigation acts | 32 // Cancels the navigation and makes the requester of the navigation acts |
| 33 // like the request was never made. | 33 // like the request was never made. |
| 34 CANCEL_AND_IGNORE, | 34 CANCEL_AND_IGNORE, |
| 35 |
| 36 // Blocks a navigation due to rules asserted before the request is made. |
| 37 // This can only be returned from WillStartRequest. This will result in an |
| 38 // error page for net::ERR_BLOCKED_BY_CLIENT being loaded in the frame that |
| 39 // is navigated. |
| 40 BLOCK_REQUEST, |
| 35 }; | 41 }; |
| 36 | 42 |
| 37 NavigationThrottle(NavigationHandle* navigation_handle); | 43 NavigationThrottle(NavigationHandle* navigation_handle); |
| 38 virtual ~NavigationThrottle(); | 44 virtual ~NavigationThrottle(); |
| 39 | 45 |
| 40 // Called when a network request is about to be made for this navigation. | 46 // Called when a network request is about to be made for this navigation. |
| 41 // | 47 // |
| 42 // The implementer is responsible for ensuring that the WebContents this | 48 // The implementer is responsible for ensuring that the WebContents this |
| 43 // throttle is associated with remain alive during the duration of this | 49 // throttle is associated with remain alive during the duration of this |
| 44 // method. Failing to do so will result in use-after-free bugs. Should the | 50 // method. Failing to do so will result in use-after-free bugs. Should the |
| (...skipping 23 matching lines...) Expand all Loading... |
| 68 // navigation. | 74 // navigation. |
| 69 NavigationHandle* navigation_handle() const { return navigation_handle_; } | 75 NavigationHandle* navigation_handle() const { return navigation_handle_; } |
| 70 | 76 |
| 71 private: | 77 private: |
| 72 NavigationHandle* navigation_handle_; | 78 NavigationHandle* navigation_handle_; |
| 73 }; | 79 }; |
| 74 | 80 |
| 75 } // namespace content | 81 } // namespace content |
| 76 | 82 |
| 77 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_ | 83 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_ |
| OLD | NEW |