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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 // Called when a response's headers and metadata are available. | 70 // Called when a response's headers and metadata are available. |
71 // | 71 // |
72 // The implementer is responsible for ensuring that the WebContents this | 72 // The implementer is responsible for ensuring that the WebContents this |
73 // throttle is associated with remain alive during the duration of this | 73 // throttle is associated with remain alive during the duration of this |
74 // method. Failing to do so will result in use-after-free bugs. Should the | 74 // method. Failing to do so will result in use-after-free bugs. Should the |
75 // implementer need to destroy the WebContents, it should return CANCEL, | 75 // implementer need to destroy the WebContents, it should return CANCEL, |
76 // CANCEL_AND_IGNORE, or BLOCK_RESPONSE and perform the destruction | 76 // CANCEL_AND_IGNORE, or BLOCK_RESPONSE and perform the destruction |
77 // asynchronously. | 77 // asynchronously. |
78 virtual ThrottleCheckResult WillProcessResponse(); | 78 virtual ThrottleCheckResult WillProcessResponse(); |
79 | 79 |
80 // Returns the name of the throttle for logging purposes. It must not return | |
81 // nullptr. | |
82 virtual const char* GetNameForLogging(); | |
clamy
2017/04/24 12:30:22
Should we make this pure virtual to ensure that im
nasko
2017/04/24 14:06:39
Yes. Meant to, but missed it. Thanks!
| |
83 | |
80 // The NavigationHandle that is tracking the information related to this | 84 // The NavigationHandle that is tracking the information related to this |
81 // navigation. | 85 // navigation. |
82 NavigationHandle* navigation_handle() const { return navigation_handle_; } | 86 NavigationHandle* navigation_handle() const { return navigation_handle_; } |
83 | 87 |
84 private: | 88 private: |
85 NavigationHandle* navigation_handle_; | 89 NavigationHandle* navigation_handle_; |
86 }; | 90 }; |
87 | 91 |
88 } // namespace content | 92 } // namespace content |
89 | 93 |
90 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_ | 94 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_ |
OLD | NEW |