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

Side by Side Diff: third_party/WebKit/Source/platform/web_process_memory_dump_impl.cc

Issue 2016613002: Remove ProcessMemoryDump::AddHeapDump() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/platform/WebProcessMemoryDump.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "platform/web_process_memory_dump_impl.h" 5 #include "platform/web_process_memory_dump_impl.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" 10 #include "base/trace_event/heap_profiler_heap_dump_writer.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 discardable->CreateMemoryAllocatorDump(name.c_str(), 165 discardable->CreateMemoryAllocatorDump(name.c_str(),
166 process_memory_dump_); 166 process_memory_dump_);
167 return createWebMemoryAllocatorDump(dump); 167 return createWebMemoryAllocatorDump(dump);
168 } 168 }
169 169
170 void WebProcessMemoryDumpImpl::dumpHeapUsage( 170 void WebProcessMemoryDumpImpl::dumpHeapUsage(
171 const base::hash_map<base::trace_event::AllocationContext, 171 const base::hash_map<base::trace_event::AllocationContext,
172 base::trace_event::AllocationMetrics>& metrics_by_context, 172 base::trace_event::AllocationMetrics>& metrics_by_context,
173 base::trace_event::TraceEventMemoryOverhead& overhead, 173 base::trace_event::TraceEventMemoryOverhead& overhead,
174 const char* allocator_name) { 174 const char* allocator_name) {
175 if (!metrics_by_context.empty()) { 175 process_memory_dump_->DumpHeapUsage(metrics_by_context, overhead, allocator_na me);
176 scoped_refptr<base::trace_event::MemoryDumpSessionState> session_state =
177 process_memory_dump_->session_state();
178 std::unique_ptr<base::trace_event::TracedValue> heap_dump = ExportHeapDump(
179 metrics_by_context, *session_state);
180 process_memory_dump_->AddHeapDump(allocator_name, std::move(heap_dump));
181 }
182
183 std::string base_name = base::StringPrintf("tracing/heap_profiler_%s",
184 allocator_name);
185 overhead.DumpInto(base_name.c_str(), process_memory_dump_);
186 } 176 }
187 177
188 } // namespace content 178 } // namespace content
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/WebProcessMemoryDump.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698