Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: content/public/browser/background_tracing_config.cc

Issue 1089253003: Re-land first pass BackgroundTracingManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split into multiple files in content/public/browser. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #include "content/public/browser/background_tracing_manager.h"
6
7 namespace content {
8
9 BackgroundTracingConfig::BackgroundTracingConfig(Mode mode) : mode_(mode) {
10 }
no sievers 2015/05/11 21:13:27 Hmm that's a lot of implementation, esp. with the
shatch 2015/05/12 21:00:05 Gotcha, looked around at some of the other structs
11
12 BackgroundTracingConfig::~BackgroundTracingConfig() {
13 }
14
15 BackgroundTracingConfig::Mode BackgroundTracingConfig::mode() const {
16 return mode_;
17 }
18
19 BackgroundTracingConfig* BackgroundTracingConfig::FromDict(
20 const base::DictionaryValue* dict) {
21 // TODO(simonhatch): Implement this.
22 CHECK(false);
23 return NULL;
24 }
25
26 void BackgroundTracingConfig::IntoDict(base::DictionaryValue* dict) {
27 // TODO(simonhatch): Implement this.
28 CHECK(false);
29 }
30
31 BackgroundTracingPreemptiveConfig::BackgroundTracingPreemptiveConfig()
32 : BackgroundTracingConfig(BackgroundTracingConfig::PREEMPTIVE_TRACING_MODE),
33 category_preset_(BackgroundTracingConfig::BENCHMARK) {
34 }
35
36 BackgroundTracingPreemptiveConfig::~BackgroundTracingPreemptiveConfig() {
37 }
38
39 void BackgroundTracingPreemptiveConfig::AddHistogramTriggerRule(
40 const std::string& histogram_name,
41 int histogram_bin) {
42 MonitoringRule rule;
43 rule.type = MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE;
44 rule.histogram_trigger_info.histogram_name_to_trigger_on = histogram_name;
45 rule.histogram_trigger_info.histogram_bin_to_trigger_on = histogram_bin;
46 configs_.push_back(rule);
47 }
48
49 void BackgroundTracingPreemptiveConfig::AddNamedTriggerRule(
50 const std::string& name) {
51 MonitoringRule rule;
52 rule.type = MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED;
53 rule.named_trigger_info.trigger_name = name;
54 configs_.push_back(rule);
55 }
56
57 BackgroundTracingConfig::CategoryPreset
58 BackgroundTracingPreemptiveConfig::category_preset() const {
59 return category_preset_;
60 }
61
62 const std::vector<BackgroundTracingPreemptiveConfig::MonitoringRule>&
63 BackgroundTracingPreemptiveConfig::configs() const {
64 return configs_;
65 }
66
67 BackgroundTracingPreemptiveConfig* BackgroundTracingPreemptiveConfig::FromDict(
68 const base::DictionaryValue* dict) {
69 // TODO(simonhatch): Implement this.
70 CHECK(false);
71 return NULL;
72 }
73
74 void BackgroundTracingPreemptiveConfig::AsDict(base::DictionaryValue* dict) {
75 // TODO(simonhatch): Implement this.
76 CHECK(false);
77 }
78
79 BackgroundTracingReactiveConfig::BackgroundTracingReactiveConfig()
80 : BackgroundTracingConfig(BackgroundTracingConfig::REACTIVE_TRACING_MODE) {
81 }
82
83 BackgroundTracingReactiveConfig::~BackgroundTracingReactiveConfig() {
84 }
85
86 void BackgroundTracingReactiveConfig::AddTracingRule(
87 RuleType rule_type,
88 const char* trigger_name,
89 CategoryPreset category_preset) {
90 // TODO(simonhatch): Implement this.
91 CHECK(false);
92 }
93
94 BackgroundTracingReactiveConfig* BackgroundTracingReactiveConfig::FromDict(
95 const base::DictionaryValue* dict) {
96 // TODO(simonhatch): Implement this.
97 CHECK(false);
98 return NULL;
99 }
100
101 void BackgroundTracingReactiveConfig::AsDict(base::DictionaryValue* dict) {
102 // TODO(simonhatch): Implement this.
103 CHECK(false);
104 }
105
106 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698