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

Unified Diff: content/child/web_process_memory_dump_impl.cc

Issue 1642023007: Refactoring: Move functions from WebMemoryDumpProviderAdapter to PartitionAllocMemoryDumpProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: primiano's review Created 4 years, 11 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: content/child/web_process_memory_dump_impl.cc
diff --git a/content/child/web_process_memory_dump_impl.cc b/content/child/web_process_memory_dump_impl.cc
index c8c3ca786174a6be97704da78111e2947c76d8e4..a95c9d7a583ef74d00aa98e209049e6430b0f936 100644
--- a/content/child/web_process_memory_dump_impl.cc
+++ b/content/child/web_process_memory_dump_impl.cc
@@ -7,7 +7,10 @@
#include <stddef.h>
#include "base/memory/discardable_memory.h"
+#include "base/trace_event/heap_profiler_heap_dump_writer.h"
#include "base/trace_event/process_memory_dump.h"
+#include "base/trace_event/trace_event_argument.h"
+#include "base/trace_event/trace_event_memory_overhead.h"
#include "content/child/web_memory_allocator_dump_impl.h"
#include "skia/ext/skia_trace_memory_dump_impl.h"
@@ -162,4 +165,19 @@ WebProcessMemoryDumpImpl::CreateDiscardableMemoryAllocatorDump(
return createWebMemoryAllocatorDump(dump);
}
+void WebProcessMemoryDumpImpl::dumpHeapUsage(
+ const base::hash_map<base::trace_event::AllocationContext, size_t>&
+ bytes_by_context,
+ base::trace_event::TraceEventMemoryOverhead& overhead,
+ const char* allocator_name) {
+ scoped_refptr<base::trace_event::MemoryDumpSessionState> session_state =
+ process_memory_dump_->session_state();
+ scoped_refptr<base::trace_event::TracedValue> heap_dump = ExportHeapDump(
+ bytes_by_context,
+ session_state->stack_frame_deduplicator(),
+ session_state->type_name_deduplicator());
+ process_memory_dump_->AddHeapDump(allocator_name, heap_dump);
+ overhead.DumpInto("tracing/heap_profiler", process_memory_dump_);
+}
+
} // namespace content
« no previous file with comments | « content/child/web_process_memory_dump_impl.h ('k') | third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698