| 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 <set> | 10 #include <set> |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 // Reset the options to default. | 65 // Reset the options to default. |
| 66 void Clear(); | 66 void Clear(); |
| 67 | 67 |
| 68 uint32_t breakdown_threshold_bytes; | 68 uint32_t breakdown_threshold_bytes; |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 // Reset the values in the config. | 71 // Reset the values in the config. |
| 72 void Clear(); | 72 void Clear(); |
| 73 | 73 |
| 74 void Merge(const MemoryDumpConfig& config); | |
| 75 | |
| 76 // Set of memory dump modes allowed for the tracing session. The explicitly | 74 // 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 | 75 // triggered dumps will be successful only if the dump mode is allowed in |
| 78 // the config. | 76 // the config. |
| 79 std::set<MemoryDumpLevelOfDetail> allowed_dump_modes; | 77 std::set<MemoryDumpLevelOfDetail> allowed_dump_modes; |
| 80 | 78 |
| 81 std::vector<Trigger> triggers; | 79 std::vector<Trigger> triggers; |
| 82 HeapProfiler heap_profiler_options; | 80 HeapProfiler heap_profiler_options; |
| 83 }; | 81 }; |
| 84 | 82 |
| 85 class EventFilterConfig { | 83 class EventFilterConfig { |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 void Clear(); | 233 void Clear(); |
| 236 | 234 |
| 237 // Clears and resets the memory dump config. | 235 // Clears and resets the memory dump config. |
| 238 void ResetMemoryDumpConfig(const MemoryDumpConfig& memory_dump_config); | 236 void ResetMemoryDumpConfig(const MemoryDumpConfig& memory_dump_config); |
| 239 | 237 |
| 240 const MemoryDumpConfig& memory_dump_config() const { | 238 const MemoryDumpConfig& memory_dump_config() const { |
| 241 return memory_dump_config_; | 239 return memory_dump_config_; |
| 242 } | 240 } |
| 243 | 241 |
| 244 const EventFilters& event_filters() const { return event_filters_; } | 242 const EventFilters& event_filters() const { return event_filters_; } |
| 245 void SetEventFilters(const EventFilters& filter_configs) { | |
| 246 event_filters_ = filter_configs; | |
| 247 } | |
| 248 | 243 |
| 249 private: | 244 private: |
| 250 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromValidLegacyFormat); | 245 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromValidLegacyFormat); |
| 251 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, | 246 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, |
| 252 TraceConfigFromInvalidLegacyStrings); | 247 TraceConfigFromInvalidLegacyStrings); |
| 253 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromValidString); | 248 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromValidString); |
| 254 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromInvalidString); | 249 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromInvalidString); |
| 255 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, | 250 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, |
| 256 IsEmptyOrContainsLeadingOrTrailingWhitespace); | 251 IsEmptyOrContainsLeadingOrTrailingWhitespace); |
| 257 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromMemoryConfigString); | 252 FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromMemoryConfigString); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 279 void SetCategoriesFromExcludedList(const ListValue& excluded_list); | 274 void SetCategoriesFromExcludedList(const ListValue& excluded_list); |
| 280 void SetSyntheticDelaysFromList(const ListValue& list); | 275 void SetSyntheticDelaysFromList(const ListValue& list); |
| 281 void AddCategoryToDict(DictionaryValue* dict, | 276 void AddCategoryToDict(DictionaryValue* dict, |
| 282 const char* param, | 277 const char* param, |
| 283 const StringList& categories) const; | 278 const StringList& categories) const; |
| 284 | 279 |
| 285 void SetMemoryDumpConfigFromConfigDict( | 280 void SetMemoryDumpConfigFromConfigDict( |
| 286 const DictionaryValue& memory_dump_config); | 281 const DictionaryValue& memory_dump_config); |
| 287 void SetDefaultMemoryDumpConfig(); | 282 void SetDefaultMemoryDumpConfig(); |
| 288 | 283 |
| 289 void SetEventFiltersFromConfigList(const base::ListValue& event_filters); | 284 void SetEventFilters(const base::ListValue& event_filters); |
| 290 std::unique_ptr<DictionaryValue> ToDict() const; | 285 std::unique_ptr<DictionaryValue> ToDict() const; |
| 291 | 286 |
| 292 std::string ToTraceOptionsString() const; | 287 std::string ToTraceOptionsString() const; |
| 293 | 288 |
| 294 void WriteCategoryFilterString(const StringList& values, | 289 void WriteCategoryFilterString(const StringList& values, |
| 295 std::string* out, | 290 std::string* out, |
| 296 bool included) const; | 291 bool included) const; |
| 297 void WriteCategoryFilterString(const StringList& delays, | 292 void WriteCategoryFilterString(const StringList& delays, |
| 298 std::string* out) const; | 293 std::string* out) const; |
| 299 | 294 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 317 StringList disabled_categories_; | 312 StringList disabled_categories_; |
| 318 StringList excluded_categories_; | 313 StringList excluded_categories_; |
| 319 StringList synthetic_delays_; | 314 StringList synthetic_delays_; |
| 320 EventFilters event_filters_; | 315 EventFilters event_filters_; |
| 321 }; | 316 }; |
| 322 | 317 |
| 323 } // namespace trace_event | 318 } // namespace trace_event |
| 324 } // namespace base | 319 } // namespace base |
| 325 | 320 |
| 326 #endif // BASE_TRACE_EVENT_TRACE_CONFIG_H_ | 321 #endif // BASE_TRACE_EVENT_TRACE_CONFIG_H_ |
| OLD | NEW |