| OLD | NEW |
| (Empty) |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/browser/tracing/background_memory_tracing_observer.h" | |
| 6 | |
| 7 #include "base/trace_event/memory_dump_manager.h" | |
| 8 | |
| 9 namespace content { | |
| 10 | |
| 11 // static | |
| 12 BackgroundMemoryTracingObserver* | |
| 13 BackgroundMemoryTracingObserver::GetInstance() { | |
| 14 static auto* instance = new BackgroundMemoryTracingObserver; | |
| 15 return instance; | |
| 16 } | |
| 17 | |
| 18 BackgroundMemoryTracingObserver::BackgroundMemoryTracingObserver() {} | |
| 19 BackgroundMemoryTracingObserver::~BackgroundMemoryTracingObserver() {} | |
| 20 | |
| 21 void BackgroundMemoryTracingObserver::OnScenarioActivated( | |
| 22 const BackgroundTracingConfigImpl& config) {} | |
| 23 | |
| 24 void BackgroundMemoryTracingObserver::OnTracingEnabled( | |
| 25 BackgroundTracingConfigImpl::CategoryPreset preset) { | |
| 26 if (preset == | |
| 27 BackgroundTracingConfigImpl::CategoryPreset::BENCHMARK_MEMORY_LIGHT) { | |
| 28 auto* dump_manager = base::trace_event::MemoryDumpManager::GetInstance(); | |
| 29 dump_manager->RequestGlobalDump( | |
| 30 base::trace_event::MemoryDumpType::EXPLICITLY_TRIGGERED, | |
| 31 base::trace_event::MemoryDumpLevelOfDetail::BACKGROUND); | |
| 32 } | |
| 33 } | |
| 34 | |
| 35 } // namespace content | |
| OLD | NEW |