Chromium Code Reviews| Index: components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc |
| diff --git a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc |
| index c6052e11c19b741f8d7e8657fd7648cb46c44e4f..aaebb1c59ec8a21b21117f32d6050b5aeb167b32 100644 |
| --- a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc |
| +++ b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc |
| @@ -9,6 +9,8 @@ |
| #include "base/metrics/histogram_macros.h" |
| #include "base/rand_util.h" |
| #include "base/time/time.h" |
| +#include "base/trace_event/trace_event.h" |
| +#include "base/trace_event/trace_event_argument.h" |
| #include "components/subresource_filter/content/browser/content_activation_list_utils.h" |
| #include "components/subresource_filter/content/browser/subresource_filter_client.h" |
| #include "components/subresource_filter/core/browser/subresource_filter_features.h" |
| @@ -119,8 +121,16 @@ void ContentSubresourceFilterDriverFactory:: |
| url, config.activation_conditions); |
| }); |
| - if (highest_priority_activated_config == |
| - config_list->configs_by_decreasing_priority().end()) { |
| + bool matched_config = highest_priority_activated_config != |
|
engedy
2017/05/15 12:10:38
nit: s//has_activated_config/ for consistency with
Charlie Harrison
2017/05/15 15:14:22
Done.
|
| + config_list->configs_by_decreasing_priority().end(); |
| + TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("loading"), |
|
engedy
2017/05/15 12:10:37
nit: The TRACE_EVENT in document_subresource_filte
Charlie Harrison
2017/05/15 15:14:22
I think "loading" is the category we should be usi
|
| + "ContentSubresourceFilterDriverFactory::" |
| + "ComputeActivationForMainFrameNavigation", |
| + "highest_priority_activated_config", |
| + matched_config |
| + ? highest_priority_activated_config->GetTracedValue() |
| + : base::MakeUnique<base::trace_event::TracedValue>()); |
| + if (!matched_config) { |
| activation_decision_ = ActivationDecision::ACTIVATION_CONDITIONS_NOT_MET; |
| activation_options_ = Configuration::ActivationOptions(); |
| return; |
| @@ -205,6 +215,7 @@ void ContentSubresourceFilterDriverFactory::WillProcessResponse( |
| // Only reset the activation decision reason if we would have activated. |
| if (whitelisted && activation_decision_ == ActivationDecision::ACTIVATED) { |
| + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("loading"), "ActivationWhitelisted"); |
| activation_decision_ = ActivationDecision::URL_WHITELISTED; |
| activation_options_ = Configuration::ActivationOptions(); |
| } |