OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_RULE_H_ | 5 #ifndef CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_RULE_H_ |
6 #define CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_RULE_H_ | 6 #define CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_RULE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "content/browser/tracing/background_tracing_config_impl.h" | 9 #include "content/browser/tracing/background_tracing_config_impl.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 virtual void IntoDict(base::DictionaryValue* dict) const; | 35 virtual void IntoDict(base::DictionaryValue* dict) const; |
36 virtual bool ShouldTriggerNamedEvent(const std::string& named_event) const; | 36 virtual bool ShouldTriggerNamedEvent(const std::string& named_event) const; |
37 virtual void OnHistogramTrigger(const std::string& histogram_name) const {} | 37 virtual void OnHistogramTrigger(const std::string& histogram_name) const {} |
38 | 38 |
39 // Seconds from the rule is triggered to finalization should start. | 39 // Seconds from the rule is triggered to finalization should start. |
40 virtual int GetTraceDelay() const; | 40 virtual int GetTraceDelay() const; |
41 | 41 |
42 // Probability that we should allow a tigger to happen. | 42 // Probability that we should allow a tigger to happen. |
43 double trigger_chance() const { return trigger_chance_; } | 43 double trigger_chance() const { return trigger_chance_; } |
44 | 44 |
45 bool stop_tracing_on_repeated_reactive() const { | |
46 return stop_tracing_on_repeated_reactive_; | |
47 } | |
48 | |
49 static std::unique_ptr<BackgroundTracingRule> CreateRuleFromDict( | 45 static std::unique_ptr<BackgroundTracingRule> CreateRuleFromDict( |
50 const base::DictionaryValue* dict); | 46 const base::DictionaryValue* dict); |
51 | 47 |
52 private: | 48 private: |
53 DISALLOW_COPY_AND_ASSIGN(BackgroundTracingRule); | 49 DISALLOW_COPY_AND_ASSIGN(BackgroundTracingRule); |
54 | 50 |
55 double trigger_chance_; | 51 double trigger_chance_; |
56 int trigger_delay_; | 52 int trigger_delay_; |
57 bool stop_tracing_on_repeated_reactive_; | |
58 BackgroundTracingConfigImpl::CategoryPreset category_preset_; | 53 BackgroundTracingConfigImpl::CategoryPreset category_preset_; |
59 }; | 54 }; |
60 | 55 |
61 } // namespace content | 56 } // namespace content |
62 | 57 |
63 #endif // CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_RULE_H_ | 58 #endif // CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_RULE_H_ |
OLD | NEW |