OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_TRACE_EVENT_TRACE_CONFIG_H_ | 5 #ifndef BASE_TRACE_EVENT_TRACE_CONFIG_H_ |
6 #define BASE_TRACE_EVENT_TRACE_CONFIG_H_ | 6 #define BASE_TRACE_EVENT_TRACE_CONFIG_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <set> | 11 #include <set> |
11 #include <string> | 12 #include <string> |
| 13 #include <unordered_set> |
12 #include <vector> | 14 #include <vector> |
13 | 15 |
14 #include "base/base_export.h" | 16 #include "base/base_export.h" |
15 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
16 #include "base/strings/string_piece.h" | 18 #include "base/strings/string_piece.h" |
17 #include "base/trace_event/memory_dump_request_args.h" | 19 #include "base/trace_event/memory_dump_request_args.h" |
18 #include "base/values.h" | 20 #include "base/values.h" |
19 | 21 |
20 namespace base { | 22 namespace base { |
21 namespace trace_event { | 23 namespace trace_event { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 77 |
76 // Set of memory dump modes allowed for the tracing session. The explicitly | 78 // Set of memory dump modes allowed for the tracing session. The explicitly |
77 // triggered dumps will be successful only if the dump mode is allowed in | 79 // triggered dumps will be successful only if the dump mode is allowed in |
78 // the config. | 80 // the config. |
79 std::set<MemoryDumpLevelOfDetail> allowed_dump_modes; | 81 std::set<MemoryDumpLevelOfDetail> allowed_dump_modes; |
80 | 82 |
81 std::vector<Trigger> triggers; | 83 std::vector<Trigger> triggers; |
82 HeapProfiler heap_profiler_options; | 84 HeapProfiler heap_profiler_options; |
83 }; | 85 }; |
84 | 86 |
85 class EventFilterConfig { | 87 class BASE_EXPORT EventFilterConfig { |
86 public: | 88 public: |
87 EventFilterConfig(const std::string& predicate_name); | 89 EventFilterConfig(const std::string& predicate_name); |
88 EventFilterConfig(const EventFilterConfig& tc); | 90 EventFilterConfig(const EventFilterConfig& tc); |
89 | 91 |
90 ~EventFilterConfig(); | 92 ~EventFilterConfig(); |
91 | 93 |
92 EventFilterConfig& operator=(const EventFilterConfig& rhs); | 94 EventFilterConfig& operator=(const EventFilterConfig& rhs); |
93 | 95 |
94 void AddIncludedCategory(const std::string& category); | 96 void AddIncludedCategory(const std::string& category); |
95 void AddExcludedCategory(const std::string& category); | 97 void AddExcludedCategory(const std::string& category); |
96 void SetArgs(std::unique_ptr<base::DictionaryValue> args); | 98 void SetArgs(std::unique_ptr<base::DictionaryValue> args); |
| 99 bool GetArgAsSet(const char* key, std::unordered_set<std::string>*) const; |
97 | 100 |
98 bool IsCategoryGroupEnabled(const char* category_group_name) const; | 101 bool IsCategoryGroupEnabled(const char* category_group_name) const; |
99 | 102 |
100 const std::string& predicate_name() const { return predicate_name_; } | 103 const std::string& predicate_name() const { return predicate_name_; } |
101 base::DictionaryValue* filter_args() const { return args_.get(); } | 104 base::DictionaryValue* filter_args() const { return args_.get(); } |
102 const StringList& included_categories() const { | 105 const StringList& included_categories() const { |
103 return included_categories_; | 106 return included_categories_; |
104 } | 107 } |
105 const StringList& excluded_categories() const { | 108 const StringList& excluded_categories() const { |
106 return excluded_categories_; | 109 return excluded_categories_; |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 StringList disabled_categories_; | 320 StringList disabled_categories_; |
318 StringList excluded_categories_; | 321 StringList excluded_categories_; |
319 StringList synthetic_delays_; | 322 StringList synthetic_delays_; |
320 EventFilters event_filters_; | 323 EventFilters event_filters_; |
321 }; | 324 }; |
322 | 325 |
323 } // namespace trace_event | 326 } // namespace trace_event |
324 } // namespace base | 327 } // namespace base |
325 | 328 |
326 #endif // BASE_TRACE_EVENT_TRACE_CONFIG_H_ | 329 #endif // BASE_TRACE_EVENT_TRACE_CONFIG_H_ |
OLD | NEW |