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 <string> | 10 #include <string> |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // "periodic_interval_ms": 2000 | 123 // "periodic_interval_ms": 2000 |
124 // } | 124 // } |
125 // ] | 125 // ] |
126 // } | 126 // } |
127 // } | 127 // } |
128 // | 128 // |
129 // Note: memory_dump_config can be specified only if | 129 // Note: memory_dump_config can be specified only if |
130 // disabled-by-default-memory-infra category is enabled. | 130 // disabled-by-default-memory-infra category is enabled. |
131 explicit TraceConfig(const std::string& config_string); | 131 explicit TraceConfig(const std::string& config_string); |
132 | 132 |
133 // Functionally identical to the above, but takes a parsed dictionary as input | |
134 // instead of its JSON serialization. | |
135 explicit TraceConfig(const DictionaryValue& config); | |
136 | |
137 TraceConfig(const TraceConfig& tc); | 133 TraceConfig(const TraceConfig& tc); |
138 | 134 |
139 ~TraceConfig(); | 135 ~TraceConfig(); |
140 | 136 |
141 TraceConfig& operator=(const TraceConfig& rhs); | 137 TraceConfig& operator=(const TraceConfig& rhs); |
142 | 138 |
143 // Return a list of the synthetic delays specified in this category filter. | 139 // Return a list of the synthetic delays specified in this category filter. |
144 const StringList& GetSyntheticDelayValues() const; | 140 const StringList& GetSyntheticDelayValues() const; |
145 | 141 |
146 TraceRecordMode GetTraceRecordMode() const { return record_mode_; } | 142 TraceRecordMode GetTraceRecordMode() const { return record_mode_; } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 IsEmptyOrContainsLeadingOrTrailingWhitespace); | 183 IsEmptyOrContainsLeadingOrTrailingWhitespace); |
188 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromMemoryConfigString); | 184 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromMemoryConfigString); |
189 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, LegacyStringToMemoryDumpConfig); | 185 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, LegacyStringToMemoryDumpConfig); |
190 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, EmptyMemoryDumpConfigTest); | 186 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, EmptyMemoryDumpConfigTest); |
191 | 187 |
192 // The default trace config, used when none is provided. | 188 // The default trace config, used when none is provided. |
193 // Allows all non-disabled-by-default categories through, except if they end | 189 // Allows all non-disabled-by-default categories through, except if they end |
194 // in the suffix 'Debug' or 'Test'. | 190 // in the suffix 'Debug' or 'Test'. |
195 void InitializeDefault(); | 191 void InitializeDefault(); |
196 | 192 |
197 // Initialize from a config dictionary. | 193 // Initialize from the config string |
198 void InitializeFromConfigDict(const DictionaryValue& dict); | |
199 | |
200 // Initialize from a config string. | |
201 void InitializeFromConfigString(const std::string& config_string); | 194 void InitializeFromConfigString(const std::string& config_string); |
202 | 195 |
203 // Initialize from category filter and trace options strings | 196 // Initialize from category filter and trace options strings |
204 void InitializeFromStrings(const std::string& category_filter_string, | 197 void InitializeFromStrings(const std::string& category_filter_string, |
205 const std::string& trace_options_string); | 198 const std::string& trace_options_string); |
206 | 199 |
207 void SetCategoriesFromIncludedList(const base::ListValue& included_list); | 200 void SetCategoriesFromIncludedList(const base::ListValue& included_list); |
208 void SetCategoriesFromExcludedList(const base::ListValue& excluded_list); | 201 void SetCategoriesFromExcludedList(const base::ListValue& excluded_list); |
209 void SetSyntheticDelaysFromList(const base::ListValue& list); | 202 void SetSyntheticDelaysFromList(const base::ListValue& list); |
210 void AddCategoryToDict(base::DictionaryValue& dict, | 203 void AddCategoryToDict(base::DictionaryValue& dict, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 StringList included_categories_; | 236 StringList included_categories_; |
244 StringList disabled_categories_; | 237 StringList disabled_categories_; |
245 StringList excluded_categories_; | 238 StringList excluded_categories_; |
246 StringList synthetic_delays_; | 239 StringList synthetic_delays_; |
247 }; | 240 }; |
248 | 241 |
249 } // namespace trace_event | 242 } // namespace trace_event |
250 } // namespace base | 243 } // namespace base |
251 | 244 |
252 #endif // BASE_TRACE_EVENT_TRACE_CONFIG_H_ | 245 #endif // BASE_TRACE_EVENT_TRACE_CONFIG_H_ |
OLD | NEW |