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

Unified Diff: base/trace_event/memory_dump_manager.cc

Issue 1308443002: Reland of "[tracing] Add browser-side tests for memory dumps." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase onto https://crrev.com/1289793007 Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/trace_event/memory_dump_manager.h ('k') | content/browser/tracing/memory_tracing_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_dump_manager.cc
diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc
index f6e0239a215393866b2537800aab4931cfa77153..1c3c581d8ebece634081ce613e1057a0d0d70111 100644
--- a/base/trace_event/memory_dump_manager.cc
+++ b/base/trace_event/memory_dump_manager.cc
@@ -97,7 +97,8 @@ MemoryDumpManager::MemoryDumpManager()
memory_tracing_enabled_(0),
tracing_process_id_(kInvalidTracingProcessId),
system_allocator_pool_name_(nullptr),
- skip_core_dumpers_auto_registration_for_testing_(false) {
+ skip_core_dumpers_auto_registration_for_testing_(false),
+ disable_periodic_dumps_for_testing_(false) {
g_next_guid.GetNext(); // Make sure that first guid is not zero.
}
@@ -423,9 +424,11 @@ void MemoryDumpManager::OnTraceLogEnabled() {
// TODO(primiano): This is a temporary hack to disable periodic memory dumps
// when running memory benchmarks until they can be enabled/disabled in
// base::trace_event::TraceConfig. See https://goo.gl/5Hj3o0.
+ // The same mechanism should be used to disable periodic dumps in tests.
if (delegate_->IsCoordinatorProcess() &&
!CommandLine::ForCurrentProcess()->HasSwitch(
- "enable-memory-benchmarking")) {
+ "enable-memory-benchmarking") &&
+ !disable_periodic_dumps_for_testing_) {
g_periodic_dumps_count = 0;
periodic_dump_timer_.Start(FROM_HERE,
TimeDelta::FromMilliseconds(kDumpIntervalMs),
« no previous file with comments | « base/trace_event/memory_dump_manager.h ('k') | content/browser/tracing/memory_tracing_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698