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

Unified Diff: components/subresource_filter/core/common/activation_state.cc

Issue 2895263004: [subresource_filter] Add TRACE_EVENT probes for frame activation (Closed)
Patch Set: 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 | « components/subresource_filter/core/common/activation_state.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/subresource_filter/core/common/activation_state.cc
diff --git a/components/subresource_filter/core/common/activation_state.cc b/components/subresource_filter/core/common/activation_state.cc
new file mode 100644
index 0000000000000000000000000000000000000000..43e75137a7de50eda6d73a330c62cb21a8804118
--- /dev/null
+++ b/components/subresource_filter/core/common/activation_state.cc
@@ -0,0 +1,31 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/subresource_filter/core/common/activation_state.h"
+
+#include <ostream>
+#include <sstream>
+#include <string>
+
+#include "base/memory/ptr_util.h"
+#include "base/trace_event/trace_event_argument.h"
+
+namespace subresource_filter {
+
+std::unique_ptr<base::trace_event::TracedValue> ActivationState::ToTracedValue()
+ const {
+ auto value = base::MakeUnique<base::trace_event::TracedValue>();
+ std::ostringstream level;
+ level << this;
+ value->SetString("activation_level", level.str());
+ value->SetBoolean("filtering_disabled_for_document",
+ filtering_disabled_for_document);
+ value->SetBoolean("generic_blocking_rules_disabled",
+ generic_blocking_rules_disabled);
+ value->SetBoolean("measure_performance", measure_performance);
+ value->SetBoolean("enable_logging", enable_logging);
+ return value;
+}
+
+} // namespace subresource_filter
« no previous file with comments | « components/subresource_filter/core/common/activation_state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698