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

Unified Diff: gpu/command_buffer/service/buffer_manager.cc

Issue 2866973003: Fix global dumps to be dumped only when shared memory is actually used
Patch Set: Remove change for GpuMemoryBuffer Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/client/transfer_buffer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/buffer_manager.cc
diff --git a/gpu/command_buffer/service/buffer_manager.cc b/gpu/command_buffer/service/buffer_manager.cc
index 4469af8f2edde71928f86ee080007303eda04c91..b37285e688ae84c464c00af38ce8c20ed4b19294 100644
--- a/gpu/command_buffer/service/buffer_manager.cc
+++ b/gpu/command_buffer/service/buffer_manager.cc
@@ -737,10 +737,13 @@ bool BufferManager::OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
MemoryAllocatorDump::kUnitsBytes,
static_cast<uint64_t>(buffer->size()));
- auto guid = gl::GetGLBufferGUIDForTracing(share_group_tracing_guid,
- client_buffer_id);
- pmd->CreateSharedGlobalAllocatorDump(guid);
- pmd->AddOwnershipEdge(dump->guid(), guid);
+ auto* mapped_range = buffer->GetMappedRange();
+ if (mapped_range && mapped_range->shm->backing()->is_shared()) {
+ auto guid = gl::GetGLBufferGUIDForTracing(share_group_tracing_guid,
+ client_buffer_id);
+ pmd->CreateSharedGlobalAllocatorDump(guid);
+ pmd->AddOwnershipEdge(dump->guid(), guid);
+ }
}
return true;
« no previous file with comments | « gpu/command_buffer/client/transfer_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698