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

Side by Side Diff: content/common/host_shared_bitmap_manager.cc

Issue 1262333005: [tracing] Introduce MemoryDumpArgs to enable light and heavy dumps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 4 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/common/host_shared_bitmap_manager.h ('k') | gin/v8_isolate_memory_dump_provider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/common/host_shared_bitmap_manager.h" 5 #include "content/common/host_shared_bitmap_manager.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/trace_event/process_memory_dump.h" 10 #include "base/trace_event/process_memory_dump.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 142 }
143 if (!data->memory->memory()) { 143 if (!data->memory->memory()) {
144 return scoped_ptr<cc::SharedBitmap>(); 144 return scoped_ptr<cc::SharedBitmap>();
145 } 145 }
146 146
147 return make_scoped_ptr(new HostSharedBitmap( 147 return make_scoped_ptr(new HostSharedBitmap(
148 static_cast<uint8*>(data->memory->memory()), data, id, nullptr)); 148 static_cast<uint8*>(data->memory->memory()), data, id, nullptr));
149 } 149 }
150 150
151 bool HostSharedBitmapManager::OnMemoryDump( 151 bool HostSharedBitmapManager::OnMemoryDump(
152 const base::trace_event::MemoryDumpArgs& args,
152 base::trace_event::ProcessMemoryDump* pmd) { 153 base::trace_event::ProcessMemoryDump* pmd) {
153 base::AutoLock lock(lock_); 154 base::AutoLock lock(lock_);
154 155
155 for (const auto& bitmap : handle_map_) { 156 for (const auto& bitmap : handle_map_) {
156 base::trace_event::MemoryAllocatorDump* dump = 157 base::trace_event::MemoryAllocatorDump* dump =
157 pmd->CreateAllocatorDump(base::StringPrintf( 158 pmd->CreateAllocatorDump(base::StringPrintf(
158 "sharedbitmap/%s", 159 "sharedbitmap/%s",
159 base::HexEncode(bitmap.first.name, sizeof(bitmap.first.name)) 160 base::HexEncode(bitmap.first.name, sizeof(bitmap.first.name))
160 .c_str())); 161 .c_str()));
161 if (!dump) 162 if (!dump)
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 return handle_map_.size(); 240 return handle_map_.size();
240 } 241 }
241 242
242 void HostSharedBitmapManager::FreeSharedMemoryFromMap( 243 void HostSharedBitmapManager::FreeSharedMemoryFromMap(
243 const cc::SharedBitmapId& id) { 244 const cc::SharedBitmapId& id) {
244 base::AutoLock lock(lock_); 245 base::AutoLock lock(lock_);
245 handle_map_.erase(id); 246 handle_map_.erase(id);
246 } 247 }
247 248
248 } // namespace content 249 } // namespace content
OLDNEW
« no previous file with comments | « content/common/host_shared_bitmap_manager.h ('k') | gin/v8_isolate_memory_dump_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698