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

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: Add args in impl. Created 5 years, 3 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 "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 dump_args_(nullptr) {}
17 18
18 WebProcessMemoryDumpImpl::WebProcessMemoryDumpImpl( 19 WebProcessMemoryDumpImpl::WebProcessMemoryDumpImpl(
20 const base::trace_event::MemoryDumpArgs* dump_args,
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), dump_args_(dump_args) {}
21 }
22 23
23 WebProcessMemoryDumpImpl::~WebProcessMemoryDumpImpl() { 24 WebProcessMemoryDumpImpl::~WebProcessMemoryDumpImpl() {
24 } 25 }
25 26
26 blink::WebMemoryAllocatorDump* 27 blink::WebMemoryAllocatorDump*
27 WebProcessMemoryDumpImpl::createMemoryAllocatorDump( 28 WebProcessMemoryDumpImpl::createMemoryAllocatorDump(
28 const blink::WebString& absolute_name) { 29 const blink::WebString& absolute_name) {
29 // Get a MemoryAllocatorDump from the base/ object. 30 // Get a MemoryAllocatorDump from the base/ object.
30 base::trace_event::MemoryAllocatorDump* memory_allocator_dump = 31 base::trace_event::MemoryAllocatorDump* memory_allocator_dump =
31 process_memory_dump_->CreateAllocatorDump(absolute_name.utf8()); 32 process_memory_dump_->CreateAllocatorDump(absolute_name.utf8());
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 126 }
126 127
127 void WebProcessMemoryDumpImpl::AddOwnershipEdge( 128 void WebProcessMemoryDumpImpl::AddOwnershipEdge(
128 blink::WebMemoryAllocatorDumpGuid source, 129 blink::WebMemoryAllocatorDumpGuid source,
129 blink::WebMemoryAllocatorDumpGuid target) { 130 blink::WebMemoryAllocatorDumpGuid target) {
130 process_memory_dump_->AddOwnershipEdge( 131 process_memory_dump_->AddOwnershipEdge(
131 base::trace_event::MemoryAllocatorDumpGuid(source), 132 base::trace_event::MemoryAllocatorDumpGuid(source),
132 base::trace_event::MemoryAllocatorDumpGuid(target)); 133 base::trace_event::MemoryAllocatorDumpGuid(target));
133 } 134 }
134 135
136 void WebProcessMemoryDumpImpl::AddSuballocation(
137 blink::WebMemoryAllocatorDumpGuid source,
138 const blink::WebString& targetNodeName) {
139 process_memory_dump_->AddSuballocation(
140 base::trace_event::MemoryAllocatorDumpGuid(source),
141 targetNodeName.utf8());
142 }
143
144 SkTraceMemoryDump* WebProcessMemoryDumpImpl::CreateDumpAdapterForSkia(
145 const blink::WebString& dumpNamePrefix) {
146 sk_trace_dump_list_.push_back(new skia::SkTraceMemoryDump_Chrome(
147 dumpNamePrefix.utf8().data(), dump_args_.level_of_detail,
148 process_memory_dump_));
149 return sk_trace_dump_list_.back();
150 }
151
135 } // namespace content 152 } // namespace content
OLDNEW
« content/child/web_process_memory_dump_impl.h ('K') | « 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