| Index: base/trace_event/trace_config.h
|
| diff --git a/base/trace_event/trace_config.h b/base/trace_event/trace_config.h
|
| index 717c2613169d3a60436df3794d3b546f5824e8b6..29edc9a8ec88375c97a0200d3efe4195899cc649 100644
|
| --- a/base/trace_event/trace_config.h
|
| +++ b/base/trace_event/trace_config.h
|
| @@ -17,6 +17,7 @@
|
| #include "base/gtest_prod_util.h"
|
| #include "base/strings/string_piece.h"
|
| #include "base/trace_event/memory_dump_request_args.h"
|
| +#include "base/trace_event/trace_config_category_filter.h"
|
| #include "base/values.h"
|
|
|
| namespace base {
|
| @@ -94,26 +95,25 @@ class BASE_EXPORT TraceConfig {
|
|
|
| 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);
|
| + void InitializeFromConfigDict(const base::DictionaryValue* event_filter);
|
| +
|
| + void SetCategoryFilter(const TraceConfigCategoryFilter& category_filter);
|
| +
|
| + void ToDict(DictionaryValue* filter_dict) const;
|
| +
|
| bool GetArgAsSet(const char* key, std::unordered_set<std::string>*) const;
|
|
|
| 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_;
|
| + const TraceConfigCategoryFilter& category_filter() const {
|
| + return category_filter_;
|
| }
|
|
|
| private:
|
| std::string predicate_name_;
|
| - StringList included_categories_;
|
| - StringList excluded_categories_;
|
| + TraceConfigCategoryFilter category_filter_;
|
| std::unique_ptr<base::DictionaryValue> args_;
|
| };
|
| typedef std::vector<EventFilterConfig> EventFilters;
|
| @@ -241,6 +241,10 @@ class BASE_EXPORT TraceConfig {
|
| // Clears and resets the memory dump config.
|
| void ResetMemoryDumpConfig(const MemoryDumpConfig& memory_dump_config);
|
|
|
| + const TraceConfigCategoryFilter& category_filter() const {
|
| + return category_filter_;
|
| + }
|
| +
|
| const MemoryDumpConfig& memory_dump_config() const {
|
| return memory_dump_config_;
|
| }
|
| @@ -254,15 +258,6 @@ class BASE_EXPORT TraceConfig {
|
| FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromValidLegacyFormat);
|
| FRIEND_TEST_ALL_PREFIXES(TraceConfigTest,
|
| TraceConfigFromInvalidLegacyStrings);
|
| - FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromValidString);
|
| - FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromInvalidString);
|
| - FRIEND_TEST_ALL_PREFIXES(TraceConfigTest,
|
| - IsEmptyOrContainsLeadingOrTrailingWhitespace);
|
| - FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromMemoryConfigString);
|
| - FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, LegacyStringToMemoryDumpConfig);
|
| - FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, EmptyMemoryDumpConfigTest);
|
| - FRIEND_TEST_ALL_PREFIXES(TraceConfigTest,
|
| - EmptyAndAsteriskCategoryFilterString);
|
|
|
| // The default trace config, used when none is provided.
|
| // Allows all non-disabled-by-default categories through, except if they end
|
| @@ -279,13 +274,6 @@ class BASE_EXPORT TraceConfig {
|
| void InitializeFromStrings(StringPiece category_filter_string,
|
| StringPiece trace_options_string);
|
|
|
| - void SetCategoriesFromIncludedList(const ListValue& included_list);
|
| - void SetCategoriesFromExcludedList(const ListValue& excluded_list);
|
| - void SetSyntheticDelaysFromList(const ListValue& list);
|
| - void AddCategoryToDict(DictionaryValue* dict,
|
| - const char* param,
|
| - const StringList& categories) const;
|
| -
|
| void SetMemoryDumpConfigFromConfigDict(
|
| const DictionaryValue& memory_dump_config);
|
| void SetDefaultMemoryDumpConfig();
|
| @@ -295,32 +283,14 @@ class BASE_EXPORT TraceConfig {
|
|
|
| std::string ToTraceOptionsString() const;
|
|
|
| - void WriteCategoryFilterString(const StringList& values,
|
| - std::string* out,
|
| - bool included) const;
|
| - void WriteCategoryFilterString(const StringList& delays,
|
| - std::string* out) const;
|
| -
|
| - // Returns true if the category is enabled according to this trace config.
|
| - // This tells whether a category is enabled from the TraceConfig's
|
| - // perspective. Please refer to IsCategoryGroupEnabled() to determine if a
|
| - // category is enabled from the tracing runtime's perspective.
|
| - bool IsCategoryEnabled(const char* category_name) const;
|
| -
|
| - static bool IsEmptyOrContainsLeadingOrTrailingWhitespace(StringPiece str);
|
| -
|
| - bool HasIncludedPatterns() const;
|
| -
|
| TraceRecordMode record_mode_;
|
| bool enable_systrace_ : 1;
|
| bool enable_argument_filter_ : 1;
|
|
|
| + TraceConfigCategoryFilter category_filter_;
|
| +
|
| MemoryDumpConfig memory_dump_config_;
|
|
|
| - StringList included_categories_;
|
| - StringList disabled_categories_;
|
| - StringList excluded_categories_;
|
| - StringList synthetic_delays_;
|
| EventFilters event_filters_;
|
| };
|
|
|
|
|