Chromium Code Reviews| Index: base/trace_event/trace_config.h |
| diff --git a/base/trace_event/trace_config.h b/base/trace_event/trace_config.h |
| index 91d6f1f3bd0d6c06604c4eab97cb7f69d80ba0ca..86d5ac39d524bd304307baa1707a86c3b23463b6 100644 |
| --- a/base/trace_event/trace_config.h |
| +++ b/base/trace_event/trace_config.h |
| @@ -80,6 +80,37 @@ class BASE_EXPORT TraceConfig { |
| HeapProfiler heap_profiler_options; |
| }; |
| + class EventFilterConfig { |
| + public: |
| + EventFilterConfig(const std::string& predicate_name); |
| + ~EventFilterConfig(); |
| + |
| + EventFilterConfig(const EventFilterConfig& tc); |
|
shatch
2016/08/15 21:25:47
nit: Kinda weird order with constructor/destructor
oystein (OOO til 10th of July)
2016/08/16 22:17:52
Done.
|
| + EventFilterConfig& operator=(const EventFilterConfig& rhs); |
| + |
| + void AddIncludedCategory(const std::string& category); |
| + void AddExcludedCategory(const std::string& category); |
| + void SetArgs(std::unique_ptr<base::DictionaryValue> args); |
| + |
| + bool IsCategoryGroupEnabled(const char* category_group_name) const; |
| + |
| + const std::string& predicate_name() const { return predicate_name_; } |
| + base::DictionaryValue* filter_args() const { return args_.get(); } |
| + const StringList& included_categories() const { |
| + return included_categories_; |
| + } |
| + const StringList& excluded_categories() const { |
| + return excluded_categories_; |
| + } |
| + |
| + private: |
| + std::string predicate_name_; |
| + StringList included_categories_; |
| + StringList excluded_categories_; |
| + std::unique_ptr<base::DictionaryValue> args_; |
| + }; |
| + typedef std::vector<EventFilterConfig> EventFilters; |
| + |
| TraceConfig(); |
| // Create TraceConfig object from category filter and trace options strings. |
| @@ -196,7 +227,7 @@ class BASE_EXPORT TraceConfig { |
| // Returns true if at least one category in the list is enabled by this |
| // trace config. This is used to determine if the category filters are |
| // enabled in the TRACE_* macros. |
| - bool IsCategoryGroupEnabled(const char* category_group) const; |
| + bool IsCategoryGroupEnabled(const char* category_group_name) const; |
| // Merges config with the current TraceConfig |
| void Merge(const TraceConfig& config); |
| @@ -210,6 +241,8 @@ class BASE_EXPORT TraceConfig { |
| return memory_dump_config_; |
| } |
| + const EventFilters& event_filters() const { return event_filters_; } |
| + |
| private: |
| FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromValidLegacyFormat); |
| FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, |
| @@ -250,6 +283,7 @@ class BASE_EXPORT TraceConfig { |
| const DictionaryValue& memory_dump_config); |
| void SetDefaultMemoryDumpConfig(); |
| + void SetEventFilters(const base::ListValue& event_filters); |
| std::unique_ptr<DictionaryValue> ToDict() const; |
| std::string ToTraceOptionsString() const; |
| @@ -281,6 +315,7 @@ class BASE_EXPORT TraceConfig { |
| StringList disabled_categories_; |
| StringList excluded_categories_; |
| StringList synthetic_delays_; |
| + EventFilters event_filters_; |
| }; |
| } // namespace trace_event |