Chromium Code Reviews| Index: content/public/browser/background_tracing_config.cc |
| diff --git a/content/public/browser/background_tracing_config.cc b/content/public/browser/background_tracing_config.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bf4f8c5765c2a64a9a4d009514b3f93c92418c9d |
| --- /dev/null |
| +++ b/content/public/browser/background_tracing_config.cc |
| @@ -0,0 +1,106 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "content/public/browser/background_tracing_manager.h" |
| + |
| +namespace content { |
| + |
| +BackgroundTracingConfig::BackgroundTracingConfig(Mode mode) : mode_(mode) { |
| +} |
|
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
|
| + |
| +BackgroundTracingConfig::~BackgroundTracingConfig() { |
| +} |
| + |
| +BackgroundTracingConfig::Mode BackgroundTracingConfig::mode() const { |
| + return mode_; |
| +} |
| + |
| +BackgroundTracingConfig* BackgroundTracingConfig::FromDict( |
| + const base::DictionaryValue* dict) { |
| + // TODO(simonhatch): Implement this. |
| + CHECK(false); |
| + return NULL; |
| +} |
| + |
| +void BackgroundTracingConfig::IntoDict(base::DictionaryValue* dict) { |
| + // TODO(simonhatch): Implement this. |
| + CHECK(false); |
| +} |
| + |
| +BackgroundTracingPreemptiveConfig::BackgroundTracingPreemptiveConfig() |
| + : BackgroundTracingConfig(BackgroundTracingConfig::PREEMPTIVE_TRACING_MODE), |
| + category_preset_(BackgroundTracingConfig::BENCHMARK) { |
| +} |
| + |
| +BackgroundTracingPreemptiveConfig::~BackgroundTracingPreemptiveConfig() { |
| +} |
| + |
| +void BackgroundTracingPreemptiveConfig::AddHistogramTriggerRule( |
| + const std::string& histogram_name, |
| + int histogram_bin) { |
| + MonitoringRule rule; |
| + rule.type = MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE; |
| + rule.histogram_trigger_info.histogram_name_to_trigger_on = histogram_name; |
| + rule.histogram_trigger_info.histogram_bin_to_trigger_on = histogram_bin; |
| + configs_.push_back(rule); |
| +} |
| + |
| +void BackgroundTracingPreemptiveConfig::AddNamedTriggerRule( |
| + const std::string& name) { |
| + MonitoringRule rule; |
| + rule.type = MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED; |
| + rule.named_trigger_info.trigger_name = name; |
| + configs_.push_back(rule); |
| +} |
| + |
| +BackgroundTracingConfig::CategoryPreset |
| +BackgroundTracingPreemptiveConfig::category_preset() const { |
| + return category_preset_; |
| +} |
| + |
| +const std::vector<BackgroundTracingPreemptiveConfig::MonitoringRule>& |
| +BackgroundTracingPreemptiveConfig::configs() const { |
| + return configs_; |
| +} |
| + |
| +BackgroundTracingPreemptiveConfig* BackgroundTracingPreemptiveConfig::FromDict( |
| + const base::DictionaryValue* dict) { |
| + // TODO(simonhatch): Implement this. |
| + CHECK(false); |
| + return NULL; |
| +} |
| + |
| +void BackgroundTracingPreemptiveConfig::AsDict(base::DictionaryValue* dict) { |
| + // TODO(simonhatch): Implement this. |
| + CHECK(false); |
| +} |
| + |
| +BackgroundTracingReactiveConfig::BackgroundTracingReactiveConfig() |
| + : BackgroundTracingConfig(BackgroundTracingConfig::REACTIVE_TRACING_MODE) { |
| +} |
| + |
| +BackgroundTracingReactiveConfig::~BackgroundTracingReactiveConfig() { |
| +} |
| + |
| +void BackgroundTracingReactiveConfig::AddTracingRule( |
| + RuleType rule_type, |
| + const char* trigger_name, |
| + CategoryPreset category_preset) { |
| + // TODO(simonhatch): Implement this. |
| + CHECK(false); |
| +} |
| + |
| +BackgroundTracingReactiveConfig* BackgroundTracingReactiveConfig::FromDict( |
| + const base::DictionaryValue* dict) { |
| + // TODO(simonhatch): Implement this. |
| + CHECK(false); |
| + return NULL; |
| +} |
| + |
| +void BackgroundTracingReactiveConfig::AsDict(base::DictionaryValue* dict) { |
| + // TODO(simonhatch): Implement this. |
| + CHECK(false); |
| +} |
| + |
| +} // namespace content |