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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_RULE_H_
6 #define CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_RULE_H_
8 #include "content/browser/tracing/background_tracing_config_impl.h"
9 #include "content/common/content_export.h"
12 class DictionaryValue
;
17 class CONTENT_EXPORT BackgroundTracingRule
{
19 BackgroundTracingRule();
20 virtual ~BackgroundTracingRule();
22 virtual void Install() {}
23 virtual void IntoDict(base::DictionaryValue
* dict
) const = 0;
24 virtual bool ShouldTriggerNamedEvent(const std::string
& named_event
) const;
25 virtual BackgroundTracingConfigImpl::CategoryPreset
GetCategoryPreset() const;
26 virtual void OnHistogramTrigger(const std::string
& histogram_name
) const {}
28 virtual int GetReactiveTimeout() const;
30 static scoped_ptr
<BackgroundTracingRule
> PreemptiveRuleFromDict(
31 const base::DictionaryValue
* dict
);
33 static scoped_ptr
<BackgroundTracingRule
> ReactiveRuleFromDict(
34 const base::DictionaryValue
* dict
,
35 BackgroundTracingConfigImpl::CategoryPreset category_preset
);
38 DISALLOW_COPY_AND_ASSIGN(BackgroundTracingRule
);
41 } // namespace content
43 #endif // CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_RULE_H_