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

Unified Diff: base/trace_event/trace_event_filter.h

Issue 2557743002: tracing: simplify lifetime of TraceEventFilter(s) (Closed)
Patch Set: rebase Created 4 years 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: base/trace_event/trace_event_filter.h
diff --git a/base/trace_event/trace_event_filter.h b/base/trace_event/trace_event_filter.h
index 48c6711432fdadc013b3b6ca5be668d42337e98e..a23c6a2a96e30209f0c6509d7e961a1099bf7712 100644
--- a/base/trace_event/trace_event_filter.h
+++ b/base/trace_event/trace_event_filter.h
@@ -29,7 +29,15 @@ class TraceEvent;
// different threads.
class BASE_EXPORT TraceEventFilter {
public:
- TraceEventFilter();
+ // Basic configuration shared by all filters.
+ class Config {
+ public:
+ Config();
+ virtual ~Config();
+ virtual bool IsEnabledForCategory(const char* category_name) const = 0;
+ };
+
+ explicit TraceEventFilter(std::unique_ptr<Config>);
virtual ~TraceEventFilter();
// If the category is ENABLED_FOR_RECORDING, the event is added iff all the
@@ -41,7 +49,11 @@ class BASE_EXPORT TraceEventFilter {
virtual void EndEvent(const char* category_name,
const char* event_name) const;
+ bool IsEnabledForCategory(const char* category_name) const;
+
private:
+ std::unique_ptr<const Config> config_;
+
DISALLOW_COPY_AND_ASSIGN(TraceEventFilter);
};

Powered by Google App Engine
This is Rietveld 408576698