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

Unified Diff: content/browser/tracing/background_tracing_rule.cc

Issue 2285853002: Reland of Background tracing: Added config option for repeated trigger behavior (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorrect removal Created 4 years, 4 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 | « content/browser/tracing/background_tracing_rule.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tracing/background_tracing_rule.cc
diff --git a/content/browser/tracing/background_tracing_rule.cc b/content/browser/tracing/background_tracing_rule.cc
index c24896fc186474b4f6d2cafb8d36f953f78056ee..527d64afb42feb93ed8852a046d3868363b21d90 100644
--- a/content/browser/tracing/background_tracing_rule.cc
+++ b/content/browser/tracing/background_tracing_rule.cc
@@ -23,6 +23,8 @@ const char kConfigCategoryKey[] = "category";
const char kConfigRuleTriggerNameKey[] = "trigger_name";
const char kConfigRuleTriggerDelay[] = "trigger_delay";
const char kConfigRuleTriggerChance[] = "trigger_chance";
+const char kConfigRuleStopTracingOnRepeatedReactive[] =
+ "stop_tracing_on_repeated_reactive";
const char kConfigRuleHistogramNameKey[] = "histogram_name";
const char kConfigRuleHistogramValueOldKey[] = "histogram_value";
@@ -59,11 +61,13 @@ namespace content {
BackgroundTracingRule::BackgroundTracingRule()
: trigger_chance_(1.0),
trigger_delay_(-1),
+ stop_tracing_on_repeated_reactive_(false),
category_preset_(BackgroundTracingConfigImpl::CATEGORY_PRESET_UNSET) {}
BackgroundTracingRule::BackgroundTracingRule(int trigger_delay)
: trigger_chance_(1.0),
trigger_delay_(trigger_delay),
+ stop_tracing_on_repeated_reactive_(false),
category_preset_(BackgroundTracingConfigImpl::CATEGORY_PRESET_UNSET) {}
BackgroundTracingRule::~BackgroundTracingRule() {}
@@ -85,6 +89,11 @@ void BackgroundTracingRule::IntoDict(base::DictionaryValue* dict) const {
if (trigger_delay_ != -1)
dict->SetInteger(kConfigRuleTriggerDelay, trigger_delay_);
+ if (stop_tracing_on_repeated_reactive_) {
+ dict->SetBoolean(kConfigRuleStopTracingOnRepeatedReactive,
+ stop_tracing_on_repeated_reactive_);
+ }
+
if (category_preset_ != BackgroundTracingConfigImpl::CATEGORY_PRESET_UNSET) {
dict->SetString(
kConfigCategoryKey,
@@ -95,6 +104,8 @@ void BackgroundTracingRule::IntoDict(base::DictionaryValue* dict) const {
void BackgroundTracingRule::Setup(const base::DictionaryValue* dict) {
dict->GetDouble(kConfigRuleTriggerChance, &trigger_chance_);
dict->GetInteger(kConfigRuleTriggerDelay, &trigger_delay_);
+ dict->GetBoolean(kConfigRuleStopTracingOnRepeatedReactive,
+ &stop_tracing_on_repeated_reactive_);
}
namespace {
« no previous file with comments | « content/browser/tracing/background_tracing_rule.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698