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

Side by Side 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, 10 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 unified diff | Download patch
OLDNEW
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/trace_event/heap_profiler_heap_dump_writer.h"
10 #include "base/trace_event/process_memory_dump.h" 11 #include "base/trace_event/process_memory_dump.h"
12 #include "base/trace_event/trace_event_argument.h"
13 #include "base/trace_event/trace_event_memory_overhead.h"
11 #include "content/child/web_memory_allocator_dump_impl.h" 14 #include "content/child/web_memory_allocator_dump_impl.h"
12 #include "skia/ext/skia_trace_memory_dump_impl.h" 15 #include "skia/ext/skia_trace_memory_dump_impl.h"
13 16
14 namespace content { 17 namespace content {
15 18
16 WebProcessMemoryDumpImpl::WebProcessMemoryDumpImpl() 19 WebProcessMemoryDumpImpl::WebProcessMemoryDumpImpl()
17 : owned_process_memory_dump_( 20 : owned_process_memory_dump_(
18 new base::trace_event::ProcessMemoryDump(nullptr)), 21 new base::trace_event::ProcessMemoryDump(nullptr)),
19 process_memory_dump_(owned_process_memory_dump_.get()), 22 process_memory_dump_(owned_process_memory_dump_.get()),
20 level_of_detail_(base::trace_event::MemoryDumpLevelOfDetail::DETAILED) {} 23 level_of_detail_(base::trace_event::MemoryDumpLevelOfDetail::DETAILED) {}
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 blink::WebMemoryAllocatorDump* 158 blink::WebMemoryAllocatorDump*
156 WebProcessMemoryDumpImpl::CreateDiscardableMemoryAllocatorDump( 159 WebProcessMemoryDumpImpl::CreateDiscardableMemoryAllocatorDump(
157 const std::string& name, 160 const std::string& name,
158 base::DiscardableMemory* discardable) { 161 base::DiscardableMemory* discardable) {
159 base::trace_event::MemoryAllocatorDump* dump = 162 base::trace_event::MemoryAllocatorDump* dump =
160 discardable->CreateMemoryAllocatorDump(name.c_str(), 163 discardable->CreateMemoryAllocatorDump(name.c_str(),
161 process_memory_dump_); 164 process_memory_dump_);
162 return createWebMemoryAllocatorDump(dump); 165 return createWebMemoryAllocatorDump(dump);
163 } 166 }
164 167
168 void WebProcessMemoryDumpImpl::dumpPartitionAllocHeapUsage(
169 const base::hash_map<base::trace_event::AllocationContext, size_t>&
170 bytes_by_context,
171 base::trace_event::TraceEventMemoryOverhead& overhead) {
172 scoped_refptr<base::trace_event::MemoryDumpSessionState> session_state =
173 process_memory_dump_->session_state();
174 scoped_refptr<base::trace_event::TracedValue> heap_dump = ExportHeapDump(
175 bytes_by_context,
176 session_state->stack_frame_deduplicator(),
177 session_state->type_name_deduplicator());
178 process_memory_dump_->AddHeapDump("partition_alloc", heap_dump);
Primiano Tucci (use gerrit) 2016/02/02 12:29:59 why don't you pass this string as an argument and
hajimehoshi 2016/02/03 08:20:26 Done.
179 overhead.DumpInto("tracing/heap_profiler", process_memory_dump_);
180 }
181
165 } // namespace content 182 } // namespace content
OLDNEW
« 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