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 "platform/instrumentation/tracing/web_process_memory_dump.h" | 5 #include "platform/instrumentation/tracing/web_process_memory_dump.h" |
6 | 6 |
7 #include "base/memory/discardable_memory.h" | 7 #include "base/memory/discardable_memory.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/trace_event/heap_profiler_heap_dump_writer.h" | |
11 #include "base/trace_event/process_memory_dump.h" | 10 #include "base/trace_event/process_memory_dump.h" |
12 #include "base/trace_event/trace_event_argument.h" | 11 #include "base/trace_event/trace_event_argument.h" |
13 #include "base/trace_event/trace_event_memory_overhead.h" | 12 #include "base/trace_event/trace_event_memory_overhead.h" |
14 #include "platform/instrumentation/tracing/web_memory_allocator_dump.h" | 13 #include "platform/instrumentation/tracing/web_memory_allocator_dump.h" |
15 #include "skia/ext/skia_trace_memory_dump_impl.h" | 14 #include "skia/ext/skia_trace_memory_dump_impl.h" |
16 #include "wtf/text/StringUTF8Adaptor.h" | 15 #include "wtf/text/StringUTF8Adaptor.h" |
17 | 16 |
18 #include <stddef.h> | 17 #include <stddef.h> |
19 | 18 |
20 namespace blink { | 19 namespace blink { |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 blink::WebMemoryAllocatorDump* | 166 blink::WebMemoryAllocatorDump* |
168 WebProcessMemoryDump::createDiscardableMemoryAllocatorDump( | 167 WebProcessMemoryDump::createDiscardableMemoryAllocatorDump( |
169 const std::string& name, | 168 const std::string& name, |
170 base::DiscardableMemory* discardable) { | 169 base::DiscardableMemory* discardable) { |
171 base::trace_event::MemoryAllocatorDump* dump = | 170 base::trace_event::MemoryAllocatorDump* dump = |
172 discardable->CreateMemoryAllocatorDump(name.c_str(), | 171 discardable->CreateMemoryAllocatorDump(name.c_str(), |
173 process_memory_dump_); | 172 process_memory_dump_); |
174 return createWebMemoryAllocatorDump(dump); | 173 return createWebMemoryAllocatorDump(dump); |
175 } | 174 } |
176 | 175 |
177 void WebProcessMemoryDump::dumpHeapUsage( | |
178 const base::hash_map<base::trace_event::AllocationContext, | |
179 base::trace_event::AllocationMetrics>& | |
180 metrics_by_context, | |
181 base::trace_event::TraceEventMemoryOverhead& overhead, | |
182 const char* allocator_name) { | |
183 process_memory_dump_->DumpHeapUsage(metrics_by_context, overhead, | |
184 allocator_name); | |
185 } | |
186 | |
187 } // namespace content | 176 } // namespace content |
OLD | NEW |