| 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_manager_impl.h" | 5 #include "content/browser/tracing/background_tracing_manager_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 void RecordBackgroundTracingMetric(BackgroundTracingMetrics metric) { | 47 void RecordBackgroundTracingMetric(BackgroundTracingMetrics metric) { |
| 48 UMA_HISTOGRAM_ENUMERATION("Tracing.Background.ScenarioState", metric, | 48 UMA_HISTOGRAM_ENUMERATION("Tracing.Background.ScenarioState", metric, |
| 49 NUMBER_OF_BACKGROUND_TRACING_METRICS); | 49 NUMBER_OF_BACKGROUND_TRACING_METRICS); |
| 50 } | 50 } |
| 51 | 51 |
| 52 // Tracing enabled callback for BENCHMARK_MEMORY_LIGHT category preset. | 52 // Tracing enabled callback for BENCHMARK_MEMORY_LIGHT category preset. |
| 53 void BenchmarkMemoryLight_TracingEnabledCallback() { | 53 void BenchmarkMemoryLight_TracingEnabledCallback() { |
| 54 auto dump_manager = base::trace_event::MemoryDumpManager::GetInstance(); | 54 auto dump_manager = base::trace_event::MemoryDumpManager::GetInstance(); |
| 55 // Safety check to make sure the memory-infra restrictions are properly |
| 56 // propagated via TraceConfig |
| 57 CHECK(!dump_manager->IsDumpModeAllowed( |
| 58 base::trace_event::MemoryDumpLevelOfDetail::DETAILED)); |
| 55 dump_manager->RequestGlobalDump( | 59 dump_manager->RequestGlobalDump( |
| 56 base::trace_event::MemoryDumpType::EXPLICITLY_TRIGGERED, | 60 base::trace_event::MemoryDumpType::EXPLICITLY_TRIGGERED, |
| 57 base::trace_event::MemoryDumpLevelOfDetail::BACKGROUND); | 61 base::trace_event::MemoryDumpLevelOfDetail::BACKGROUND); |
| 58 } | 62 } |
| 59 | 63 |
| 60 } // namespace | 64 } // namespace |
| 61 | 65 |
| 62 BackgroundTracingManagerImpl::TracingTimer::TracingTimer( | 66 BackgroundTracingManagerImpl::TracingTimer::TracingTimer( |
| 63 StartedFinalizingCallback callback) : callback_(callback) { | 67 StartedFinalizingCallback callback) : callback_(callback) { |
| 64 } | 68 } |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 case BackgroundTracingConfigImpl::CategoryPreset::BLINK_STYLE: | 563 case BackgroundTracingConfigImpl::CategoryPreset::BLINK_STYLE: |
| 560 return "blink_style"; | 564 return "blink_style"; |
| 561 case BackgroundTracingConfigImpl::CategoryPreset::CATEGORY_PRESET_UNSET: | 565 case BackgroundTracingConfigImpl::CategoryPreset::CATEGORY_PRESET_UNSET: |
| 562 NOTREACHED(); | 566 NOTREACHED(); |
| 563 } | 567 } |
| 564 NOTREACHED(); | 568 NOTREACHED(); |
| 565 return ""; | 569 return ""; |
| 566 } | 570 } |
| 567 | 571 |
| 568 } // namspace content | 572 } // namspace content |
| OLD | NEW |