summaryrefslogtreecommitdiff
path: root/chromium/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.h')
-rw-r--r--chromium/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.h26
1 files changed, 15 insertions, 11 deletions
diff --git a/chromium/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.h b/chromium/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.h
index 2ca8b3ef33e..16d67ea012e 100644
--- a/chromium/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.h
+++ b/chromium/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.h
@@ -53,6 +53,10 @@ class ActivationStateComputingNavigationThrottle
VerifiedRuleset::Handle* ruleset_handle,
const ActivationState& page_activation_state);
+ void set_destruction_closure(base::OnceClosure closure) {
+ destruction_closure_ = std::move(closure);
+ }
+
// content::NavigationThrottle:
content::NavigationThrottle::ThrottleCheckResult WillProcessResponse()
override;
@@ -65,16 +69,12 @@ class ActivationStateComputingNavigationThrottle
// frame.
std::unique_ptr<AsyncDocumentSubresourceFilter> ReleaseFilter();
- AsyncDocumentSubresourceFilter* filter() { return async_filter_.get(); }
+ AsyncDocumentSubresourceFilter* filter() const;
- void WillSendActivationToRenderer();
+ void CouldSendActivationToRenderer();
private:
void OnActivationStateComputed(ActivationState state);
- void set_filter(
- std::unique_ptr<AsyncDocumentSubresourceFilter> async_filter) {
- async_filter_ = std::move(async_filter);
- }
ActivationStateComputingNavigationThrottle(
content::NavigationHandle* navigation_handle,
@@ -92,11 +92,15 @@ class ActivationStateComputingNavigationThrottle
base::TimeTicks defer_timestamp_;
- // Becomes true when the throttle manager reaches ReadyToCommitNavigation and
- // sends an activation IPC to the render process. Makes sure a caller cannot
- // take ownership of the subresource filter unless an activation IPC is sent
- // to the renderer.
- bool will_send_activation_to_renderer_ = false;
+ // Callback to be run in the destructor.
+ base::OnceClosure destruction_closure_;
+
+ // Can become true when the throttle manager reaches ReadyToCommitNavigation.
+ // Makes sure a caller cannot take ownership of the subresource filter unless
+ // the throttle has reached this point. After this point the throttle manager
+ // can send an activation IPC to the render process. Note that an IPC is not
+ // always sent in case this activation is ignoring ruleset rules.
+ bool could_send_activation_to_renderer_ = false;
base::WeakPtrFactory<ActivationStateComputingNavigationThrottle>
weak_ptr_factory_;