| 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 "base/trace_event/memory_dump_manager.h" | 5 #include "base/trace_event/memory_dump_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 } | 268 } |
| 269 | 269 |
| 270 void EnableTracingWithTraceConfig(const std::string& trace_config) { | 270 void EnableTracingWithTraceConfig(const std::string& trace_config) { |
| 271 TraceLog::GetInstance()->SetEnabled(TraceConfig(trace_config), | 271 TraceLog::GetInstance()->SetEnabled(TraceConfig(trace_config), |
| 272 TraceLog::RECORDING_MODE); | 272 TraceLog::RECORDING_MODE); |
| 273 } | 273 } |
| 274 | 274 |
| 275 void DisableTracing() { TraceLog::GetInstance()->SetDisabled(); } | 275 void DisableTracing() { TraceLog::GetInstance()->SetDisabled(); } |
| 276 | 276 |
| 277 bool IsPeriodicDumpingEnabled() const { | 277 bool IsPeriodicDumpingEnabled() const { |
| 278 return mdm_->dump_scheduler_->IsPeriodicTimerRunningForTesting(); | 278 return MemoryDumpScheduler::GetInstance() |
| 279 ->IsPeriodicTimerRunningForTesting(); |
| 279 } | 280 } |
| 280 | 281 |
| 281 int GetMaxConsecutiveFailuresCount() const { | 282 int GetMaxConsecutiveFailuresCount() const { |
| 282 return MemoryDumpManager::kMaxConsecutiveFailuresCount; | 283 return MemoryDumpManager::kMaxConsecutiveFailuresCount; |
| 283 } | 284 } |
| 284 | 285 |
| 285 const MemoryDumpProvider::Options kDefaultOptions; | 286 const MemoryDumpProvider::Options kDefaultOptions; |
| 286 std::unique_ptr<MemoryDumpManager> mdm_; | 287 std::unique_ptr<MemoryDumpManager> mdm_; |
| 287 MemoryDumpManagerDelegateForTesting* delegate_; | 288 MemoryDumpManagerDelegateForTesting* delegate_; |
| 288 bool last_callback_success_; | 289 bool last_callback_success_; |
| (...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1286 thread.Start(); | 1287 thread.Start(); |
| 1287 RegisterDumpProvider(&mdp1, thread.task_runner(), kDefaultOptions, | 1288 RegisterDumpProvider(&mdp1, thread.task_runner(), kDefaultOptions, |
| 1288 "BlacklistTestDumpProvider"); | 1289 "BlacklistTestDumpProvider"); |
| 1289 // Unregistering on wrong thread should not crash. | 1290 // Unregistering on wrong thread should not crash. |
| 1290 mdm_->UnregisterDumpProvider(&mdp1); | 1291 mdm_->UnregisterDumpProvider(&mdp1); |
| 1291 thread.Stop(); | 1292 thread.Stop(); |
| 1292 } | 1293 } |
| 1293 | 1294 |
| 1294 } // namespace trace_event | 1295 } // namespace trace_event |
| 1295 } // namespace base | 1296 } // namespace base |
| OLD | NEW |