Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |