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

Side by Side Diff: content/child/web_process_memory_dump_impl.cc

Issue 1308523004: Implement GetSkiaTraceMemoryDump and AddSuballocation on chrome blink platform impl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web_cache_move
Patch Set: rebase. Created 5 years, 2 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 | « content/child/web_process_memory_dump_impl.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 "content/child/web_process_memory_dump_impl.h" 5 #include "content/child/web_process_memory_dump_impl.h"
6 6
7 #include "base/trace_event/process_memory_dump.h" 7 #include "base/trace_event/process_memory_dump.h"
8 #include "content/child/web_memory_allocator_dump_impl.h" 8 #include "content/child/web_memory_allocator_dump_impl.h"
9 #include "skia/ext/SkTraceMemoryDump_chrome.h"
9 10
10 namespace content { 11 namespace content {
11 12
12 WebProcessMemoryDumpImpl::WebProcessMemoryDumpImpl() 13 WebProcessMemoryDumpImpl::WebProcessMemoryDumpImpl()
13 : owned_process_memory_dump_( 14 : owned_process_memory_dump_(
14 new base::trace_event::ProcessMemoryDump(nullptr)), 15 new base::trace_event::ProcessMemoryDump(nullptr)),
15 process_memory_dump_(owned_process_memory_dump_.get()) { 16 process_memory_dump_(owned_process_memory_dump_.get()),
16 } 17 level_of_detail_(base::trace_event::MemoryDumpLevelOfDetail::DETAILED) {}
17 18
18 WebProcessMemoryDumpImpl::WebProcessMemoryDumpImpl( 19 WebProcessMemoryDumpImpl::WebProcessMemoryDumpImpl(
20 base::trace_event::MemoryDumpLevelOfDetail level_of_detail,
19 base::trace_event::ProcessMemoryDump* process_memory_dump) 21 base::trace_event::ProcessMemoryDump* process_memory_dump)
20 : process_memory_dump_(process_memory_dump) { 22 : process_memory_dump_(process_memory_dump),
21 } 23 level_of_detail_(level_of_detail) {}
22 24
23 WebProcessMemoryDumpImpl::~WebProcessMemoryDumpImpl() { 25 WebProcessMemoryDumpImpl::~WebProcessMemoryDumpImpl() {
24 } 26 }
25 27
26 blink::WebMemoryAllocatorDump* 28 blink::WebMemoryAllocatorDump*
27 WebProcessMemoryDumpImpl::createMemoryAllocatorDump( 29 WebProcessMemoryDumpImpl::createMemoryAllocatorDump(
28 const blink::WebString& absolute_name) { 30 const blink::WebString& absolute_name) {
29 // Get a MemoryAllocatorDump from the base/ object. 31 // Get a MemoryAllocatorDump from the base/ object.
30 base::trace_event::MemoryAllocatorDump* memory_allocator_dump = 32 base::trace_event::MemoryAllocatorDump* memory_allocator_dump =
31 process_memory_dump_->CreateAllocatorDump(absolute_name.utf8()); 33 process_memory_dump_->CreateAllocatorDump(absolute_name.utf8());
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 127 }
126 128
127 void WebProcessMemoryDumpImpl::AddOwnershipEdge( 129 void WebProcessMemoryDumpImpl::AddOwnershipEdge(
128 blink::WebMemoryAllocatorDumpGuid source, 130 blink::WebMemoryAllocatorDumpGuid source,
129 blink::WebMemoryAllocatorDumpGuid target) { 131 blink::WebMemoryAllocatorDumpGuid target) {
130 process_memory_dump_->AddOwnershipEdge( 132 process_memory_dump_->AddOwnershipEdge(
131 base::trace_event::MemoryAllocatorDumpGuid(source), 133 base::trace_event::MemoryAllocatorDumpGuid(source),
132 base::trace_event::MemoryAllocatorDumpGuid(target)); 134 base::trace_event::MemoryAllocatorDumpGuid(target));
133 } 135 }
134 136
137 void WebProcessMemoryDumpImpl::AddSuballocation(
138 blink::WebMemoryAllocatorDumpGuid source,
139 const blink::WebString& targetNodeName) {
140 process_memory_dump_->AddSuballocation(
141 base::trace_event::MemoryAllocatorDumpGuid(source),
142 targetNodeName.utf8());
143 }
144
145 SkTraceMemoryDump* WebProcessMemoryDumpImpl::CreateDumpAdapterForSkia(
146 const blink::WebString& dumpNamePrefix) {
147 sk_trace_dump_list_.push_back(new skia::SkTraceMemoryDump_Chrome(
148 dumpNamePrefix.utf8(), level_of_detail_, process_memory_dump_));
149 return sk_trace_dump_list_.back();
150 }
151
135 } // namespace content 152 } // namespace content
OLDNEW
« no previous file with comments | « content/child/web_process_memory_dump_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698