Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(597)

Unified Diff: components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc

Issue 2875033004: [subresource_filter] Add debugging trace events around activation (Closed)
Patch Set: quick fix Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/subresource_filter/core/browser/subresource_filter_features.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..45b15bdc62d31041ff34b34092a1f192e1b16f2c 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,17 @@ void ContentSubresourceFilterDriverFactory::
url, config.activation_conditions);
});
- if (highest_priority_activated_config ==
- config_list->configs_by_decreasing_priority().end()) {
+ bool has_activated_config =
+ highest_priority_activated_config !=
+ config_list->configs_by_decreasing_priority().end();
+ TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("loading"),
+ "ContentSubresourceFilterDriverFactory::"
+ "ComputeActivationForMainFrameNavigation",
+ "highest_priority_activated_config",
+ has_activated_config
+ ? highest_priority_activated_config->ToTracedValue()
+ : base::MakeUnique<base::trace_event::TracedValue>());
+ if (!has_activated_config) {
activation_decision_ = ActivationDecision::ACTIVATION_CONDITIONS_NOT_MET;
activation_options_ = Configuration::ActivationOptions();
return;
@@ -205,6 +216,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();
}
« no previous file with comments | « no previous file | components/subresource_filter/core/browser/subresource_filter_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698