Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: base/trace_event/memory_dump_manager_unittest.cc

Issue 2743993004: [memory-infra] Make MemoryDumpScheduler non-thread safe singleton (Closed)
Patch Set: rebase. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/trace_event/memory_dump_manager.cc ('k') | base/trace_event/memory_dump_scheduler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « base/trace_event/memory_dump_manager.cc ('k') | base/trace_event/memory_dump_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698