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 #include "content/browser/tracing/background_tracing_config_impl.h" | 5 #include "content/browser/tracing/background_tracing_config_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 const char kConfigDisableBlinkFeatures[] = "disable_blink_features"; | 25 const char kConfigDisableBlinkFeatures[] = "disable_blink_features"; |
26 | 26 |
27 const char kConfigCategoryKey[] = "category"; | 27 const char kConfigCategoryKey[] = "category"; |
28 const char kConfigCategoryBenchmark[] = "BENCHMARK"; | 28 const char kConfigCategoryBenchmark[] = "BENCHMARK"; |
29 const char kConfigCategoryBenchmarkDeep[] = "BENCHMARK_DEEP"; | 29 const char kConfigCategoryBenchmarkDeep[] = "BENCHMARK_DEEP"; |
30 const char kConfigCategoryBenchmarkGPU[] = "BENCHMARK_GPU"; | 30 const char kConfigCategoryBenchmarkGPU[] = "BENCHMARK_GPU"; |
31 const char kConfigCategoryBenchmarkIPC[] = "BENCHMARK_IPC"; | 31 const char kConfigCategoryBenchmarkIPC[] = "BENCHMARK_IPC"; |
32 const char kConfigCategoryBenchmarkStartup[] = "BENCHMARK_STARTUP"; | 32 const char kConfigCategoryBenchmarkStartup[] = "BENCHMARK_STARTUP"; |
33 const char kConfigCategoryBenchmarkBlinkGC[] = "BENCHMARK_BLINK_GC"; | 33 const char kConfigCategoryBenchmarkBlinkGC[] = "BENCHMARK_BLINK_GC"; |
34 const char kConfigCategoryBenchmarkMemoryHeavy[] = "BENCHMARK_MEMORY_HEAVY"; | 34 const char kConfigCategoryBenchmarkMemoryHeavy[] = "BENCHMARK_MEMORY_HEAVY"; |
| 35 const char kConfigCategoryBenchmarkMemoryLight[] = "BENCHMARK_MEMORY_LIGHT"; |
35 const char kConfigCategoryBenchmarkExecutionMetric[] = | 36 const char kConfigCategoryBenchmarkExecutionMetric[] = |
36 "BENCHMARK_EXECUTION_METRIC"; | 37 "BENCHMARK_EXECUTION_METRIC"; |
37 const char kConfigCategoryBlinkStyle[] = "BLINK_STYLE"; | 38 const char kConfigCategoryBlinkStyle[] = "BLINK_STYLE"; |
38 | 39 |
39 } // namespace | 40 } // namespace |
40 | 41 |
41 BackgroundTracingConfigImpl::BackgroundTracingConfigImpl( | 42 BackgroundTracingConfigImpl::BackgroundTracingConfigImpl( |
42 TracingMode tracing_mode) | 43 TracingMode tracing_mode) |
43 : BackgroundTracingConfig(tracing_mode), | 44 : BackgroundTracingConfig(tracing_mode), |
44 category_preset_(BackgroundTracingConfigImpl::BENCHMARK) {} | 45 category_preset_(BackgroundTracingConfigImpl::BENCHMARK) {} |
(...skipping 10 matching lines...) Expand all Loading... |
55 case BackgroundTracingConfigImpl::BENCHMARK_GPU: | 56 case BackgroundTracingConfigImpl::BENCHMARK_GPU: |
56 return kConfigCategoryBenchmarkGPU; | 57 return kConfigCategoryBenchmarkGPU; |
57 case BackgroundTracingConfigImpl::BENCHMARK_IPC: | 58 case BackgroundTracingConfigImpl::BENCHMARK_IPC: |
58 return kConfigCategoryBenchmarkIPC; | 59 return kConfigCategoryBenchmarkIPC; |
59 case BackgroundTracingConfigImpl::BENCHMARK_STARTUP: | 60 case BackgroundTracingConfigImpl::BENCHMARK_STARTUP: |
60 return kConfigCategoryBenchmarkStartup; | 61 return kConfigCategoryBenchmarkStartup; |
61 case BackgroundTracingConfigImpl::BENCHMARK_BLINK_GC: | 62 case BackgroundTracingConfigImpl::BENCHMARK_BLINK_GC: |
62 return kConfigCategoryBenchmarkBlinkGC; | 63 return kConfigCategoryBenchmarkBlinkGC; |
63 case BackgroundTracingConfigImpl::BENCHMARK_MEMORY_HEAVY: | 64 case BackgroundTracingConfigImpl::BENCHMARK_MEMORY_HEAVY: |
64 return kConfigCategoryBenchmarkMemoryHeavy; | 65 return kConfigCategoryBenchmarkMemoryHeavy; |
| 66 case BackgroundTracingConfigImpl::BENCHMARK_MEMORY_LIGHT: |
| 67 return kConfigCategoryBenchmarkMemoryLight; |
65 case BackgroundTracingConfigImpl::BENCHMARK_EXECUTION_METRIC: | 68 case BackgroundTracingConfigImpl::BENCHMARK_EXECUTION_METRIC: |
66 return kConfigCategoryBenchmarkExecutionMetric; | 69 return kConfigCategoryBenchmarkExecutionMetric; |
67 case BackgroundTracingConfigImpl::BLINK_STYLE: | 70 case BackgroundTracingConfigImpl::BLINK_STYLE: |
68 return kConfigCategoryBlinkStyle; | 71 return kConfigCategoryBlinkStyle; |
69 case BackgroundTracingConfigImpl::CATEGORY_PRESET_UNSET: | 72 case BackgroundTracingConfigImpl::CATEGORY_PRESET_UNSET: |
70 NOTREACHED(); | 73 NOTREACHED(); |
71 } | 74 } |
72 NOTREACHED(); | 75 NOTREACHED(); |
73 return ""; | 76 return ""; |
74 } | 77 } |
(...skipping 29 matching lines...) Expand all Loading... |
104 if (category_preset_string == kConfigCategoryBenchmarkBlinkGC) { | 107 if (category_preset_string == kConfigCategoryBenchmarkBlinkGC) { |
105 *category_preset = BackgroundTracingConfigImpl::BENCHMARK_BLINK_GC; | 108 *category_preset = BackgroundTracingConfigImpl::BENCHMARK_BLINK_GC; |
106 return true; | 109 return true; |
107 } | 110 } |
108 | 111 |
109 if (category_preset_string == kConfigCategoryBenchmarkMemoryHeavy) { | 112 if (category_preset_string == kConfigCategoryBenchmarkMemoryHeavy) { |
110 *category_preset = BackgroundTracingConfigImpl::BENCHMARK_MEMORY_HEAVY; | 113 *category_preset = BackgroundTracingConfigImpl::BENCHMARK_MEMORY_HEAVY; |
111 return true; | 114 return true; |
112 } | 115 } |
113 | 116 |
| 117 if (category_preset_string == kConfigCategoryBenchmarkMemoryLight) { |
| 118 *category_preset = BackgroundTracingConfigImpl::BENCHMARK_MEMORY_LIGHT; |
| 119 return true; |
| 120 } |
| 121 |
114 if (category_preset_string == kConfigCategoryBenchmarkExecutionMetric) { | 122 if (category_preset_string == kConfigCategoryBenchmarkExecutionMetric) { |
115 *category_preset = BackgroundTracingConfigImpl::BENCHMARK_EXECUTION_METRIC; | 123 *category_preset = BackgroundTracingConfigImpl::BENCHMARK_EXECUTION_METRIC; |
116 return true; | 124 return true; |
117 } | 125 } |
118 | 126 |
119 if (category_preset_string == kConfigCategoryBlinkStyle) { | 127 if (category_preset_string == kConfigCategoryBlinkStyle) { |
120 *category_preset = BackgroundTracingConfigImpl::BLINK_STYLE; | 128 *category_preset = BackgroundTracingConfigImpl::BLINK_STYLE; |
121 return true; | 129 return true; |
122 } | 130 } |
123 | 131 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 config->AddReactiveRule(config_dict, new_category_preset); | 273 config->AddReactiveRule(config_dict, new_category_preset); |
266 } | 274 } |
267 | 275 |
268 if (config->rules().empty()) | 276 if (config->rules().empty()) |
269 return nullptr; | 277 return nullptr; |
270 | 278 |
271 return config; | 279 return config; |
272 } | 280 } |
273 | 281 |
274 } // namspace content | 282 } // namspace content |
OLD | NEW |