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 15 matching lines...) Expand all Loading... |
26 virtual bool ShouldTriggerNamedEvent(const std::string& named_event) const; | 26 virtual bool ShouldTriggerNamedEvent(const std::string& named_event) const; |
27 virtual BackgroundTracingConfigImpl::CategoryPreset GetCategoryPreset() const; | 27 virtual BackgroundTracingConfigImpl::CategoryPreset GetCategoryPreset() const; |
28 virtual void OnHistogramTrigger(const std::string& histogram_name) const {} | 28 virtual void OnHistogramTrigger(const std::string& histogram_name) const {} |
29 | 29 |
30 // Seconds from the rule is triggered to finalization should start. | 30 // Seconds from the rule is triggered to finalization should start. |
31 virtual int GetTraceTimeout() const; | 31 virtual int GetTraceTimeout() const; |
32 | 32 |
33 // Probability that we should allow a tigger to happen. | 33 // Probability that we should allow a tigger to happen. |
34 double trigger_chance() const { return trigger_chance_; } | 34 double trigger_chance() const { return trigger_chance_; } |
35 | 35 |
36 static scoped_ptr<BackgroundTracingRule> PreemptiveRuleFromDict( | 36 static std::unique_ptr<BackgroundTracingRule> PreemptiveRuleFromDict( |
37 const base::DictionaryValue* dict); | 37 const base::DictionaryValue* dict); |
38 | 38 |
39 static scoped_ptr<BackgroundTracingRule> ReactiveRuleFromDict( | 39 static std::unique_ptr<BackgroundTracingRule> ReactiveRuleFromDict( |
40 const base::DictionaryValue* dict, | 40 const base::DictionaryValue* dict, |
41 BackgroundTracingConfigImpl::CategoryPreset category_preset); | 41 BackgroundTracingConfigImpl::CategoryPreset category_preset); |
42 | 42 |
43 private: | 43 private: |
44 DISALLOW_COPY_AND_ASSIGN(BackgroundTracingRule); | 44 DISALLOW_COPY_AND_ASSIGN(BackgroundTracingRule); |
45 | 45 |
46 double trigger_chance_; | 46 double trigger_chance_; |
47 }; | 47 }; |
48 | 48 |
49 } // namespace content | 49 } // namespace content |
50 | 50 |
51 #endif // CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_RULE_H_ | 51 #endif // CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_RULE_H_ |
OLD | NEW |