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

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

Issue 1427873003: Background tracing: Added trace_chance (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fixes Created 5 years, 2 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
Index: content/browser/tracing/background_tracing_rule.h
diff --git a/content/browser/tracing/background_tracing_rule.h b/content/browser/tracing/background_tracing_rule.h
index c5407ba83b11df5b3bca25d0442558efb7fb0cad..6e85836ccb305b197d01c3c315705a01291c0169 100644
--- a/content/browser/tracing/background_tracing_rule.h
+++ b/content/browser/tracing/background_tracing_rule.h
@@ -20,7 +20,8 @@ class CONTENT_EXPORT BackgroundTracingRule {
virtual ~BackgroundTracingRule();
virtual void Install() {}
- virtual void IntoDict(base::DictionaryValue* dict) const = 0;
+ virtual void IntoDict(base::DictionaryValue* dict) const;
+ void Setup(const base::DictionaryValue* dict);
virtual bool ShouldTriggerNamedEvent(const std::string& named_event) const;
virtual BackgroundTracingConfigImpl::CategoryPreset GetCategoryPreset() const;
virtual void OnHistogramTrigger(const std::string& histogram_name) const {}
@@ -28,6 +29,9 @@ class CONTENT_EXPORT BackgroundTracingRule {
// Seconds from the rule is triggered to finalization should start.
virtual int GetTraceTimeout() const;
+ // Probability that we should allow a tigger to happen.
+ double trigger_chance() const { return trigger_chance_; }
+
static scoped_ptr<BackgroundTracingRule> PreemptiveRuleFromDict(
const base::DictionaryValue* dict);
@@ -37,6 +41,8 @@ class CONTENT_EXPORT BackgroundTracingRule {
private:
DISALLOW_COPY_AND_ASSIGN(BackgroundTracingRule);
+
+ double trigger_chance_;
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698