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