Popular sites on the NTP: Try to keep the ordering constant
[chromium-blink-merge.git] / content / public / browser / background_tracing_preemptive_config.h
blob91e29d83662093b2a254ec69ffb24ad811579d49
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_PUBLIC_BROWSER_BACKGROUND_TRACING_PREEMPTIVE_CONFIG_H_
6 #define CONTENT_PUBLIC_BROWSER_BACKGROUND_TRACING_PREEMPTIVE_CONFIG_H_
8 #include "base/metrics/histogram_base.h"
9 #include "content/public/browser/background_tracing_config.h"
11 namespace content {
13 // BackgroundTracingPreemptiveConfig holds trigger rules for use during
14 // preemptive tracing. Tracing will be enabled immediately, and whenever
15 // a trigger occurs, the trace will be finalized.
16 struct CONTENT_EXPORT BackgroundTracingPreemptiveConfig
17 : public BackgroundTracingConfig {
18 public:
19 BackgroundTracingPreemptiveConfig();
20 ~BackgroundTracingPreemptiveConfig() override;
22 enum RuleType {
23 MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED,
24 MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE,
25 MONITOR_AND_DUMP_WHEN_BROWSER_STARTUP_COMPLETE,
27 struct HistogramTriggerInfo {
28 std::string histogram_name;
29 base::HistogramBase::Sample histogram_value;
31 struct NamedTriggerInfo {
32 std::string trigger_name;
34 struct MonitoringRule {
35 RuleType type;
36 HistogramTriggerInfo histogram_trigger_info;
37 NamedTriggerInfo named_trigger_info;
40 std::vector<MonitoringRule> configs;
41 CategoryPreset category_preset;
44 } // namespace content
46 #endif // CONTENT_PUBLIC_BROWSER_BACKGROUND_TRACING_PREEMPTIVE_CONFIG_H_