| Index: content/public/browser/background_tracing_manager.cc
|
| diff --git a/content/public/browser/background_tracing_manager.cc b/content/public/browser/background_tracing_manager.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4774d41d6d8635f031911c138ca282ab0441397d
|
| --- /dev/null
|
| +++ b/content/public/browser/background_tracing_manager.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) {
|
| +}
|
| +
|
| +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
|
|
|