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

Unified Diff: base/debug/trace_event_impl.h

Issue 12302036: Add a mode flag to the tracing framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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
« no previous file with comments | « no previous file | base/debug/trace_event_impl.cc » ('j') | content/browser/devtools/devtools_tracing_handler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/trace_event_impl.h
diff --git a/base/debug/trace_event_impl.h b/base/debug/trace_event_impl.h
index f152b0a413b4302e51191518b2c3993252d15d70..ed82a4d3c178e3a0ec7f2bfbe3d87454c857fff6 100644
--- a/base/debug/trace_event_impl.h
+++ b/base/debug/trace_event_impl.h
@@ -157,6 +157,10 @@ class BASE_EXPORT TraceResultBuffer {
bool append_comma_;
};
+// TraceMode determines how the trace buffer stores data.
+enum BASE_EXPORT TraceMode {
+ UNTIL_FULL = 0
+};
class BASE_EXPORT TraceLog {
public:
@@ -185,7 +189,8 @@ class BASE_EXPORT TraceLog {
// Else if excluded_categories is non-empty, everything but those are traced.
// Wildcards * and ? are supported (see MatchPattern in string_util.h).
void SetEnabled(const std::vector<std::string>& included_categories,
- const std::vector<std::string>& excluded_categories);
+ const std::vector<std::string>& excluded_categories,
+ TraceMode mode);
// |categories| is a comma-delimited list of category wildcards.
// A category can have an optional '-' prefix to make it an excluded category.
@@ -195,17 +200,19 @@ class BASE_EXPORT TraceLog {
// Example: SetEnabled("test_MyTest*");
// Example: SetEnabled("test_MyTest*,test_OtherStuff");
// Example: SetEnabled("-excluded_category1,-excluded_category2");
- void SetEnabled(const std::string& categories);
+ void SetEnabled(const std::string& categories, TraceMode mode);
// Retieves the categories set via a prior call to SetEnabled(). Only
// meaningful if |IsEnabled()| is true.
void GetEnabledTraceCategories(std::vector<std::string>* included_out,
std::vector<std::string>* excluded_out);
+ TraceMode GetTraceMode() { return trace_mode_; }
+
// Disable tracing for all categories.
void SetDisabled();
// Helper method to enable/disable tracing for all categories.
- void SetEnabled(bool enabled);
+ void SetEnabled(bool enabled, TraceMode mode);
bool IsEnabled() { return !!enable_count_; }
#if defined(OS_ANDROID)
@@ -400,6 +407,8 @@ class BASE_EXPORT TraceLog {
const unsigned char* watch_category_;
std::string watch_event_name_;
+ TraceMode trace_mode_;
+
DISALLOW_COPY_AND_ASSIGN(TraceLog);
};
« no previous file with comments | « no previous file | base/debug/trace_event_impl.cc » ('j') | content/browser/devtools/devtools_tracing_handler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698