[refactor] More post-NSS WebCrypto cleanups (utility functions).
[chromium-blink-merge.git] / content / browser / tracing / background_tracing_rule.h
blob2f693c9a1a74fb311efd488093b98a3d011d7b26
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"
11 namespace base {
12 class DictionaryValue;
13 } // namespace base
15 namespace content {
17 class CONTENT_EXPORT BackgroundTracingRule {
18 public:
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);
37 private:
38 DISALLOW_COPY_AND_ASSIGN(BackgroundTracingRule);
41 } // namespace content
43 #endif // CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_RULE_H_