| 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 "content/child/web_process_memory_dump_impl.h" | 5 #include "content/child/web_process_memory_dump_impl.h" | 
| 6 | 6 | 
| 7 #include <stddef.h> | 7 #include <stddef.h> | 
| 8 | 8 | 
| 9 #include "base/memory/discardable_memory.h" | 9 #include "base/memory/discardable_memory.h" | 
|  | 10 #include "base/strings/stringprintf.h" | 
| 10 #include "base/trace_event/heap_profiler_heap_dump_writer.h" | 11 #include "base/trace_event/heap_profiler_heap_dump_writer.h" | 
| 11 #include "base/trace_event/process_memory_dump.h" | 12 #include "base/trace_event/process_memory_dump.h" | 
| 12 #include "base/trace_event/trace_event_argument.h" | 13 #include "base/trace_event/trace_event_argument.h" | 
| 13 #include "base/trace_event/trace_event_memory_overhead.h" | 14 #include "base/trace_event/trace_event_memory_overhead.h" | 
| 14 #include "content/child/web_memory_allocator_dump_impl.h" | 15 #include "content/child/web_memory_allocator_dump_impl.h" | 
| 15 #include "skia/ext/skia_trace_memory_dump_impl.h" | 16 #include "skia/ext/skia_trace_memory_dump_impl.h" | 
| 16 | 17 | 
| 17 namespace content { | 18 namespace content { | 
| 18 | 19 | 
| 19 WebProcessMemoryDumpImpl::WebProcessMemoryDumpImpl() | 20 WebProcessMemoryDumpImpl::WebProcessMemoryDumpImpl() | 
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 170         bytes_by_context, | 171         bytes_by_context, | 
| 171     base::trace_event::TraceEventMemoryOverhead& overhead, | 172     base::trace_event::TraceEventMemoryOverhead& overhead, | 
| 172     const char* allocator_name) { | 173     const char* allocator_name) { | 
| 173   scoped_refptr<base::trace_event::MemoryDumpSessionState> session_state = | 174   scoped_refptr<base::trace_event::MemoryDumpSessionState> session_state = | 
| 174       process_memory_dump_->session_state(); | 175       process_memory_dump_->session_state(); | 
| 175   scoped_refptr<base::trace_event::TracedValue> heap_dump = ExportHeapDump( | 176   scoped_refptr<base::trace_event::TracedValue> heap_dump = ExportHeapDump( | 
| 176       bytes_by_context, | 177       bytes_by_context, | 
| 177       session_state->stack_frame_deduplicator(), | 178       session_state->stack_frame_deduplicator(), | 
| 178       session_state->type_name_deduplicator()); | 179       session_state->type_name_deduplicator()); | 
| 179   process_memory_dump_->AddHeapDump(allocator_name, heap_dump); | 180   process_memory_dump_->AddHeapDump(allocator_name, heap_dump); | 
| 180   overhead.DumpInto("tracing/heap_profiler", process_memory_dump_); | 181   std::string base_name = base::StringPrintf("tracing/heap_profiler_%s", | 
|  | 182                                              allocator_name); | 
|  | 183   overhead.DumpInto(base_name.c_str(), process_memory_dump_); | 
| 181 } | 184 } | 
| 182 | 185 | 
| 183 }  // namespace content | 186 }  // namespace content | 
| OLD | NEW | 
|---|