OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #include "components/subresource_filter/content/browser/async_document_subresour ce_filter.h" | 5 #include "components/subresource_filter/content/browser/async_document_subresour ce_filter.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 DCHECK(verified_ruleset); | 121 DCHECK(verified_ruleset); |
122 | 122 |
123 const MemoryMappedRuleset* ruleset = verified_ruleset->Get(); | 123 const MemoryMappedRuleset* ruleset = verified_ruleset->Get(); |
124 if (!ruleset) | 124 if (!ruleset) |
125 return ActivationState(ActivationLevel::DISABLED); | 125 return ActivationState(ActivationLevel::DISABLED); |
126 | 126 |
127 ActivationState activation_state = | 127 ActivationState activation_state = |
128 ComputeActivationState(params.document_url, params.parent_document_origin, | 128 ComputeActivationState(params.document_url, params.parent_document_origin, |
129 params.parent_activation_state, ruleset); | 129 params.parent_activation_state, ruleset); |
130 | 130 |
131 filter_.emplace(url::Origin(params.document_url), activation_state, ruleset, | 131 if (activation_state.activation_level != ActivationLevel::DISABLED) { |
pkalinnikov
2017/02/14 12:11:06
You can remove this check, I have modified to depe
Charlie Harrison
2017/02/14 14:09:38
Done.
| |
132 base::OnceClosure()); | 132 filter_.emplace(url::Origin(params.document_url), activation_state, ruleset, |
133 base::OnceClosure()); | |
134 } | |
133 | 135 |
134 return activation_state; | 136 return activation_state; |
135 } | 137 } |
136 | 138 |
137 } // namespace subresource_filter | 139 } // namespace subresource_filter |
OLD | NEW |