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

Unified Diff: base/trace_event/process_memory_dump.cc

Issue 2861133002: memory-infra: Move dump level check to observer and rename session state (Closed)
Patch Set: move comment Created 3 years, 7 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
Index: base/trace_event/process_memory_dump.cc
diff --git a/base/trace_event/process_memory_dump.cc b/base/trace_event/process_memory_dump.cc
index da7bcad0959f9e782d59409b6e5e975fd23d0bc6..0a2bf66620f4a173dd6e34269db614cf85e1d02e 100644
--- a/base/trace_event/process_memory_dump.cc
+++ b/base/trace_event/process_memory_dump.cc
@@ -12,6 +12,7 @@
#include "base/process/process_metrics.h"
#include "base/strings/stringprintf.h"
#include "base/trace_event/heap_profiler_heap_dump_writer.h"
+#include "base/trace_event/heap_profiler_serialization_state.h"
#include "base/trace_event/memory_infra_background_whitelist.h"
#include "base/trace_event/process_memory_totals.h"
#include "base/trace_event/trace_event_argument.h"
@@ -151,11 +152,13 @@ size_t ProcessMemoryDump::CountResidentBytes(void* start_address,
#endif // defined(COUNT_RESIDENT_BYTES_SUPPORTED)
ProcessMemoryDump::ProcessMemoryDump(
- scoped_refptr<MemoryDumpSessionState> session_state,
+ scoped_refptr<HeapProfilerSerializationState>
+ heap_profiler_serialization_state,
const MemoryDumpArgs& dump_args)
: has_process_totals_(false),
has_process_mmaps_(false),
- session_state_(std::move(session_state)),
+ heap_profiler_serialization_state_(
+ std::move(heap_profiler_serialization_state)),
dump_args_(dump_args) {}
ProcessMemoryDump::~ProcessMemoryDump() {}
@@ -252,7 +255,7 @@ void ProcessMemoryDump::DumpHeapUsage(
if (!metrics_by_context.empty()) {
DCHECK_EQ(0ul, heap_dumps_.count(allocator_name));
std::unique_ptr<TracedValue> heap_dump = ExportHeapDump(
- metrics_by_context, *session_state());
+ metrics_by_context, *heap_profiler_serialization_state());
heap_dumps_[allocator_name] = std::move(heap_dump);
}

Powered by Google App Engine
This is Rietveld 408576698