| Index: components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.cc
|
| diff --git a/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.cc b/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.cc
|
| index dfa6be5a8bd744d712f56147909d523b7d780494..e4e63fd1517bea3285c12b46c978f6429bbfffe8 100644
|
| --- a/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.cc
|
| +++ b/components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.cc
|
| @@ -10,6 +10,7 @@
|
| #include "base/callback.h"
|
| #include "base/memory/ptr_util.h"
|
| #include "components/subresource_filter/content/browser/async_document_subresource_filter.h"
|
| +#include "components/subresource_filter/core/browser/subresource_filter_features.h"
|
| #include "content/public/browser/navigation_handle.h"
|
| #include "content/public/browser/render_frame_host.h"
|
| #include "content/public/browser/web_contents.h"
|
| @@ -55,15 +56,21 @@ ActivationStateComputingNavigationThrottle::
|
| void ActivationStateComputingNavigationThrottle::
|
| NotifyPageActivationWithRuleset(
|
| VerifiedRuleset::Handle* ruleset_handle,
|
| - const ActivationState& page_activation_state) {
|
| + const ActivationState& page_activation_state,
|
| + ActivationDecision page_activation_decision) {
|
| DCHECK(navigation_handle()->IsInMainFrame());
|
| DCHECK(!parent_activation_state_);
|
| DCHECK(!ruleset_handle_);
|
| - // DISABLED implies null ruleset.
|
| - DCHECK(page_activation_state.activation_level != ActivationLevel::DISABLED ||
|
| - !ruleset_handle);
|
| parent_activation_state_ = page_activation_state;
|
| + page_activation_decision_ = page_activation_decision;
|
| ruleset_handle_ = ruleset_handle;
|
| +
|
| + // Activated implies not disabled.
|
| + DCHECK(page_activation_decision != ActivationDecision::ACTIVATED ||
|
| + page_activation_state.activation_level != ActivationLevel::DISABLED);
|
| + // Disabled implies null ruleset.
|
| + DCHECK(page_activation_state.activation_level != ActivationLevel::DISABLED ||
|
| + !ruleset_handle);
|
| }
|
|
|
| content::NavigationThrottle::ThrottleCheckResult
|
| @@ -113,6 +120,12 @@ ActivationStateComputingNavigationThrottle::ReleaseFilter() {
|
| return will_send_activation_to_renderer_ ? std::move(async_filter_) : nullptr;
|
| }
|
|
|
| +ActivationDecision
|
| +ActivationStateComputingNavigationThrottle::GetPageActivationDecision() {
|
| + DCHECK(navigation_handle()->IsInMainFrame());
|
| + return page_activation_decision_;
|
| +}
|
| +
|
| void ActivationStateComputingNavigationThrottle::
|
| WillSendActivationToRenderer() {
|
| DCHECK(async_filter_);
|
|
|