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

Unified Diff: content/public/browser/background_tracing_preemptive_config.h

Issue 1089253003: Re-land first pass BackgroundTracingManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split config into separate headers and build fix. 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 side-by-side diff with in-line comments
Download patch
Index: content/public/browser/background_tracing_preemptive_config.h
diff --git a/content/public/browser/background_tracing_preemptive_config.h b/content/public/browser/background_tracing_preemptive_config.h
new file mode 100644
index 0000000000000000000000000000000000000000..ecf11636d853d1c1ff9cf8d77d264525d90c950e
--- /dev/null
+++ b/content/public/browser/background_tracing_preemptive_config.h
@@ -0,0 +1,47 @@
+// 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.
+
+#ifndef CONTENT_PUBLIC_BROWSER_BACKGROUND_PREEMPTIVE_TRACING_CONFIG_H_
+#define CONTENT_PUBLIC_BROWSER_BACKGROUND_PREEMPTIVE_TRACING_CONFIG_H_
+
+#include "content/public/browser/background_tracing_config.h"
+
+namespace content {
+
+// BackgroundTracingPreemptiveConfig holds trigger rules for use during
+// preemptive tracing. Tracing will be enabled immediately, and whenever
+// a trigger occurs, the trace will be finalized.
+struct CONTENT_EXPORT BackgroundTracingPreemptiveConfig
+ : public BackgroundTracingConfig {
+ public:
+ BackgroundTracingPreemptiveConfig();
+
+ enum RuleType {
+ MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED,
+ MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE,
+ MONITOR_AND_DUMP_WHEN_BROWSER_STARTED,
no sievers 2015/05/14 21:25:17 nit: STARTED -> STARTUP_COMPLETE?
shatch 2015/05/15 21:00:51 Done.
+ };
+ struct HistogramTriggerInfo {
+ std::string histogram_name_to_trigger_on;
+ int histogram_bin_to_trigger_on;
+ };
+ struct NamedTriggerInfo {
+ std::string trigger_name;
+ };
+ struct MonitoringRule {
+ RuleType type;
+ HistogramTriggerInfo histogram_trigger_info;
+ NamedTriggerInfo named_trigger_info;
no sievers 2015/05/14 21:25:17 Ok now here subclassing would make sense since you
shatch 2015/05/15 21:00:51 Hrm, not quite following. Are you suggesting somet
+ };
+
+ std::vector<MonitoringRule> configs;
+ CategoryPreset category_preset;
+
+ protected:
+ ~BackgroundTracingPreemptiveConfig() override;
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_BACKGROUND_PREEMPTIVE_TRACING_CONFIG_H_

Powered by Google App Engine
This is Rietveld 408576698