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)); | |
59 dump_manager->RequestGlobalDump( | 55 dump_manager->RequestGlobalDump( |
60 base::trace_event::MemoryDumpType::EXPLICITLY_TRIGGERED, | 56 base::trace_event::MemoryDumpType::EXPLICITLY_TRIGGERED, |
61 base::trace_event::MemoryDumpLevelOfDetail::BACKGROUND); | 57 base::trace_event::MemoryDumpLevelOfDetail::BACKGROUND); |
62 } | 58 } |
63 | 59 |
64 } // namespace | 60 } // namespace |
65 | 61 |
66 BackgroundTracingManagerImpl::TracingTimer::TracingTimer( | 62 BackgroundTracingManagerImpl::TracingTimer::TracingTimer( |
67 StartedFinalizingCallback callback) : callback_(callback) { | 63 StartedFinalizingCallback callback) : callback_(callback) { |
68 } | 64 } |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 case BackgroundTracingConfigImpl::CategoryPreset::BLINK_STYLE: | 559 case BackgroundTracingConfigImpl::CategoryPreset::BLINK_STYLE: |
564 return "blink_style"; | 560 return "blink_style"; |
565 case BackgroundTracingConfigImpl::CategoryPreset::CATEGORY_PRESET_UNSET: | 561 case BackgroundTracingConfigImpl::CategoryPreset::CATEGORY_PRESET_UNSET: |
566 NOTREACHED(); | 562 NOTREACHED(); |
567 } | 563 } |
568 NOTREACHED(); | 564 NOTREACHED(); |
569 return ""; | 565 return ""; |
570 } | 566 } |
571 | 567 |
572 } // namspace content | 568 } // namspace content |
OLD | NEW |