Chromium Code Reviews| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 | 42 |
| 43 // Specifies the memory dump config for tracing. Used only when | 43 // Specifies the memory dump config for tracing. Used only when |
| 44 // "memory-infra" category is enabled. | 44 // "memory-infra" category is enabled. |
| 45 struct MemoryDumpTriggerConfig { | 45 struct MemoryDumpTriggerConfig { |
| 46 uint32_t periodic_interval_ms; | 46 uint32_t periodic_interval_ms; |
| 47 MemoryDumpLevelOfDetail level_of_detail; | 47 MemoryDumpLevelOfDetail level_of_detail; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 typedef std::vector<MemoryDumpTriggerConfig> MemoryDumpConfig; | 50 typedef std::vector<MemoryDumpTriggerConfig> MemoryDumpConfig; |
| 51 | 51 |
| 52 // Convert from DevTools style to tracing style. That is: | |
| 53 // 1. Convert dict key style: abcDefGhi => abc_def_ghi. | |
| 54 // For example: includedCategories => included_categories | |
| 55 // 2. Convert trace record mode style: abcDefGhi => abc-def-ghi. | |
| 56 // For example: recordUntilFull => record-until-full | |
| 57 static scoped_ptr<base::DictionaryValue> DevToolsToTracingStyle( | |
|
caseq
2016/03/05 02:25:24
I think it would be better out of base -- doing th
Primiano Tucci (use gerrit)
2016/03/06 01:24:37
+1. Base should not know anything about devtools.
| |
| 58 const scoped_ptr<base::DictionaryValue>& devtools_style); | |
| 59 static std::string DevToolsToTracingStyle(const std::string& devtools_style); | |
| 60 | |
| 52 TraceConfig(); | 61 TraceConfig(); |
| 53 | 62 |
| 54 // Create TraceConfig object from category filter and trace options strings. | 63 // Create TraceConfig object from category filter and trace options strings. |
| 55 // | 64 // |
| 56 // |category_filter_string| is a comma-delimited list of category wildcards. | 65 // |category_filter_string| is a comma-delimited list of category wildcards. |
| 57 // A category can have an optional '-' prefix to make it an excluded category. | 66 // A category can have an optional '-' prefix to make it an excluded category. |
| 58 // All the same rules apply above, so for example, having both included and | 67 // All the same rules apply above, so for example, having both included and |
| 59 // excluded categories in the same list would not be supported. | 68 // excluded categories in the same list would not be supported. |
| 60 // | 69 // |
| 61 // Category filters can also be used to configure synthetic delays. | 70 // Category filters can also be used to configure synthetic delays. |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 236 StringList included_categories_; | 245 StringList included_categories_; |
| 237 StringList disabled_categories_; | 246 StringList disabled_categories_; |
| 238 StringList excluded_categories_; | 247 StringList excluded_categories_; |
| 239 StringList synthetic_delays_; | 248 StringList synthetic_delays_; |
| 240 }; | 249 }; |
| 241 | 250 |
| 242 } // namespace trace_event | 251 } // namespace trace_event |
| 243 } // namespace base | 252 } // namespace base |
| 244 | 253 |
| 245 #endif // BASE_TRACE_EVENT_TRACE_CONFIG_H_ | 254 #endif // BASE_TRACE_EVENT_TRACE_CONFIG_H_ |
| OLD | NEW |